Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package de.cryptonicdev.cryptonic.gui;
- import java.awt.Graphics2D;
- import java.awt.image.BufferedImage;
- import java.io.File;
- import java.io.IOException;
- import javax.imageio.ImageIO;
- import org.apache.commons.lang3.Validate;
- import org.lwjgl.opengl.GL11;
- import com.google.common.base.Charsets;
- import de.cryptonicdev.cryptonic.main.Cryptonic;
- import de.cryptonicdev.cryptonic.menu.GuiScreenMenu;
- import de.cryptonicdev.cryptonic.particle.ParticleGenerator;
- import io.netty.buffer.ByteBuf;
- import io.netty.buffer.ByteBufInputStream;
- import io.netty.buffer.Unpooled;
- import io.netty.handler.codec.base64.Base64;
- import net.minecraft.client.gui.Gui;
- import net.minecraft.client.gui.GuiButton;
- import net.minecraft.client.gui.GuiMultiplayer;
- import net.minecraft.client.gui.GuiOptions;
- import net.minecraft.client.gui.GuiScreen;
- import net.minecraft.client.gui.GuiSelectWorld;
- import net.minecraft.client.renderer.GlStateManager;
- import net.minecraft.client.renderer.texture.DynamicTexture;
- import net.minecraft.client.renderer.texture.TextureUtil;
- import net.minecraft.client.resources.I18n;
- import net.minecraft.util.ResourceLocation;
- public class GuiScreenMainMenu extends GuiScreen {
- private ParticleGenerator gParticle = null;
- @Override
- public void initGui() {
- this.gParticle = new ParticleGenerator(this.width / 4, this.width, this.height);
- int heightAddition = 8;
- this.buttonList.add(new GuiButton(0, this.width / 2 - 100, this.height / 2 - 70 + heightAddition,
- I18n.format("menu.singleplayer")));
- this.buttonList.add(new GuiButton(1, this.width / 2 - 100, this.height / 2 - 46 + heightAddition,
- I18n.format("menu.multiplayer")));
- this.buttonList
- .add(new GuiButton(2, this.width / 2 - 100, this.height / 2 - 22 + heightAddition, "Cryptonic-Menü"));
- this.buttonList.add(
- new GuiButton(3, this.width / 2 - 100, this.height / 2 + 2 + heightAddition, "Cryptonic-Optionen"));
- this.buttonList.add(new GuiButton(4, this.width / 2 - 100, this.height / 2 + 26 + heightAddition,
- "Minecraft-" + I18n.format("menu.options")));
- this.buttonList.add(new GuiButton(5, this.width / 2 - 100, this.height / 2 + 50 + heightAddition,
- I18n.format("menu.quit")));
- }
- @Override
- protected void actionPerformed(GuiButton button) throws IOException {
- switch (button.id) {
- case 0: {
- mc.displayGuiScreen(new GuiSelectWorld(this));
- break;
- }
- case 1: {
- mc.displayGuiScreen(new GuiMultiplayer(this));
- break;
- }
- case 2: {
- mc.displayGuiScreen(new GuiScreenMenu(this));
- break;
- }
- case 3: {
- break;
- }
- case 4: {
- mc.displayGuiScreen(new GuiOptions(this, mc.gameSettings));
- break;
- }
- case 5: {
- mc.shutdownMinecraftApplet();
- break;
- }
- }
- }
- @Override
- public void drawScreen(int mouseX, int mouseY, float partialTicks) {
- mc.getTextureManager().bindTexture(new ResourceLocation("cryptonic/background.jpg"));
- this.drawScaledCustomSizeModalRect(0, 0, 0F, 0F, width, height, width, height, width, height);
- gParticle.drawParticles();
- this.drawRect(this.width / 2 - 104, this.height / 2 - 100, this.width / 2 + 104, this.height / 2 + 100,
- 0x4d000000);
- int widthP = 712;
- int heightP = 132;
- int size = 6;
- GlStateManager.color(1.0F, 1.0F, 1.0F);
- mc.getTextureManager().bindTexture(new ResourceLocation("cryptonic/title.png"));
- this.drawModalRectWithCustomSizedTexture(this.width / 2 - ((712 / size) / 2), this.height / 2 - 95, 0F, 0F,
- 712 / size, 132 / size, 712 / size, 132 / size);
- this.drawCenteredString(fontRendererObj, "§b" + Cryptonic.INSTANCE.getVERSION() + " by CryptonicDev",
- this.width / 2, this.height / 2 + 100 - 11, -1);
- super.drawScreen(mouseX, mouseY, partialTicks);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement