protected void actionPerformed(GuiButton p_146284_1_) { if (p_146284_1_.enabled) { if (p_146284_1_.id < 100 && p_146284_1_ instanceof GuiOptionButton) { GameSettings.Options options = ((GuiOptionButton) p_146284_1_).returnEnumOptions(); this.field_152318_h.setOptionValue(options, 1); p_146284_1_.displayString = this.field_152318_h.getKeyBinding(GameSettings.Options.getEnumOptions(p_146284_1_.id)); if (this.mc.func_152346_Z().func_152934_n() && options != GameSettings.Options.STREAM_CHAT_ENABLED && options != GameSettings.Options.STREAM_CHAT_USER_FILTER) { this.field_152315_t = true; } } else if (p_146284_1_ instanceof GuiOptionSlider) { if (p_146284_1_.id == GameSettings.Options.STREAM_VOLUME_MIC.returnEnumOrdinal()) { this.mc.func_152346_Z().func_152915_s(); } else if (p_146284_1_.id == GameSettings.Options.STREAM_VOLUME_SYSTEM.returnEnumOrdinal()) { this.mc.func_152346_Z().func_152915_s(); } else if (this.mc.func_152346_Z().func_152934_n()) { this.field_152315_t = true; } } if (p_146284_1_.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.field_152317_g); } else if (p_146284_1_.id == 201) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(new GuiIngestServers(this)); } } }
protected void actionPerformed(GuiButton par1GuiButton) throws IOException { if (par1GuiButton.enabled) { int var2 = this.guiGameSettings.guiScale; if (par1GuiButton.id < 200 && par1GuiButton instanceof GuiOptionButton) { this.guiGameSettings.setOptionValue( ((GuiOptionButton) par1GuiButton).returnEnumOptions(), 1); par1GuiButton.displayString = this.guiGameSettings.getKeyBinding( GameSettings.Options.getEnumOptions(par1GuiButton.id)); } if (par1GuiButton.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.parentGuiScreen); } if (this.guiGameSettings.guiScale != var2) { ScaledResolution scr = new ScaledResolution(this.mc, this.mc.displayWidth, this.mc.displayHeight); int var4 = scr.getScaledWidth(); int var5 = scr.getScaledHeight(); this.setWorldAndResolution(this.mc, var4, var5); } if (par1GuiButton.id == 201) { this.mc.gameSettings.saveOptions(); GuiDetailSettingsOF scr1 = new GuiDetailSettingsOF(this, this.guiGameSettings); this.mc.displayGuiScreen(scr1); } if (par1GuiButton.id == 202) { this.mc.gameSettings.saveOptions(); GuiQualitySettingsOF scr2 = new GuiQualitySettingsOF(this, this.guiGameSettings); this.mc.displayGuiScreen(scr2); } if (par1GuiButton.id == 211) { this.mc.gameSettings.saveOptions(); GuiAnimationSettingsOF scr3 = new GuiAnimationSettingsOF(this, this.guiGameSettings); this.mc.displayGuiScreen(scr3); } if (par1GuiButton.id == 212) { this.mc.gameSettings.saveOptions(); GuiPerformanceSettingsOF scr4 = new GuiPerformanceSettingsOF(this, this.guiGameSettings); this.mc.displayGuiScreen(scr4); } if (par1GuiButton.id == 222) { this.mc.gameSettings.saveOptions(); GuiOtherSettingsOF scr5 = new GuiOtherSettingsOF(this, this.guiGameSettings); this.mc.displayGuiScreen(scr5); } if (par1GuiButton.id == GameSettings.Options.AO_LEVEL.ordinal()) { return; } } }
/** Called by the controls from the buttonList when activated. (Mouse pressed for buttons) */ protected void actionPerformed(GuiButton button) throws IOException { if (button.enabled) { if (button.id < 100 && button instanceof GuiOptionButton) { GameSettings.Options gamesettings$options = ((GuiOptionButton) button).returnEnumOptions(); this.field_152318_h.setOptionValue(gamesettings$options, 1); button.displayString = this.field_152318_h.getKeyBinding(GameSettings.Options.getEnumOptions(button.id)); if (this.mc.getTwitchStream().isBroadcasting() && gamesettings$options != GameSettings.Options.STREAM_CHAT_ENABLED && gamesettings$options != GameSettings.Options.STREAM_CHAT_USER_FILTER) { this.field_152315_t = true; } } else if (button instanceof GuiOptionSlider) { if (button.id == GameSettings.Options.STREAM_VOLUME_MIC.returnEnumOrdinal()) { this.mc.getTwitchStream().updateStreamVolume(); } else if (button.id == GameSettings.Options.STREAM_VOLUME_SYSTEM.returnEnumOrdinal()) { this.mc.getTwitchStream().updateStreamVolume(); } else if (this.mc.getTwitchStream().isBroadcasting()) { this.field_152315_t = true; } } if (button.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.parentScreen); } else if (button.id == 201) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(new GuiIngestServers(this)); } } }
/** Adds the buttons (and other controls) to the screen in question. */ public void initGui() { int i = 0; this.field_152319_i = I18n.format("options.stream.title", new Object[0]); this.field_152313_r = I18n.format("options.stream.chat.title", new Object[0]); GameSettings.Options[] aoptions = field_152312_a; int j = aoptions.length; int k; GameSettings.Options options; for (k = 0; k < j; ++k) { options = aoptions[k]; if (options.getEnumFloat()) { this.buttonList.add( new GuiOptionSlider( options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options)); } else { this.buttonList.add( new GuiOptionButton( options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options, this.field_152318_h.getKeyBinding(options))); } ++i; } if (i % 2 == 1) { ++i; } this.field_152314_s = this.height / 6 + 24 * (i >> 1) + 6; i += 2; aoptions = field_152316_f; j = aoptions.length; for (k = 0; k < j; ++k) { options = aoptions[k]; if (options.getEnumFloat()) { this.buttonList.add( new GuiOptionSlider( options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options)); } else { this.buttonList.add( new GuiOptionButton( options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), options, this.field_152318_h.getKeyBinding(options))); } ++i; } this.buttonList.add( new GuiButton( 200, this.width / 2 - 155, this.height / 6 + 168, 150, 20, I18n.format("gui.done", new Object[0]))); GuiButton guibutton = new GuiButton( 201, this.width / 2 + 5, this.height / 6 + 168, 150, 20, I18n.format("options.stream.ingestSelection", new Object[0])); guibutton.enabled = this.mc.func_152346_Z().func_152924_m() && this.mc.func_152346_Z().func_152925_v().length > 0 || this.mc.func_152346_Z().func_152908_z(); this.buttonList.add(guibutton); }
/** Adds the buttons (and other controls) to the screen in question. */ public void initGui() { this.screenTitle = I18n.format("options.videoTitle", new Object[0]); this.buttonList.clear(); this.is64bit = false; String[] var1 = new String[] {"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; String[] var2 = var1; int var3 = var1.length; for (int var8 = 0; var8 < var3; ++var8) { String var9 = var2[var8]; String var10 = System.getProperty(var9); if (var10 != null && var10.contains("64")) { this.is64bit = true; break; } } boolean var12 = false; boolean var111 = !this.is64bit; GameSettings.Options[] var13 = videoOptions; int var14 = var13.length; boolean var11 = false; int x; int var15; for (var15 = 0; var15 < var14; ++var15) { GameSettings.Options y = var13[var15]; x = this.width / 2 - 155 + var15 % 2 * 160; int y1 = this.height / 6 + 21 * (var15 / 2) - 10; if (y.getEnumFloat()) { this.buttonList.add(new GuiOptionSlider(y.returnEnumOrdinal(), x, y1, y)); } else { this.buttonList.add( new GuiOptionButton( y.returnEnumOrdinal(), x, y1, y, this.guiGameSettings.getKeyBinding(y))); } } int var16 = this.height / 6 + 21 * (var15 / 2) - 10; boolean var17 = false; x = this.width / 2 - 155 + 160; this.buttonList.add(new GuiOptionButton(202, x, var16, "Quality...")); var16 += 21; x = this.width / 2 - 155 + 0; this.buttonList.add(new GuiOptionButton(201, x, var16, "Details...")); x = this.width / 2 - 155 + 160; this.buttonList.add(new GuiOptionButton(212, x, var16, "Performance...")); var16 += 21; x = this.width / 2 - 155 + 0; this.buttonList.add(new GuiOptionButton(211, x, var16, "Animations...")); x = this.width / 2 - 155 + 160; this.buttonList.add(new GuiOptionButton(222, x, var16, "Other...")); this.buttonList.add( new GuiButton( 200, this.width / 2 - 100, this.height / 6 + 168 + 11, I18n.format("gui.done", new Object[0]))); }
/** * Adds the buttons (and other controls) to the screen in question. Called when the GUI is * displayed and when the window resizes, the buttonList is cleared beforehand. */ public void initGui() { int i = 0; this.field_152319_i = I18n.format("options.stream.title", new Object[0]); this.field_152313_r = I18n.format("options.stream.chat.title", new Object[0]); for (GameSettings.Options gamesettings$options : field_152312_a) { if (gamesettings$options.getEnumFloat()) { this.buttonList.add( new GuiOptionSlider( gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options)); } else { this.buttonList.add( new GuiOptionButton( gamesettings$options.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options, this.field_152318_h.getKeyBinding(gamesettings$options))); } ++i; } if (i % 2 == 1) { ++i; } this.field_152314_s = this.height / 6 + 24 * (i >> 1) + 6; i = i + 2; for (GameSettings.Options gamesettings$options1 : field_152316_f) { if (gamesettings$options1.getEnumFloat()) { this.buttonList.add( new GuiOptionSlider( gamesettings$options1.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options1)); } else { this.buttonList.add( new GuiOptionButton( gamesettings$options1.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), gamesettings$options1, this.field_152318_h.getKeyBinding(gamesettings$options1))); } ++i; } this.buttonList.add( new GuiButton( 200, this.width / 2 - 155, this.height / 6 + 168, 150, 20, I18n.format("gui.done", new Object[0]))); GuiButton guibutton = new GuiButton( 201, this.width / 2 + 5, this.height / 6 + 168, 150, 20, I18n.format("options.stream.ingestSelection", new Object[0])); guibutton.enabled = this.mc.getTwitchStream().isReadyToBroadcast() && this.mc.getTwitchStream().func_152925_v().length > 0 || this.mc.getTwitchStream().func_152908_z(); this.buttonList.add(guibutton); }