Advertisement
Guest User

GuiMainMenu.java

a guest
Jun 20th, 2015
288
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 22.67 KB | None | 0 0
  1. package net.minecraft.client.gui;
  2.  
  3. import com.google.common.collect.Lists;
  4. import java.io.BufferedReader;
  5. import java.io.IOException;
  6. import java.io.InputStreamReader;
  7. import java.net.URI;
  8. import java.util.ArrayList;
  9. import java.util.Calendar;
  10. import java.util.Date;
  11. import java.util.Random;
  12. import java.util.concurrent.atomic.AtomicInteger;
  13. import net.minecraft.client.Minecraft;
  14. import net.minecraft.client.renderer.GlStateManager;
  15. import net.minecraft.client.renderer.OpenGlHelper;
  16. import net.minecraft.client.renderer.Tessellator;
  17. import net.minecraft.client.renderer.WorldRenderer;
  18. import net.minecraft.client.renderer.texture.DynamicTexture;
  19. import net.minecraft.client.resources.I18n;
  20. import net.minecraft.realms.RealmsBridge;
  21. import net.minecraft.util.EnumChatFormatting;
  22. import net.minecraft.util.MathHelper;
  23. import net.minecraft.util.ResourceLocation;
  24. import net.minecraft.world.demo.DemoWorldServer;
  25. import net.minecraft.world.storage.ISaveFormat;
  26. import net.minecraft.world.storage.WorldInfo;
  27. import org.apache.commons.io.Charsets;
  28. import org.apache.logging.log4j.LogManager;
  29. import org.apache.logging.log4j.Logger;
  30. import org.lwjgl.opengl.GL11;
  31. import org.lwjgl.opengl.GLContext;
  32. import org.lwjgl.util.glu.Project;
  33.  
  34. public class GuiMainMenu extends GuiScreen implements GuiYesNoCallback
  35. {
  36.     private static final AtomicInteger field_175373_f = new AtomicInteger(0);
  37.     private static final Logger logger = LogManager.getLogger();
  38.     private static final Random field_175374_h = new Random();
  39.  
  40.     /** Counts the number of screen updates. */
  41.     private float updateCounter;
  42.  
  43.     /** The splash message. */
  44.     private String splashText;
  45.     private GuiButton buttonResetDemo;
  46.  
  47.     /** Timer used to rotate the panorama, increases every tick. */
  48.     private int panoramaTimer;
  49.  
  50.     /**
  51.      * Texture allocated for the current viewport of the main menu's panorama background.
  52.      */
  53.     private DynamicTexture viewportTexture;
  54.     private boolean field_175375_v = true;
  55.     private final Object field_104025_t = new Object();
  56.     private String field_92025_p;
  57.     private String field_146972_A;
  58.     private String field_104024_v;
  59.     private static final ResourceLocation splashTexts = new ResourceLocation("texts/splashes.txt");
  60.     private static final ResourceLocation minecraftTitleTextures = new ResourceLocation("textures/gui/title/minecraft.png");
  61.  
  62.     /** An array of all the paths to the panorama pictures. */
  63.     private static final ResourceLocation[] titlePanoramaPaths = new ResourceLocation[] {new ResourceLocation("textures/gui/title/background/panorama_0.png"), new ResourceLocation("textures/gui/title/background/panorama_1.png"), new ResourceLocation("textures/gui/title/background/panorama_2.png"), new ResourceLocation("textures/gui/title/background/panorama_3.png"), new ResourceLocation("textures/gui/title/background/panorama_4.png"), new ResourceLocation("textures/gui/title/background/panorama_5.png")};
  64.     public static final String field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information.";
  65.     private int field_92024_r;
  66.     private int field_92023_s;
  67.     private int field_92022_t;
  68.     private int field_92021_u;
  69.     private int field_92020_v;
  70.     private int field_92019_w;
  71.     private ResourceLocation field_110351_G;
  72.     private GuiButton field_175372_K;
  73.     private static final String __OBFID = "CL_00001154";
  74.  
  75.     public GuiMainMenu()
  76.     {
  77.         this.field_146972_A = field_96138_a;
  78.         this.splashText = "missingno";
  79.         BufferedReader var1 = null;
  80.  
  81.         try
  82.         {
  83.             ArrayList var2 = Lists.newArrayList();
  84.             var1 = new BufferedReader(new InputStreamReader(Minecraft.getMinecraft().getResourceManager().getResource(splashTexts).getInputStream(), Charsets.UTF_8));
  85.             String var3;
  86.  
  87.             while ((var3 = var1.readLine()) != null)
  88.             {
  89.                 var3 = var3.trim();
  90.  
  91.                 if (!var3.isEmpty())
  92.                 {
  93.                     var2.add(var3);
  94.                 }
  95.             }
  96.  
  97.             if (!var2.isEmpty())
  98.             {
  99.                 do
  100.                 {
  101.                     this.splashText = (String)var2.get(field_175374_h.nextInt(var2.size()));
  102.                 }
  103.                 while (this.splashText.hashCode() == 125780783);
  104.             }
  105.         }
  106.         catch (IOException var12)
  107.         {
  108.             ;
  109.         }
  110.         finally
  111.         {
  112.             if (var1 != null)
  113.             {
  114.                 try
  115.                 {
  116.                     var1.close();
  117.                 }
  118.                 catch (IOException var11)
  119.                 {
  120.                     ;
  121.                 }
  122.             }
  123.         }
  124.  
  125.         this.updateCounter = field_175374_h.nextFloat();
  126.         this.field_92025_p = "";
  127.  
  128.         if (!GLContext.getCapabilities().OpenGL20 && !OpenGlHelper.areShadersSupported())
  129.         {
  130.             this.field_92025_p = I18n.format("title.oldgl1", new Object[0]);
  131.             this.field_146972_A = I18n.format("title.oldgl2", new Object[0]);
  132.             this.field_104024_v = "https://help.mojang.com/customer/portal/articles/325948?ref=game";
  133.         }
  134.     }
  135.  
  136.     /**
  137.      * Called from the main game loop to update the screen.
  138.      */
  139.     public void updateScreen()
  140.     {
  141.         ++this.panoramaTimer;
  142.     }
  143.  
  144.     /**
  145.      * Returns true if this GUI should pause the game when it is displayed in single-player
  146.      */
  147.     public boolean doesGuiPauseGame()
  148.     {
  149.         return false;
  150.     }
  151.  
  152.     /**
  153.      * Fired when a key is typed (except F11 who toggle full screen). This is the equivalent of
  154.      * KeyListener.keyTyped(KeyEvent e). Args : character (character on the key), keyCode (lwjgl Keyboard key code)
  155.      */
  156.     protected void keyTyped(char typedChar, int keyCode) throws IOException {}
  157.  
  158.     /**
  159.      * Adds the buttons (and other controls) to the screen in question.
  160.      */
  161.     public void initGui()
  162.     {
  163.         this.viewportTexture = new DynamicTexture(256, 256);
  164.         this.field_110351_G = this.mc.getTextureManager().getDynamicTextureLocation("background", this.viewportTexture);
  165.         Calendar var1 = Calendar.getInstance();
  166.         var1.setTime(new Date());
  167.  
  168.         if (var1.get(2) + 1 == 11 && var1.get(5) == 9)
  169.         {
  170.             this.splashText = "Happy birthday, ez!";
  171.         }
  172.         else if (var1.get(2) + 1 == 6 && var1.get(5) == 1)
  173.         {
  174.             this.splashText = "Happy birthday, Notch!";
  175.         }
  176.         else if (var1.get(2) + 1 == 12 && var1.get(5) == 24)
  177.         {
  178.             this.splashText = "Merry X-mas!";
  179.         }
  180.         else if (var1.get(2) + 1 == 1 && var1.get(5) == 1)
  181.         {
  182.             this.splashText = "Happy new year!";
  183.         }
  184.         else if (var1.get(2) + 1 == 10 && var1.get(5) == 31)
  185.         {
  186.             this.splashText = "OOoooOOOoooo! Spooky!";
  187.         }
  188.  
  189.         boolean var2 = true;
  190.         int var3 = this.height / 4 + 48;
  191.  
  192.         if (this.mc.isDemo())
  193.         {
  194.             this.addDemoButtons(var3, 24);
  195.         }
  196.         else
  197.         {
  198.             this.addSingleplayerMultiplayerButtons(var3, 24);
  199.         }
  200.  
  201.         this.buttonList.add(new GuiButton(0, this.width / 2 - 100, var3 + 72 + 12, 98, 20, I18n.format("menu.options", new Object[0])));
  202.         this.buttonList.add(new GuiButton(4, this.width / 2 + 2, var3 + 72 + 12, 98, 20, I18n.format("menu.quit", new Object[0])));
  203.         this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124, var3 + 72 + 12));
  204.         Object var4 = this.field_104025_t;
  205.  
  206.         synchronized (this.field_104025_t)
  207.         {
  208.             this.field_92023_s = this.fontRendererObj.getStringWidth(this.field_92025_p);
  209.             this.field_92024_r = this.fontRendererObj.getStringWidth(this.field_146972_A);
  210.             int var5 = Math.max(this.field_92023_s, this.field_92024_r);
  211.             this.field_92022_t = (this.width - var5) / 2;
  212.             this.field_92021_u = ((GuiButton)this.buttonList.get(0)).yPosition - 24;
  213.             this.field_92020_v = this.field_92022_t + var5;
  214.             this.field_92019_w = this.field_92021_u + 24;
  215.         }
  216.     }
  217.  
  218.     /**
  219.      * Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game.
  220.      */
  221.     private void addSingleplayerMultiplayerButtons(int p_73969_1_, int p_73969_2_)
  222.     {
  223.         this.buttonList.add(new GuiButton(1, this.width / 2 - 100, p_73969_1_, I18n.format("menu.singleplayer", new Object[0])));
  224.         this.buttonList.add(new GuiButton(2, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 1, I18n.format("menu.multiplayer", new Object[0])));
  225.         this.buttonList.add(this.field_175372_K = new GuiButton(14, this.width / 2 - 100, p_73969_1_ + p_73969_2_ * 2, I18n.format("menu.online", new Object[0])));
  226.     }
  227.  
  228.     /**
  229.      * Adds Demo buttons on Main Menu for players who are playing Demo.
  230.      */
  231.     private void addDemoButtons(int p_73972_1_, int p_73972_2_)
  232.     {
  233.         this.buttonList.add(new GuiButton(11, this.width / 2 - 100, p_73972_1_, I18n.format("menu.playdemo", new Object[0])));
  234.         this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, p_73972_1_ + p_73972_2_ * 1, I18n.format("menu.resetdemo", new Object[0])));
  235.         ISaveFormat var3 = this.mc.getSaveLoader();
  236.         WorldInfo var4 = var3.getWorldInfo("Demo_World");
  237.  
  238.         if (var4 == null)
  239.         {
  240.             this.buttonResetDemo.enabled = false;
  241.         }
  242.     }
  243.  
  244.     protected void actionPerformed(GuiButton button) throws IOException
  245.     {
  246.         if (button.id == 0)
  247.         {
  248.             this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings));
  249.         }
  250.  
  251.         if (button.id == 5)
  252.         {
  253.             this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings, this.mc.getLanguageManager()));
  254.         }
  255.  
  256.         if (button.id == 1)
  257.         {
  258.             this.mc.displayGuiScreen(new GuiSelectWorld(this));
  259.         }
  260.  
  261.         if (button.id == 2)
  262.         {
  263.             this.mc.displayGuiScreen(new GuiMultiplayer(this));
  264.         }
  265.  
  266.         if (button.id == 14 && this.field_175372_K.visible)
  267.         {
  268.             this.switchToRealms();
  269.         }
  270.  
  271.         if (button.id == 4)
  272.         {
  273.             this.mc.shutdown();
  274.         }
  275.  
  276.         if (button.id == 11)
  277.         {
  278.             this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings);
  279.         }
  280.  
  281.         if (button.id == 12)
  282.         {
  283.             ISaveFormat var2 = this.mc.getSaveLoader();
  284.             WorldInfo var3 = var2.getWorldInfo("Demo_World");
  285.  
  286.             if (var3 != null)
  287.             {
  288.                 GuiYesNo var4 = GuiSelectWorld.func_152129_a(this, var3.getWorldName(), 12);
  289.                 this.mc.displayGuiScreen(var4);
  290.             }
  291.         }
  292.     }
  293.  
  294.     private void switchToRealms()
  295.     {
  296.         RealmsBridge var1 = new RealmsBridge();
  297.         var1.switchToRealms(this);
  298.     }
  299.  
  300.     public void confirmClicked(boolean result, int id)
  301.     {
  302.         if (result && id == 12)
  303.         {
  304.             ISaveFormat var6 = this.mc.getSaveLoader();
  305.             var6.flushCache();
  306.             var6.deleteWorldDirectory("Demo_World");
  307.             this.mc.displayGuiScreen(this);
  308.         }
  309.         else if (id == 13)
  310.         {
  311.             if (result)
  312.             {
  313.                 try
  314.                 {
  315.                     Class var3 = Class.forName("java.awt.Desktop");
  316.                     Object var4 = var3.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]);
  317.                     var3.getMethod("browse", new Class[] {URI.class}).invoke(var4, new Object[] {new URI(this.field_104024_v)});
  318.                 }
  319.                 catch (Throwable var5)
  320.                 {
  321.                     logger.error("Couldn\'t open link", var5);
  322.                 }
  323.             }
  324.  
  325.             this.mc.displayGuiScreen(this);
  326.         }
  327.     }
  328.  
  329.     /**
  330.      * Draws the main menu panorama
  331.      */
  332.     private void drawPanorama(int p_73970_1_, int p_73970_2_, float p_73970_3_)
  333.     {
  334.         Tessellator var4 = Tessellator.getInstance();
  335.         WorldRenderer var5 = var4.getWorldRenderer();
  336.         GlStateManager.matrixMode(5889);
  337.         GlStateManager.pushMatrix();
  338.         GlStateManager.loadIdentity();
  339.         Project.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F);
  340.         GlStateManager.matrixMode(5888);
  341.         GlStateManager.pushMatrix();
  342.         GlStateManager.loadIdentity();
  343.         GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
  344.         GlStateManager.rotate(180.0F, 1.0F, 0.0F, 0.0F);
  345.         GlStateManager.rotate(90.0F, 0.0F, 0.0F, 1.0F);
  346.         GlStateManager.enableBlend();
  347.         GlStateManager.disableAlpha();
  348.         GlStateManager.disableCull();
  349.         GlStateManager.depthMask(false);
  350.         GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
  351.         byte var6 = 8;
  352.  
  353.         for (int var7 = 0; var7 < var6 * var6; ++var7)
  354.         {
  355.             GlStateManager.pushMatrix();
  356.             float var8 = ((float)(var7 % var6) / (float)var6 - 0.5F) / 64.0F;
  357.             float var9 = ((float)(var7 / var6) / (float)var6 - 0.5F) / 64.0F;
  358.             float var10 = 0.0F;
  359.             GlStateManager.translate(var8, var9, var10);
  360.             GlStateManager.rotate(MathHelper.sin(((float)this.panoramaTimer + p_73970_3_) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F);
  361.             GlStateManager.rotate(-((float)this.panoramaTimer + p_73970_3_) * 0.1F, 0.0F, 1.0F, 0.0F);
  362.  
  363.             for (int var11 = 0; var11 < 6; ++var11)
  364.             {
  365.                 GlStateManager.pushMatrix();
  366.  
  367.                 if (var11 == 1)
  368.                 {
  369.                     GlStateManager.rotate(90.0F, 0.0F, 1.0F, 0.0F);
  370.                 }
  371.  
  372.                 if (var11 == 2)
  373.                 {
  374.                     GlStateManager.rotate(180.0F, 0.0F, 1.0F, 0.0F);
  375.                 }
  376.  
  377.                 if (var11 == 3)
  378.                 {
  379.                     GlStateManager.rotate(-90.0F, 0.0F, 1.0F, 0.0F);
  380.                 }
  381.  
  382.                 if (var11 == 4)
  383.                 {
  384.                     GlStateManager.rotate(90.0F, 1.0F, 0.0F, 0.0F);
  385.                 }
  386.  
  387.                 if (var11 == 5)
  388.                 {
  389.                     GlStateManager.rotate(-90.0F, 1.0F, 0.0F, 0.0F);
  390.                 }
  391.  
  392.                 this.mc.getTextureManager().bindTexture(titlePanoramaPaths[var11]);
  393.                 var5.startDrawingQuads();
  394.                 var5.func_178974_a(16777215, 255 / (var7 + 1));
  395.                 float var12 = 0.0F;
  396.                 var5.addVertexWithUV(-1.0D, -1.0D, 1.0D, (double)(0.0F + var12), (double)(0.0F + var12));
  397.                 var5.addVertexWithUV(1.0D, -1.0D, 1.0D, (double)(1.0F - var12), (double)(0.0F + var12));
  398.                 var5.addVertexWithUV(1.0D, 1.0D, 1.0D, (double)(1.0F - var12), (double)(1.0F - var12));
  399.                 var5.addVertexWithUV(-1.0D, 1.0D, 1.0D, (double)(0.0F + var12), (double)(1.0F - var12));
  400.                 var4.draw();
  401.                 GlStateManager.popMatrix();
  402.             }
  403.  
  404.             GlStateManager.popMatrix();
  405.             GlStateManager.colorMask(true, true, true, false);
  406.         }
  407.  
  408.         var5.setTranslation(0.0D, 0.0D, 0.0D);
  409.         GlStateManager.colorMask(true, true, true, true);
  410.         GlStateManager.matrixMode(5889);
  411.         GlStateManager.popMatrix();
  412.         GlStateManager.matrixMode(5888);
  413.         GlStateManager.popMatrix();
  414.         GlStateManager.depthMask(true);
  415.         GlStateManager.enableCull();
  416.         GlStateManager.enableDepth();
  417.     }
  418.  
  419.     /**
  420.      * Rotate and blurs the skybox view in the main menu
  421.      */
  422.     private void rotateAndBlurSkybox(float p_73968_1_)
  423.     {
  424.         this.mc.getTextureManager().bindTexture(this.field_110351_G);
  425.         GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR);
  426.         GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR);
  427.         GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256);
  428.         GlStateManager.enableBlend();
  429.         GlStateManager.tryBlendFuncSeparate(770, 771, 1, 0);
  430.         GlStateManager.colorMask(true, true, true, false);
  431.         Tessellator var2 = Tessellator.getInstance();
  432.         WorldRenderer var3 = var2.getWorldRenderer();
  433.         var3.startDrawingQuads();
  434.         GlStateManager.disableAlpha();
  435.         byte var4 = 3;
  436.  
  437.         for (int var5 = 0; var5 < var4; ++var5)
  438.         {
  439.             var3.func_178960_a(1.0F, 1.0F, 1.0F, 1.0F / (float)(var5 + 1));
  440.             int var6 = this.width;
  441.             int var7 = this.height;
  442.             float var8 = (float)(var5 - var4 / 2) / 256.0F;
  443.             var3.addVertexWithUV((double)var6, (double)var7, (double)this.zLevel, (double)(0.0F + var8), 1.0D);
  444.             var3.addVertexWithUV((double)var6, 0.0D, (double)this.zLevel, (double)(1.0F + var8), 1.0D);
  445.             var3.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(1.0F + var8), 0.0D);
  446.             var3.addVertexWithUV(0.0D, (double)var7, (double)this.zLevel, (double)(0.0F + var8), 0.0D);
  447.         }
  448.  
  449.         var2.draw();
  450.         GlStateManager.enableAlpha();
  451.         GlStateManager.colorMask(true, true, true, true);
  452.     }
  453.  
  454.     /**
  455.      * Renders the skybox in the main menu
  456.      */
  457.     private void renderSkybox(int p_73971_1_, int p_73971_2_, float p_73971_3_)
  458.     {
  459.         this.mc.getFramebuffer().unbindFramebuffer();
  460.         GlStateManager.viewport(0, 0, 256, 256);
  461.         this.drawPanorama(p_73971_1_, p_73971_2_, p_73971_3_);
  462.         this.rotateAndBlurSkybox(p_73971_3_);
  463.         this.rotateAndBlurSkybox(p_73971_3_);
  464.         this.rotateAndBlurSkybox(p_73971_3_);
  465.         this.rotateAndBlurSkybox(p_73971_3_);
  466.         this.rotateAndBlurSkybox(p_73971_3_);
  467.         this.rotateAndBlurSkybox(p_73971_3_);
  468.         this.rotateAndBlurSkybox(p_73971_3_);
  469.         this.mc.getFramebuffer().bindFramebuffer(true);
  470.         GlStateManager.viewport(0, 0, this.mc.displayWidth, this.mc.displayHeight);
  471.         Tessellator var4 = Tessellator.getInstance();
  472.         WorldRenderer var5 = var4.getWorldRenderer();
  473.         var5.startDrawingQuads();
  474.         float var6 = this.width > this.height ? 120.0F / (float)this.width : 120.0F / (float)this.height;
  475.         float var7 = (float)this.height * var6 / 256.0F;
  476.         float var8 = (float)this.width * var6 / 256.0F;
  477.         var5.func_178960_a(1.0F, 1.0F, 1.0F, 1.0F);
  478.         int var9 = this.width;
  479.         int var10 = this.height;
  480.         var5.addVertexWithUV(0.0D, (double)var10, (double)this.zLevel, (double)(0.5F - var7), (double)(0.5F + var8));
  481.         var5.addVertexWithUV((double)var9, (double)var10, (double)this.zLevel, (double)(0.5F - var7), (double)(0.5F - var8));
  482.         var5.addVertexWithUV((double)var9, 0.0D, (double)this.zLevel, (double)(0.5F + var7), (double)(0.5F - var8));
  483.         var5.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(0.5F + var7), (double)(0.5F + var8));
  484.         var4.draw();
  485.     }
  486.  
  487.     /**
  488.      * Draws the screen and all the components in it. Args : mouseX, mouseY, renderPartialTicks
  489.      */
  490.     public void drawScreen(int mouseX, int mouseY, float partialTicks)
  491.     {
  492.         GlStateManager.disableAlpha();
  493.         this.renderSkybox(mouseX, mouseY, partialTicks);
  494.         GlStateManager.enableAlpha();
  495.         Tessellator var4 = Tessellator.getInstance();
  496.         WorldRenderer var5 = var4.getWorldRenderer();
  497.         short var6 = 274;
  498.         int var7 = this.width / 2 - var6 / 2;
  499.         byte var8 = 30;
  500.         this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215);
  501.         this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE);
  502.         this.mc.getTextureManager().bindTexture(minecraftTitleTextures);
  503.         GlStateManager.color(1.0F, 1.0F, 1.0F, 1.0F);
  504.  
  505.         if ((double)this.updateCounter < 1.0E-4D)
  506.         {
  507.             this.drawTexturedModalRect(var7 + 0, var8 + 0, 0, 0, 99, 44);
  508.             this.drawTexturedModalRect(var7 + 99, var8 + 0, 129, 0, 27, 44);
  509.             this.drawTexturedModalRect(var7 + 99 + 26, var8 + 0, 126, 0, 3, 44);
  510.             this.drawTexturedModalRect(var7 + 99 + 26 + 3, var8 + 0, 99, 0, 26, 44);
  511.             this.drawTexturedModalRect(var7 + 155, var8 + 0, 0, 45, 155, 44);
  512.         }
  513.         else
  514.         {
  515.             this.drawTexturedModalRect(var7 + 0, var8 + 0, 0, 0, 155, 44);
  516.             this.drawTexturedModalRect(var7 + 155, var8 + 0, 0, 45, 155, 44);
  517.         }
  518.  
  519.         var5.func_178991_c(-1);
  520.         GlStateManager.pushMatrix();
  521.         GlStateManager.translate((float)(this.width / 2 + 90), 70.0F, 0.0F);
  522.         GlStateManager.rotate(-20.0F, 0.0F, 0.0F, 1.0F);
  523.         float var9 = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F);
  524.         var9 = var9 * 100.0F / (float)(this.fontRendererObj.getStringWidth(this.splashText) + 32);
  525.         GlStateManager.scale(var9, var9, var9);
  526.         this.drawCenteredString(this.fontRendererObj, this.splashText, 0, -8, -256);
  527.         GlStateManager.popMatrix();
  528.         String var10 = "Minecraft 1.8";
  529.  
  530.         if (this.mc.isDemo())
  531.         {
  532.             var10 = var10 + " Demo";
  533.         }
  534.  
  535.         this.drawString(this.fontRendererObj, var10, 2, this.height - 10, -1);
  536.         String var11 = "Copyright Mojang AB. Do not distribute!";
  537.         this.drawString(this.fontRendererObj, var11, this.width - this.fontRendererObj.getStringWidth(var11) - 2, this.height - 10, -1);
  538.  
  539.         if (this.field_92025_p != null && this.field_92025_p.length() > 0)
  540.         {
  541.             drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 1428160512);
  542.             this.drawString(this.fontRendererObj, this.field_92025_p, this.field_92022_t, this.field_92021_u, -1);
  543.             this.drawString(this.fontRendererObj, this.field_146972_A, (this.width - this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, -1);
  544.         }
  545.  
  546.         super.drawScreen(mouseX, mouseY, partialTicks);
  547.     }
  548.  
  549.     /**
  550.      * Called when the mouse is clicked. Args : mouseX, mouseY, clickedButton
  551.      */
  552.     protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws IOException
  553.     {
  554.         super.mouseClicked(mouseX, mouseY, mouseButton);
  555.         Object var4 = this.field_104025_t;
  556.  
  557.         synchronized (this.field_104025_t)
  558.         {
  559.             if (this.field_92025_p.length() > 0 && mouseX >= this.field_92022_t && mouseX <= this.field_92020_v && mouseY >= this.field_92021_u && mouseY <= this.field_92019_w)
  560.             {
  561.                 GuiConfirmOpenLink var5 = new GuiConfirmOpenLink(this, this.field_104024_v, 13, true);
  562.                 var5.disableSecurityWarning();
  563.                 this.mc.displayGuiScreen(var5);
  564.             }
  565.         }
  566.     }
  567. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement