public void func_6448_a() { this.field_949_e.clear(); if (this.field_945_b.field_6324_e.func_22144_v().func_40724_s()) { this.field_949_e.add( new GuiButton( 1, this.field_951_c / 2 - 100, this.field_950_d / 4 + 96, StatCollector.func_25200_a("deathScreen.deleteWorld"))); } else { this.field_949_e.add( new GuiButton( 1, this.field_951_c / 2 - 100, this.field_950_d / 4 + 72, StatCollector.func_25200_a("deathScreen.respawn"))); this.field_949_e.add( new GuiButton( 2, this.field_951_c / 2 - 100, this.field_950_d / 4 + 96, StatCollector.func_25200_a("deathScreen.titleScreen"))); if (this.field_945_b.field_6320_i == null) { ((GuiButton) this.field_949_e.get(1)).field_937_g = false; } } GuiButton var2; for (Iterator var1 = this.field_949_e.iterator(); var1.hasNext(); var2.field_937_g = false) { var2 = (GuiButton) var1.next(); } }
/** * Fired when a control is clicked. This is the equivalent of * ActionListener.actionPerformed(ActionEvent e). */ protected void actionPerformed(GuiButton par1GuiButton) { if (!par1GuiButton.enabled) { return; } if (par1GuiButton.id == 0) { if (!Spoutcraft.hasPermission("spout.client.signcolors")) { for (int i = 0; i < entitySign.signText.length; i++) { entitySign.signText[i] = ChatColor.stripColor(entitySign.signText[i]); } } entitySign.onInventoryChanged(); mc.displayGuiScreen(null); } // Spout start else if (par1GuiButton.id == 1 && unicode.enabled) { ConfigReader.sendColorsAsUnicode = !ConfigReader.sendColorsAsUnicode; if (ConfigReader.sendColorsAsUnicode) { unicode.displayString = "Send As Unicode"; } else { unicode.displayString = "Send As Plain Text"; } } // Spout end }
public void func_73866_w_() { this.field_74050_a = 0; this.field_73887_h.clear(); byte var1 = -16; this.field_73887_h.add( new GuiButton( 1, this.field_73880_f / 2 - 100, this.field_73881_g / 4 + 120 + var1, StatCollector.func_74838_a("menu.returnToMenu"))); if (!this.field_73882_e.func_71387_A()) { ((GuiButton) this.field_73887_h.get(0)).field_73744_e = StatCollector.func_74838_a("menu.disconnect"); } this.field_73887_h.add( new GuiButton( 4, this.field_73880_f / 2 - 100, this.field_73881_g / 4 + 24 + var1, StatCollector.func_74838_a("menu.returnToGame"))); this.field_73887_h.add( new GuiButton( 0, this.field_73880_f / 2 - 100, this.field_73881_g / 4 + 96 + var1, 98, 20, StatCollector.func_74838_a("menu.options"))); GuiButton var3; this.field_73887_h.add( var3 = new GuiButton( 7, this.field_73880_f / 2 + 2, this.field_73881_g / 4 + 96 + var1, 98, 20, StatCollector.func_74838_a("menu.shareToLan"))); this.field_73887_h.add( new GuiButton( 5, this.field_73880_f / 2 - 100, this.field_73881_g / 4 + 48 + var1, 98, 20, StatCollector.func_74838_a("gui.achievements"))); this.field_73887_h.add( new GuiButton( 6, this.field_73880_f / 2 + 2, this.field_73881_g / 4 + 48 + var1, 98, 20, StatCollector.func_74838_a("gui.stats"))); var3.field_73742_g = this.field_73882_e.func_71356_B() && !this.field_73882_e.func_71401_C().func_71344_c(); }
public void func_570_g() { super.func_570_g(); ++this.field_48154_a; GuiButton var2; if (this.field_48154_a == 20) { for (Iterator var1 = this.field_949_e.iterator(); var1.hasNext(); var2.field_937_g = true) { var2 = (GuiButton) var1.next(); } } }
int updateDownloads() { if (selected < 0) return 0; int i = ThreadDownloadMod.downloadings.size(); GuiButton bDownload = (GuiButton) controlList.get(6); if (mods.get(selected).getDirectDownloadURL() != null && !ThreadDownloadMod.downloadings.contains(mods.get(selected).getModName())) bDownload.enabled = true; return i; }
protected void func_565_a(int p_565_1_, int p_565_2_, int p_565_3_) { if (p_565_3_ == 0) { for (int var4 = 0; var4 < this.field_949_e.size(); ++var4) { GuiButton var5 = (GuiButton) this.field_949_e.get(var4); if (var5.func_562_c(this.field_945_b, p_565_1_, p_565_2_)) { this.field_946_a = var5; this.field_945_b.field_6301_A.func_337_a("random.click", 1.0F, 1.0F); this.func_572_a(var5); } } } }
@Override public void drawScreen(int par1, int par2, float par3) { super.drawScreen(par1, par2, par3); drawDefaultBackground(); drawGuiContainerBackgroundLayer(par3, par1, par2); drawGuiContainerForegroundLayer(); for (int i = 0; i < controlList.size(); i++) { GuiButton guibutton = (GuiButton) controlList.get(i); guibutton.drawButton(mc, par1, par2); } }
@Override protected void actionPerformed(GuiButton but) { if (but == button) { showSacrifices = !showSacrifices; if (showSacrifices) { but.displayString = "Description >"; } else { but.displayString = "< Information"; } } else { super.actionPerformed(but); } }
/** Adds the buttons (and other controls) to the screen in question. */ public void initGui() { controlList.clear(); Keyboard.enableRepeatEvents(true); controlList.add(new GuiButton(0, width / 2 - 100, height / 4 + 120, "Done")); // Spout start controlList.add( unicode = new GuiButton(1, width / 2 - 100, height / 4 + 142, "Send As Unicode")); if (!ConfigReader.sendColorsAsUnicode) { unicode.displayString = "Send As Plain Text"; } if (!this.mc.theWorld.isRemote) { unicode.drawButton = false; unicode.enabled = false; } // Spout end }
protected void func_73875_a(GuiButton p_73875_1_) { switch (p_73875_1_.field_73741_f) { case 0: this.field_73882_e.func_71373_a(new GuiOptions(this, this.field_73882_e.field_71474_y)); break; case 1: p_73875_1_.field_73742_g = false; this.field_73882_e.field_71413_E.func_77450_a(StatList.field_75947_j, 1); this.field_73882_e.field_71441_e.func_72882_A(); this.field_73882_e.func_71403_a((WorldClient) null); this.field_73882_e.func_71373_a(new GuiMainMenu()); case 2: case 3: default: break; case 4: this.field_73882_e.func_71373_a((GuiScreen) null); this.field_73882_e.func_71381_h(); break; case 5: this.field_73882_e.func_71373_a(new GuiAchievements(this.field_73882_e.field_71413_E)); break; case 6: this.field_73882_e.func_71373_a(new GuiStats(this, this.field_73882_e.field_71413_E)); break; case 7: this.field_73882_e.func_71373_a(new GuiShareToLan(this)); } }
/** intilize the buttons for this GUI */ public void initButtons() { StringTranslate stringtranslate = StringTranslate.getInstance(); controlList.add( buttonSelect = new GuiButton( 1, width / 2 - 154, height - 52, 150, 20, stringtranslate.translateKey("selectWorld.select"))); controlList.add( buttonDelete = new GuiButton( 6, width / 2 - 154, height - 28, 70, 20, stringtranslate.translateKey("selectWorld.rename"))); controlList.add( buttonRename = new GuiButton( 2, width / 2 - 74, height - 28, 70, 20, stringtranslate.translateKey("selectWorld.delete"))); controlList.add( new GuiButton( 3, width / 2 + 4, height - 52, 150, 20, stringtranslate.translateKey("selectWorld.create"))); controlList.add( new GuiButton( 0, width / 2 + 4, height - 28, 150, 20, stringtranslate.translateKey("gui.cancel"))); buttonSelect.enabled = false; buttonRename.enabled = false; buttonDelete.enabled = false; }
/** * Adds Singleplayer and Multiplayer buttons on Main Menu for players who have bought the game. */ private void addSingleplayerMultiplayerButtons(int par1, int par2) { buttonList.add( new GuiButton(1, width / 2 - 100, par1, I18n.func_135053_a("menu.singleplayer"))); buttonList.add( new GuiButton(2, width / 2 - 100, par1 + par2 * 1, I18n.func_135053_a("menu.multiplayer"))); buttonList.add( field_130023_H = new GuiButton(14, width / 2 - 100, par1 + par2 * 2, I18n.func_135053_a("menu.online"))); field_130023_H.drawButton = false; }
public void selectModIndex(int var1) { selected = var1; UpdateManagerMod mod = mods.get(var1); GuiButton bWebsite = (GuiButton) controlList.get(4); GuiButton bChangelog = (GuiButton) controlList.get(5); GuiButton bDownload = (GuiButton) controlList.get(6); if (UpdateManager.online) { bWebsite.enabled = true; bChangelog.enabled = mod.getChangelogURL() != null; bDownload.enabled = mod.getDirectDownloadURL() != null && !ThreadDownloadMod.downloadings.contains(mod.getModName()); } if (specialButton != null) controlList.remove(specialButton); if (mod.getSpecialButtonName() != null) { String name = mod.getSpecialButtonName(); specialButton = new GuiButton( 8, width - fontRenderer.getStringWidth(name) - 12, 106, fontRenderer.getStringWidth(name) + 8, 20, name); controlList.add(specialButton); } }
/** 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; } }
/** * Fired when a control is clicked. This is the equivalent of * ActionListener.actionPerformed(ActionEvent e). */ protected void actionPerformed(GuiButton par1GuiButton) { if (par1GuiButton.enabled) { if (par1GuiButton.id < 100 && par1GuiButton instanceof GuiSmallButton) { this.field_73890_c.setOptionValue(((GuiSmallButton) par1GuiButton).returnEnumOptions(), 1); par1GuiButton.displayString = this.field_73890_c.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); } if (par1GuiButton.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.field_73889_b); } } }
protected void actionPerformed(GuiButton guibutton) { for (int i = 0; i < options.keyBindings.length; i++) { ((GuiButton) controlList.get(i)).displayString = options.getOptionDisplayString(i); } if (guibutton.id == 200) { mc.displayGuiScreen(parentScreen); } else { buttonId = guibutton.id; guibutton.displayString = (new StringBuilder()) .append("> ") .append(options.getOptionDisplayString(guibutton.id)) .append(" <") .toString(); } }
protected void actionPerformed(GuiButton guibutton) { if (!guibutton.enabled) { return; } if (guibutton.id < 100 && (guibutton instanceof GuiSmallButton)) { guiGameSettings.setOptionValue(((GuiSmallButton) guibutton).returnEnumOptions(), 1); guibutton.displayString = guiGameSettings.getKeyBinding(EnumOptions.getEnumOptions(guibutton.id)); } if (guibutton.id == 200) { mc.gameSettings.saveOptions(); mc.displayGuiScreen(field_22110_h); } ScaledResolution scaledresolution = new ScaledResolution(mc.gameSettings, mc.displayWidth, mc.displayHeight); int i = scaledresolution.getScaledWidth(); int j = scaledresolution.getScaledHeight(); setWorldAndResolution(mc, i, j); }
/** * Fired when a control is clicked. This is the equivalent of * ActionListener.actionPerformed(ActionEvent e). */ protected void actionPerformed(GuiButton par1GuiButton) { if (par1GuiButton.enabled) { if (par1GuiButton.id < 200 && par1GuiButton instanceof GuiSmallButtonEx) { EnumOptions num = EnumOptions.getEnumOptions(par1GuiButton.id); this.guivrSettings.setOptionValue( ((GuiSmallButtonEx) par1GuiButton).returnEnumOptions(), 1); par1GuiButton.displayString = this.guivrSettings.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); } else if (par1GuiButton.id == 200) { this.mc.vrSettings.saveOptions(); this.mc.displayGuiScreen(this.parentGuiScreen); } else if (par1GuiButton.id == 201) { this.guivrSettings.calibrationStrategy = VRSettings.CALIBRATION_STRATEGY_AT_STARTUP; this.mc.vrSettings.saveOptions(); this.reinit = true; } else if (par1GuiButton.id == 202) { if (vrRenderer != null) vrRenderer.startCalibration(); } } }
/** * Fired when a control is clicked. This is the equivalent of * ActionListener.actionPerformed(ActionEvent e). */ protected void actionPerformed(GuiButton par1GuiButton) { EnumOptions num = EnumOptions.getEnumOptions(par1GuiButton.id); if (par1GuiButton.enabled) { if (par1GuiButton.id < 200 && par1GuiButton instanceof GuiSmallButtonEx) { this.guivrSettings.setOptionValue( ((GuiSmallButtonEx) par1GuiButton).returnEnumOptions(), 1); par1GuiButton.displayString = this.guivrSettings.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); if (num == EnumOptions.HEAD_TRACK_PREDICTION) { mc.headTracker.setPrediction( this.mc.vrSettings.headTrackPredictionTimeSecs, this.mc.vrSettings.useHeadTrackPrediction); } } else if (par1GuiButton.id == 200) { this.mc.vrSettings.saveOptions(); this.mc.displayGuiScreen(this.parentGuiScreen); } else if (par1GuiButton.id == 201) { this.mc.vrSettings.useHeadTracking = true; if (this.mc.headTracker instanceof MCOculus) { this.mc.vrSettings.useHeadTrackPrediction = true; this.mc.vrSettings.headTrackPredictionTimeSecs = 0f; mc.headTracker.setPrediction( this.mc.vrSettings.headTrackPredictionTimeSecs, this.mc.vrSettings.useHeadTrackPrediction); } this.mc.vrSettings.setHeadTrackSensitivity(1.0f); this.reinit = true; } else if (par1GuiButton.id == 202) { if (vrRenderer != null) vrRenderer.startCalibration(); } else if (par1GuiButton.id == 203) // Mode Change { this.mc.vrSettings.headTrackerPluginID = pluginModeChangeutton.getSelectedID(); this.mc.vrSettings.saveOptions(); this.mc.headTracker = PluginManager.configureOrientation(this.mc.vrSettings.headTrackerPluginID); this.reinit = true; } } }
public void func_571_a(int p_571_1_, int p_571_2_, float p_571_3_) { for (int var4 = 0; var4 < this.field_949_e.size(); ++var4) { GuiButton var5 = (GuiButton) this.field_949_e.get(var4); var5.func_561_a(this.field_945_b, p_571_1_, p_571_2_); } }
@Override protected void actionPerformed(GuiButton button) { UpdateManagerMod mod = null; if (selected >= 0) mod = mods.get(getSelected()); if (button.enabled) switch (button.id) { case 0: { ModLoader.openGUI( ModLoader.getMinecraftInstance().thePlayer, new GuiModListWithUMButton(parentGui)); break; } case 1: { UpdateManager.openWebpage(UpdateManager.umWebpage); break; } case 2: { try { URL url = new URL("https://dl.dropbox.com/u/43671482/Update%20Manager/MotW.txt"); BufferedReader r = new BufferedReader(new InputStreamReader(url.openStream())); UpdateManager.openWebpage(r.readLine()); } catch (IOException e) { e.printStackTrace(); } break; } case 3: { ModLoader.openGUI(ModLoader.getMinecraftInstance().thePlayer, new GuiSettings(this)); break; } case 4: { UpdateManager.openWebpage(mod.getModURL()); break; } case 5: { ModLoader.openGUI( ModLoader.getMinecraftInstance().thePlayer, new GuiChangelog(this, mod)); break; } case 6: { if (mod.getDisclaimerURL() == null) { if (!ThreadDownloadMod.downloadings.contains(mod.getModName())) { new ThreadDownloadMod(mod.getDirectDownloadURL(), mod); button.enabled = false; } } else ModLoader.openGUI( ModLoader.getMinecraftInstance().thePlayer, new GuiDisclaimer(this, mod)); break; } case 7: { Sys.openURL( "file://" + new File(Minecraft.getMinecraftDir(), "downloadedMods").getAbsolutePath()); break; } case 8: { mod.onSpecialButtonClicked(); break; } } super.actionPerformed(button); }