001package net.minecraft.client.gui; 002 003import cpw.mods.fml.client.GuiModList; 004import cpw.mods.fml.common.FMLCommonHandler; 005import cpw.mods.fml.relauncher.Side; 006import cpw.mods.fml.relauncher.SideOnly; 007import java.awt.image.BufferedImage; 008import java.io.BufferedReader; 009import java.io.IOException; 010import java.io.InputStreamReader; 011import java.net.URI; 012import java.nio.charset.Charset; 013import java.util.ArrayList; 014import java.util.Calendar; 015import java.util.Date; 016import java.util.List; 017import java.util.Random; 018import net.minecraft.client.Minecraft; 019import net.minecraft.client.renderer.Tessellator; 020import net.minecraft.util.EnumChatFormatting; 021import net.minecraft.util.MathHelper; 022import net.minecraft.util.StringTranslate; 023import net.minecraft.world.demo.DemoWorldServer; 024import net.minecraft.world.storage.ISaveFormat; 025import net.minecraft.world.storage.WorldInfo; 026import org.lwjgl.opengl.GL11; 027import org.lwjgl.util.glu.GLU; 028 029import com.google.common.base.Strings; 030import com.google.common.collect.Lists; 031 032@SideOnly(Side.CLIENT) 033public class GuiMainMenu extends GuiScreen 034{ 035 /** The RNG used by the Main Menu Screen. */ 036 private static final Random rand = new Random(); 037 038 /** Counts the number of screen updates. */ 039 private float updateCounter = 0.0F; 040 041 /** The splash message. */ 042 private String splashText = "missingno"; 043 private GuiButton buttonResetDemo; 044 045 /** Timer used to rotate the panorama, increases every tick. */ 046 private int panoramaTimer = 0; 047 048 /** 049 * Texture allocated for the current viewport of the main menu's panorama background. 050 */ 051 private int viewportTexture; 052 private boolean field_96141_q = true; 053 private static boolean field_96140_r = false; 054 private static boolean field_96139_s = false; 055 private String field_92025_p; 056 057 /** An array of all the paths to the panorama pictures. */ 058 private static final String[] titlePanoramaPaths = new String[] {"/title/bg/panorama0.png", "/title/bg/panorama1.png", "/title/bg/panorama2.png", "/title/bg/panorama3.png", "/title/bg/panorama4.png", "/title/bg/panorama5.png"}; 059 public static final String field_96138_a = "Please click " + EnumChatFormatting.UNDERLINE + "here" + EnumChatFormatting.RESET + " for more information."; 060 private int field_92024_r; 061 private int field_92023_s; 062 private int field_92022_t; 063 private int field_92021_u; 064 private int field_92020_v; 065 private int field_92019_w; 066 067 private GuiButton fmlModButton = null; 068 069 public GuiMainMenu() 070 { 071 BufferedReader bufferedreader = null; 072 073 try 074 { 075 ArrayList arraylist = new ArrayList(); 076 bufferedreader = new BufferedReader(new InputStreamReader(GuiMainMenu.class.getResourceAsStream("/title/splashes.txt"), Charset.forName("UTF-8"))); 077 String s; 078 079 while ((s = bufferedreader.readLine()) != null) 080 { 081 s = s.trim(); 082 083 if (s.length() > 0) 084 { 085 arraylist.add(s); 086 } 087 } 088 089 do 090 { 091 this.splashText = (String)arraylist.get(rand.nextInt(arraylist.size())); 092 } 093 while (this.splashText.hashCode() == 125780783); 094 } 095 catch (IOException ioexception) 096 { 097 ; 098 } 099 finally 100 { 101 if (bufferedreader != null) 102 { 103 try 104 { 105 bufferedreader.close(); 106 } 107 catch (IOException ioexception1) 108 { 109 ; 110 } 111 } 112 } 113 114 this.updateCounter = rand.nextFloat(); 115 } 116 117 /** 118 * Called from the main game loop to update the screen. 119 */ 120 public void updateScreen() 121 { 122 ++this.panoramaTimer; 123 } 124 125 /** 126 * Returns true if this GUI should pause the game when it is displayed in single-player 127 */ 128 public boolean doesGuiPauseGame() 129 { 130 return false; 131 } 132 133 /** 134 * Fired when a key is typed. This is the equivalent of KeyListener.keyTyped(KeyEvent e). 135 */ 136 protected void keyTyped(char par1, int par2) {} 137 138 /** 139 * Adds the buttons (and other controls) to the screen in question. 140 */ 141 public void initGui() 142 { 143 this.viewportTexture = this.mc.renderEngine.allocateAndSetupTexture(new BufferedImage(256, 256, 2)); 144 Calendar calendar = Calendar.getInstance(); 145 calendar.setTime(new Date()); 146 147 if (calendar.get(2) + 1 == 11 && calendar.get(5) == 9) 148 { 149 this.splashText = "Happy birthday, ez!"; 150 } 151 else if (calendar.get(2) + 1 == 6 && calendar.get(5) == 1) 152 { 153 this.splashText = "Happy birthday, Notch!"; 154 } 155 else if (calendar.get(2) + 1 == 12 && calendar.get(5) == 24) 156 { 157 this.splashText = "Merry X-mas!"; 158 } 159 else if (calendar.get(2) + 1 == 1 && calendar.get(5) == 1) 160 { 161 this.splashText = "Happy new year!"; 162 } 163 else if (calendar.get(2) + 1 == 10 && calendar.get(5) == 31) 164 { 165 this.splashText = "OOoooOOOoooo! Spooky!"; 166 } 167 168 StringTranslate stringtranslate = StringTranslate.getInstance(); 169 int i = this.height / 4 + 48; 170 171 if (this.mc.isDemo()) 172 { 173 this.addDemoButtons(i, 24, stringtranslate); 174 } 175 else 176 { 177 this.addSingleplayerMultiplayerButtons(i, 24, stringtranslate); 178 } 179 180 fmlModButton = new GuiButton(6, this.width / 2 - 100, i + 48, "Mods"); 181 this.buttonList.add(fmlModButton); 182 183 this.func_96137_a(stringtranslate, i, 24); 184 185 if (this.mc.hideQuitButton) 186 { 187 this.buttonList.add(new GuiButton(0, this.width / 2 - 100, i + 72, stringtranslate.translateKey("menu.options"))); 188 } 189 else 190 { 191 this.buttonList.add(new GuiButton(0, this.width / 2 - 100, i + 72 + 12, 98, 20, stringtranslate.translateKey("menu.options"))); 192 this.buttonList.add(new GuiButton(4, this.width / 2 + 2, i + 72 + 12, 98, 20, stringtranslate.translateKey("menu.quit"))); 193 } 194 195 this.buttonList.add(new GuiButtonLanguage(5, this.width / 2 - 124, i + 72 + 12)); 196 this.field_92025_p = ""; 197 String s = System.getProperty("os_architecture"); 198 String s1 = System.getProperty("java_version"); 199 200 if ("ppc".equalsIgnoreCase(s)) 201 { 202 this.field_92025_p = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " PowerPC compatibility will be dropped in Minecraft 1.6"; 203 } 204 else if (s1 != null && s1.startsWith("1.5")) 205 { 206 this.field_92025_p = "" + EnumChatFormatting.BOLD + "Notice!" + EnumChatFormatting.RESET + " Java 1.5 compatibility will be dropped in Minecraft 1.6"; 207 } 208 209 this.field_92023_s = this.fontRenderer.getStringWidth(this.field_92025_p); 210 this.field_92024_r = this.fontRenderer.getStringWidth(field_96138_a); 211 int j = Math.max(this.field_92023_s, this.field_92024_r); 212 this.field_92022_t = (this.width - j) / 2; 213 this.field_92021_u = ((GuiButton)this.buttonList.get(0)).yPosition - 24; 214 this.field_92020_v = this.field_92022_t + j; 215 this.field_92019_w = this.field_92021_u + 24; 216 } 217 218 private void func_96137_a(StringTranslate par1StringTranslate, int par2, int par3) 219 { 220 if (this.field_96141_q) 221 { 222 if (!field_96140_r) 223 { 224 field_96140_r = true; 225 (new ThreadTitleScreen(this, par1StringTranslate, par2, par3)).start(); 226 } 227 else if (field_96139_s) 228 { 229 this.func_98060_b(par1StringTranslate, par2, par3); 230 } 231 } 232 } 233 234 private void func_98060_b(StringTranslate par1StringTranslate, int par2, int par3) 235 { 236 //If Minecraft Realms is enabled, halve the size of both buttons and set them next to eachother. 237 fmlModButton.width = 98; 238 fmlModButton.xPosition = this.width / 2 + 2; 239 240 GuiButton realmButton = new GuiButton(3, this.width / 2 - 100, par2 + par3 * 2, par1StringTranslate.translateKey("menu.online")); 241 realmButton.width = 98; 242 realmButton.xPosition = this.width / 2 - 100; 243 this.buttonList.add(realmButton); 244 } 245 246 /** 247 * Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game. 248 */ 249 private void addSingleplayerMultiplayerButtons(int par1, int par2, StringTranslate par3StringTranslate) 250 { 251 this.buttonList.add(new GuiButton(1, this.width / 2 - 100, par1, par3StringTranslate.translateKey("menu.singleplayer"))); 252 this.buttonList.add(new GuiButton(2, this.width / 2 - 100, par1 + par2 * 1, par3StringTranslate.translateKey("menu.multiplayer"))); 253 } 254 255 /** 256 * Adds Demo buttons on Main Menu for players who are playing Demo. 257 */ 258 private void addDemoButtons(int par1, int par2, StringTranslate par3StringTranslate) 259 { 260 this.buttonList.add(new GuiButton(11, this.width / 2 - 100, par1, par3StringTranslate.translateKey("menu.playdemo"))); 261 this.buttonList.add(this.buttonResetDemo = new GuiButton(12, this.width / 2 - 100, par1 + par2 * 1, par3StringTranslate.translateKey("menu.resetdemo"))); 262 ISaveFormat isaveformat = this.mc.getSaveLoader(); 263 WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World"); 264 265 if (worldinfo == null) 266 { 267 this.buttonResetDemo.enabled = false; 268 } 269 } 270 271 /** 272 * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). 273 */ 274 protected void actionPerformed(GuiButton par1GuiButton) 275 { 276 if (par1GuiButton.id == 0) 277 { 278 this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); 279 } 280 281 if (par1GuiButton.id == 5) 282 { 283 this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings)); 284 } 285 286 if (par1GuiButton.id == 1) 287 { 288 this.mc.displayGuiScreen(new GuiSelectWorld(this)); 289 } 290 291 if (par1GuiButton.id == 2) 292 { 293 this.mc.displayGuiScreen(new GuiMultiplayer(this)); 294 } 295 296 if (par1GuiButton.id == 3) 297 { 298 this.mc.displayGuiScreen(new GuiScreenOnlineServers(this)); 299 } 300 301 if (par1GuiButton.id == 4) 302 { 303 this.mc.shutdown(); 304 } 305 306 if (par1GuiButton.id == 6) 307 { 308 this.mc.displayGuiScreen(new GuiModList(this)); 309 } 310 311 if (par1GuiButton.id == 11) 312 { 313 this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); 314 } 315 316 if (par1GuiButton.id == 12) 317 { 318 ISaveFormat isaveformat = this.mc.getSaveLoader(); 319 WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World"); 320 321 if (worldinfo != null) 322 { 323 GuiYesNo guiyesno = GuiSelectWorld.getDeleteWorldScreen(this, worldinfo.getWorldName(), 12); 324 this.mc.displayGuiScreen(guiyesno); 325 } 326 } 327 } 328 329 public void confirmClicked(boolean par1, int par2) 330 { 331 if (par1 && par2 == 12) 332 { 333 ISaveFormat isaveformat = this.mc.getSaveLoader(); 334 isaveformat.flushCache(); 335 isaveformat.deleteWorldDirectory("Demo_World"); 336 this.mc.displayGuiScreen(this); 337 } 338 else if (par2 == 13) 339 { 340 if (par1) 341 { 342 try 343 { 344 Class oclass = Class.forName("java.awt.Desktop"); 345 Object object = oclass.getMethod("getDesktop", new Class[0]).invoke((Object)null, new Object[0]); 346 oclass.getMethod("browse", new Class[] {URI.class}).invoke(object, new Object[] {new URI("http://tinyurl.com/javappc")}); 347 } 348 catch (Throwable throwable) 349 { 350 throwable.printStackTrace(); 351 } 352 } 353 354 this.mc.displayGuiScreen(this); 355 } 356 } 357 358 /** 359 * Draws the main menu panorama 360 */ 361 private void drawPanorama(int par1, int par2, float par3) 362 { 363 Tessellator tessellator = Tessellator.instance; 364 GL11.glMatrixMode(GL11.GL_PROJECTION); 365 GL11.glPushMatrix(); 366 GL11.glLoadIdentity(); 367 GLU.gluPerspective(120.0F, 1.0F, 0.05F, 10.0F); 368 GL11.glMatrixMode(GL11.GL_MODELVIEW); 369 GL11.glPushMatrix(); 370 GL11.glLoadIdentity(); 371 GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); 372 GL11.glRotatef(180.0F, 1.0F, 0.0F, 0.0F); 373 GL11.glEnable(GL11.GL_BLEND); 374 GL11.glDisable(GL11.GL_ALPHA_TEST); 375 GL11.glDisable(GL11.GL_CULL_FACE); 376 GL11.glDepthMask(false); 377 GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); 378 byte b0 = 8; 379 380 for (int k = 0; k < b0 * b0; ++k) 381 { 382 GL11.glPushMatrix(); 383 float f1 = ((float)(k % b0) / (float)b0 - 0.5F) / 64.0F; 384 float f2 = ((float)(k / b0) / (float)b0 - 0.5F) / 64.0F; 385 float f3 = 0.0F; 386 GL11.glTranslatef(f1, f2, f3); 387 GL11.glRotatef(MathHelper.sin(((float)this.panoramaTimer + par3) / 400.0F) * 25.0F + 20.0F, 1.0F, 0.0F, 0.0F); 388 GL11.glRotatef(-((float)this.panoramaTimer + par3) * 0.1F, 0.0F, 1.0F, 0.0F); 389 390 for (int l = 0; l < 6; ++l) 391 { 392 GL11.glPushMatrix(); 393 394 if (l == 1) 395 { 396 GL11.glRotatef(90.0F, 0.0F, 1.0F, 0.0F); 397 } 398 399 if (l == 2) 400 { 401 GL11.glRotatef(180.0F, 0.0F, 1.0F, 0.0F); 402 } 403 404 if (l == 3) 405 { 406 GL11.glRotatef(-90.0F, 0.0F, 1.0F, 0.0F); 407 } 408 409 if (l == 4) 410 { 411 GL11.glRotatef(90.0F, 1.0F, 0.0F, 0.0F); 412 } 413 414 if (l == 5) 415 { 416 GL11.glRotatef(-90.0F, 1.0F, 0.0F, 0.0F); 417 } 418 419 this.mc.renderEngine.bindTexture(titlePanoramaPaths[l]); 420 tessellator.startDrawingQuads(); 421 tessellator.setColorRGBA_I(16777215, 255 / (k + 1)); 422 float f4 = 0.0F; 423 tessellator.addVertexWithUV(-1.0D, -1.0D, 1.0D, (double)(0.0F + f4), (double)(0.0F + f4)); 424 tessellator.addVertexWithUV(1.0D, -1.0D, 1.0D, (double)(1.0F - f4), (double)(0.0F + f4)); 425 tessellator.addVertexWithUV(1.0D, 1.0D, 1.0D, (double)(1.0F - f4), (double)(1.0F - f4)); 426 tessellator.addVertexWithUV(-1.0D, 1.0D, 1.0D, (double)(0.0F + f4), (double)(1.0F - f4)); 427 tessellator.draw(); 428 GL11.glPopMatrix(); 429 } 430 431 GL11.glPopMatrix(); 432 GL11.glColorMask(true, true, true, false); 433 } 434 435 tessellator.setTranslation(0.0D, 0.0D, 0.0D); 436 GL11.glColorMask(true, true, true, true); 437 GL11.glMatrixMode(GL11.GL_PROJECTION); 438 GL11.glPopMatrix(); 439 GL11.glMatrixMode(GL11.GL_MODELVIEW); 440 GL11.glPopMatrix(); 441 GL11.glDepthMask(true); 442 GL11.glEnable(GL11.GL_CULL_FACE); 443 GL11.glEnable(GL11.GL_ALPHA_TEST); 444 GL11.glEnable(GL11.GL_DEPTH_TEST); 445 } 446 447 /** 448 * Rotate and blurs the skybox view in the main menu 449 */ 450 private void rotateAndBlurSkybox(float par1) 451 { 452 GL11.glBindTexture(GL11.GL_TEXTURE_2D, this.viewportTexture); 453 this.mc.renderEngine.resetBoundTexture(); 454 GL11.glCopyTexSubImage2D(GL11.GL_TEXTURE_2D, 0, 0, 0, 0, 0, 256, 256); 455 GL11.glEnable(GL11.GL_BLEND); 456 GL11.glBlendFunc(GL11.GL_SRC_ALPHA, GL11.GL_ONE_MINUS_SRC_ALPHA); 457 GL11.glColorMask(true, true, true, false); 458 Tessellator tessellator = Tessellator.instance; 459 tessellator.startDrawingQuads(); 460 byte b0 = 3; 461 462 for (int i = 0; i < b0; ++i) 463 { 464 tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F / (float)(i + 1)); 465 int j = this.width; 466 int k = this.height; 467 float f1 = (float)(i - b0 / 2) / 256.0F; 468 tessellator.addVertexWithUV((double)j, (double)k, (double)this.zLevel, (double)(0.0F + f1), 0.0D); 469 tessellator.addVertexWithUV((double)j, 0.0D, (double)this.zLevel, (double)(1.0F + f1), 0.0D); 470 tessellator.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(1.0F + f1), 1.0D); 471 tessellator.addVertexWithUV(0.0D, (double)k, (double)this.zLevel, (double)(0.0F + f1), 1.0D); 472 } 473 474 tessellator.draw(); 475 GL11.glColorMask(true, true, true, true); 476 this.mc.renderEngine.resetBoundTexture(); 477 } 478 479 /** 480 * Renders the skybox in the main menu 481 */ 482 private void renderSkybox(int par1, int par2, float par3) 483 { 484 GL11.glViewport(0, 0, 256, 256); 485 this.drawPanorama(par1, par2, par3); 486 GL11.glDisable(GL11.GL_TEXTURE_2D); 487 GL11.glEnable(GL11.GL_TEXTURE_2D); 488 this.rotateAndBlurSkybox(par3); 489 this.rotateAndBlurSkybox(par3); 490 this.rotateAndBlurSkybox(par3); 491 this.rotateAndBlurSkybox(par3); 492 this.rotateAndBlurSkybox(par3); 493 this.rotateAndBlurSkybox(par3); 494 this.rotateAndBlurSkybox(par3); 495 this.rotateAndBlurSkybox(par3); 496 GL11.glViewport(0, 0, this.mc.displayWidth, this.mc.displayHeight); 497 Tessellator tessellator = Tessellator.instance; 498 tessellator.startDrawingQuads(); 499 float f1 = this.width > this.height ? 120.0F / (float)this.width : 120.0F / (float)this.height; 500 float f2 = (float)this.height * f1 / 256.0F; 501 float f3 = (float)this.width * f1 / 256.0F; 502 GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MIN_FILTER, GL11.GL_LINEAR); 503 GL11.glTexParameteri(GL11.GL_TEXTURE_2D, GL11.GL_TEXTURE_MAG_FILTER, GL11.GL_LINEAR); 504 tessellator.setColorRGBA_F(1.0F, 1.0F, 1.0F, 1.0F); 505 int k = this.width; 506 int l = this.height; 507 tessellator.addVertexWithUV(0.0D, (double)l, (double)this.zLevel, (double)(0.5F - f2), (double)(0.5F + f3)); 508 tessellator.addVertexWithUV((double)k, (double)l, (double)this.zLevel, (double)(0.5F - f2), (double)(0.5F - f3)); 509 tessellator.addVertexWithUV((double)k, 0.0D, (double)this.zLevel, (double)(0.5F + f2), (double)(0.5F - f3)); 510 tessellator.addVertexWithUV(0.0D, 0.0D, (double)this.zLevel, (double)(0.5F + f2), (double)(0.5F + f3)); 511 tessellator.draw(); 512 } 513 514 /** 515 * Draws the screen and all the components in it. 516 */ 517 public void drawScreen(int par1, int par2, float par3) 518 { 519 this.renderSkybox(par1, par2, par3); 520 Tessellator tessellator = Tessellator.instance; 521 short short1 = 274; 522 int k = this.width / 2 - short1 / 2; 523 byte b0 = 30; 524 this.drawGradientRect(0, 0, this.width, this.height, -2130706433, 16777215); 525 this.drawGradientRect(0, 0, this.width, this.height, 0, Integer.MIN_VALUE); 526 this.mc.renderEngine.bindTexture("/title/mclogo.png"); 527 GL11.glColor4f(1.0F, 1.0F, 1.0F, 1.0F); 528 529 if ((double)this.updateCounter < 1.0E-4D) 530 { 531 this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 99, 44); 532 this.drawTexturedModalRect(k + 99, b0 + 0, 129, 0, 27, 44); 533 this.drawTexturedModalRect(k + 99 + 26, b0 + 0, 126, 0, 3, 44); 534 this.drawTexturedModalRect(k + 99 + 26 + 3, b0 + 0, 99, 0, 26, 44); 535 this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44); 536 } 537 else 538 { 539 this.drawTexturedModalRect(k + 0, b0 + 0, 0, 0, 155, 44); 540 this.drawTexturedModalRect(k + 155, b0 + 0, 0, 45, 155, 44); 541 } 542 543 tessellator.setColorOpaque_I(16777215); 544 GL11.glPushMatrix(); 545 GL11.glTranslatef((float)(this.width / 2 + 90), 70.0F, 0.0F); 546 GL11.glRotatef(-20.0F, 0.0F, 0.0F, 1.0F); 547 float f1 = 1.8F - MathHelper.abs(MathHelper.sin((float)(Minecraft.getSystemTime() % 1000L) / 1000.0F * (float)Math.PI * 2.0F) * 0.1F); 548 f1 = f1 * 100.0F / (float)(this.fontRenderer.getStringWidth(this.splashText) + 32); 549 GL11.glScalef(f1, f1, f1); 550 this.drawCenteredString(this.fontRenderer, this.splashText, 0, -8, 16776960); 551 GL11.glPopMatrix(); 552 String s = "Minecraft 1.5.1"; 553 554 if (this.mc.isDemo()) 555 { 556 s = s + " Demo"; 557 } 558 559 List<String> brandings = Lists.reverse(FMLCommonHandler.instance().getBrandings()); 560 for (int i = 0; i < brandings.size(); i++) 561 { 562 String brd = brandings.get(i); 563 if (!Strings.isNullOrEmpty(brd)) 564 { 565 this.drawString(this.fontRenderer, brd, 2, this.height - ( 10 + i * (this.fontRenderer.FONT_HEIGHT + 1)), 16777215); 566 } 567 } 568 569 String s1 = "Copyright Mojang AB. Do not distribute!"; 570 this.drawString(this.fontRenderer, s1, this.width - this.fontRenderer.getStringWidth(s1) - 2, this.height - 10, 16777215); 571 572 if (this.field_92025_p != null && this.field_92025_p.length() > 0) 573 { 574 drawRect(this.field_92022_t - 2, this.field_92021_u - 2, this.field_92020_v + 2, this.field_92019_w - 1, 1428160512); 575 this.drawString(this.fontRenderer, this.field_92025_p, this.field_92022_t, this.field_92021_u, 16777215); 576 this.drawString(this.fontRenderer, field_96138_a, (this.width - this.field_92024_r) / 2, ((GuiButton)this.buttonList.get(0)).yPosition - 12, 16777215); 577 } 578 579 super.drawScreen(par1, par2, par3); 580 } 581 582 /** 583 * Called when the mouse is clicked. 584 */ 585 protected void mouseClicked(int par1, int par2, int par3) 586 { 587 super.mouseClicked(par1, par2, par3); 588 589 if (this.field_92025_p.length() > 0 && par1 >= this.field_92022_t && par1 <= this.field_92020_v && par2 >= this.field_92021_u && par2 <= this.field_92019_w) 590 { 591 GuiConfirmOpenLink guiconfirmopenlink = new GuiConfirmOpenLink(this, "http://tinyurl.com/javappc", 13); 592 guiconfirmopenlink.func_92026_h(); 593 this.mc.displayGuiScreen(guiconfirmopenlink); 594 } 595 } 596 597 static Minecraft func_98058_a(GuiMainMenu par0GuiMainMenu) 598 { 599 return par0GuiMainMenu.mc; 600 } 601 602 static void func_98061_a(GuiMainMenu par0GuiMainMenu, StringTranslate par1StringTranslate, int par2, int par3) 603 { 604 par0GuiMainMenu.func_98060_b(par1StringTranslate, par2, par3); 605 } 606 607 static boolean func_98059_a(boolean par0) 608 { 609 field_96139_s = par0; 610 return par0; 611 } 612}