/** * Fired when a control is clicked. This is the equivalent of * ActionListener.actionPerformed(ActionEvent e). */ protected void actionPerformed(GuiButton par1GuiButton) { if (par1GuiButton.id == 0) { this.mc.displayGuiScreen(new GuiOptions(this, this.mc.gameSettings)); } if (par1GuiButton.id == 5) { this.mc.displayGuiScreen(new GuiLanguage(this, this.mc.gameSettings)); } if (par1GuiButton.id == 1) { this.mc.displayGuiScreen(new GuiSelectWorld(this)); } if (par1GuiButton.id == 4) { this.mc.shutdown(); } if (par1GuiButton.id == 11) { this.mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); } if (par1GuiButton.id == 12) { ISaveFormat var2 = this.mc.getSaveLoader(); WorldInfo var3 = var2.getWorldInfo("Demo_World"); if (var3 != null) { GuiYesNo var4 = GuiSelectWorld.func_74061_a(this, var3.getWorldName(), 12); this.mc.displayGuiScreen(var4); } } }
public void confirmClicked(boolean par1, int par2) { if (par1 && par2 == 12) { ISaveFormat var3 = this.mc.getSaveLoader(); var3.flushCache(); var3.deleteWorldDirectory("Demo_World"); this.mc.displayGuiScreen(this); } }
/** Adds Demo buttons on Main Menu for players who are playing Demo. */ private void addDemoButtons(int par1, int par2) { buttonList.add(new GuiButton(11, width / 2 - 100, par1, I18n.func_135053_a("menu.playdemo"))); buttonList.add( buttonResetDemo = new GuiButton( 12, width / 2 - 100, par1 + par2 * 1, I18n.func_135053_a("menu.resetdemo"))); ISaveFormat isaveformat = mc.getSaveLoader(); WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World"); if (worldinfo == null) { buttonResetDemo.enabled = false; } }
public void confirmClicked(boolean par1, int par2) { if (deleting) { deleting = false; if (par1) { ISaveFormat isaveformat = mc.getSaveLoader(); isaveformat.flushCache(); isaveformat.deleteWorldDirectory(getSaveFileName(par2)); loadSaves(); } mc.displayGuiScreen(this); } }
/** * Fired when a control is clicked. This is the equivalent of * ActionListener.actionPerformed(ActionEvent e). */ protected void actionPerformed(GuiButton par1GuiButton) { if (par1GuiButton.id == 0) { mc.displayGuiScreen(new GuiOptions(this, mc.gameSettings)); } if (par1GuiButton.id == 5) { mc.displayGuiScreen(new GuiLanguage(this, mc.gameSettings, mc.func_135016_M())); } if (par1GuiButton.id == 1) { mc.displayGuiScreen(new GuiSelectWorld(this)); } if (par1GuiButton.id == 2) { mc.displayGuiScreen(new GuiMultiplayer(this)); } if (par1GuiButton.id == 14 && field_130023_H.drawButton) { func_140005_i(); } if (par1GuiButton.id == 4) { mc.shutdown(); } if (par1GuiButton.id == 10) { mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, mc.gameSettings)); } if (par1GuiButton.id == 11) { mc.enableSP = mc.useSP; if (mc.enableSP) { mc.playerController = new PlayerControllerDemo(mc); mc.startWorldSSP("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); mc.displayGuiScreen(null); } else { mc.launchIntegratedServer("Demo_World", "Demo_World", DemoWorldServer.demoWorldSettings); } } if (par1GuiButton.id == 12) { ISaveFormat isaveformat = mc.getSaveLoader(); WorldInfo worldinfo = isaveformat.getWorldInfo("Demo_World"); if (worldinfo != null) { GuiYesNo guiyesno = GuiSelectWorld.getDeleteWorldScreen(this, worldinfo.getWorldName(), 12); mc.displayGuiScreen(guiyesno); } } }
/** Adds Demo buttons on Main Menu for players who are playing Demo. */ private void addDemoButtons(int par1, int par2, StringTranslate par3StringTranslate) { this.buttonList.add( new GuiButton( 11, this.width / 2 - 100, par1, par3StringTranslate.translateKey("menu.playdemo"))); this.buttonList.add( this.buttonResetDemo = new GuiButton( 12, this.width / 2 - 100, par1 + par2 * 1, par3StringTranslate.translateKey("menu.resetdemo"))); ISaveFormat var4 = this.mc.getSaveLoader(); WorldInfo var5 = var4.getWorldInfo("Demo_World"); if (var5 == null) { this.buttonResetDemo.enabled = false; } }
private void func_73972_b(int par1, int par2, StringTranslate par3StringTranslate) { this.controlList.add( new GuiButton( 11, this.width / 2 - 100, par1, par3StringTranslate.translateKey("menu.playdemo"))); this.controlList.add( this.field_73973_d = new GuiButton( 12, this.width / 2 - 100, par1 + par2 * 1, par3StringTranslate.translateKey("menu.resetdemo"))); ISaveFormat var4 = this.mc.getSaveLoader(); WorldInfo var5 = var4.getWorldInfo("Demo_World"); if (var5 == null) { this.field_73973_d.enabled = false; } }
public void confirmClicked(boolean par1, int par2) { if (par1 && par2 == 12) { ISaveFormat var6 = this.mc.getSaveLoader(); var6.flushCache(); var6.deleteWorldDirectory("Demo_World"); this.mc.displayGuiScreen(this); } else if (par2 == 13) { if (par1) { try { Class var3 = Class.forName("java.awt.Desktop"); Object var4 = var3.getMethod("getDesktop", new Class[0]).invoke((Object) null, new Object[0]); var3.getMethod("browse", new Class[] {URI.class}) .invoke(var4, new Object[] {new URI("http://tinyurl.com/javappc")}); } catch (Throwable var5) { var5.printStackTrace(); } } this.mc.displayGuiScreen(this); } }
public void confirmClicked(boolean par1, int par2) { if (par1 && par2 == 12) { ISaveFormat isaveformat = mc.getSaveLoader(); isaveformat.flushCache(); isaveformat.deleteWorldDirectory("Demo_World"); mc.displayGuiScreen(this); } else if (par2 == 13) { if (par1) { try { Class class1 = Class.forName("java.awt.Desktop"); Object obj = class1.getMethod("getDesktop", new Class[0]).invoke(null, new Object[0]); class1 .getMethod("browse", new Class[] {java.net.URI.class}) .invoke(obj, new Object[] {new URI(field_104024_v)}); } catch (Throwable throwable) { throwable.printStackTrace(); } } mc.displayGuiScreen(this); } }
/** loads the saves */ private void loadSaves() { ISaveFormat isaveformat = mc.getSaveLoader(); saveList = isaveformat.getSaveList(); Collections.sort(saveList); selectedWorld = -1; }