protected void func_73875_a(GuiButton p_73875_1_) { if(p_73875_1_.field_73742_g) { int var2 = this.field_74106_c.field_74335_Z; if(p_73875_1_.field_73741_f < 100 && p_73875_1_ instanceof GuiSmallButton) { this.field_74106_c.func_74306_a(((GuiSmallButton)p_73875_1_).func_73753_a(), 1); p_73875_1_.field_73744_e = this.field_74106_c.func_74297_c(EnumOptions.func_74379_a(p_73875_1_.field_73741_f)); } if(p_73875_1_.field_73741_f == 200) { this.field_73882_e.field_71474_y.func_74303_b(); this.field_73882_e.func_71373_a(this.field_74105_b); } if(this.field_74106_c.field_74335_Z != var2) { ScaledResolution var3 = new ScaledResolution(this.field_73882_e.field_71474_y, this.field_73882_e.field_71443_c, this.field_73882_e.field_71440_d); int var4 = var3.func_78326_a(); int var5 = var3.func_78328_b(); this.func_73872_a(this.field_73882_e, var4, var5); } } }
/** * 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 == 2) { this.snooperGameSettings.saveOptions(); this.snooperGameSettings.saveOptions(); this.mc.displayGuiScreen(this.snooperGuiScreen); } if (par1GuiButton.id == 1) { this.snooperGameSettings.setOptionValue(EnumOptions.SNOOPER_ENABLED, 1); this.buttonAllowSnooping.displayString = this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED); } } }
/** * 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.theSettings.setOptionValue(((GuiSmallButton)par1GuiButton).returnEnumOptions(), 1); par1GuiButton.displayString = this.theSettings.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); } if (par1GuiButton.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.theGuiScreen); } } }
public boolean func_74308_b(EnumOptions p_74308_1_) { switch(EnumOptionsHelper.field_74414_a[p_74308_1_.ordinal()]) { case 1: return this.field_74338_d; case 2: return this.field_74336_f; case 3: return this.field_74337_g; case 4: return this.field_74349_h; case 5: return this.field_74345_l; case 6: return this.field_74344_o; case 7: return this.field_74359_p; case 8: return this.field_74358_q; case 9: return this.field_74356_s; case 10: return this.field_74355_t; case 11: return this.field_74353_u; case 12: return this.field_74352_v; case 13: return this.field_82880_z; case 14: return this.field_85185_A; default: return false; } }
public String func_74297_c(EnumOptions p_74297_1_) { String var2 = I18n.func_135053_a(p_74297_1_.func_74378_d()) + ": "; if(p_74297_1_.func_74380_a()) { float var5 = this.func_74296_a(p_74297_1_); return p_74297_1_ == EnumOptions.SENSITIVITY?(var5 == 0.0F?var2 + I18n.func_135053_a("options.sensitivity.min"):(var5 == 1.0F?var2 + I18n.func_135053_a("options.sensitivity.max"):var2 + (int)(var5 * 200.0F) + "%")):(p_74297_1_ == EnumOptions.FOV?(var5 == 0.0F?var2 + I18n.func_135053_a("options.fov.min"):(var5 == 1.0F?var2 + I18n.func_135053_a("options.fov.max"):var2 + (int)(70.0F + var5 * 40.0F))):(p_74297_1_ == EnumOptions.GAMMA?(var5 == 0.0F?var2 + I18n.func_135053_a("options.gamma.min"):(var5 == 1.0F?var2 + I18n.func_135053_a("options.gamma.max"):var2 + "+" + (int)(var5 * 100.0F) + "%")):(p_74297_1_ == EnumOptions.CHAT_OPACITY?var2 + (int)(var5 * 90.0F + 10.0F) + "%":(p_74297_1_ == EnumOptions.CHAT_HEIGHT_UNFOCUSED?var2 + GuiNewChat.func_96130_b(var5) + "px":(p_74297_1_ == EnumOptions.CHAT_HEIGHT_FOCUSED?var2 + GuiNewChat.func_96130_b(var5) + "px":(p_74297_1_ == EnumOptions.CHAT_WIDTH?var2 + GuiNewChat.func_96128_a(var5) + "px":(var5 == 0.0F?var2 + I18n.func_135053_a("options.off"):var2 + (int)(var5 * 100.0F) + "%"))))))); } else if(p_74297_1_.func_74382_b()) { boolean var4 = this.func_74308_b(p_74297_1_); return var4?var2 + I18n.func_135053_a("options.on"):var2 + I18n.func_135053_a("options.off"); } else if(p_74297_1_ == EnumOptions.RENDER_DISTANCE) { return var2 + func_74299_a(field_74360_ac, this.field_74339_e); } else if(p_74297_1_ == EnumOptions.DIFFICULTY) { return var2 + func_74299_a(field_74361_ad, this.field_74318_M); } else if(p_74297_1_ == EnumOptions.GUI_SCALE) { return var2 + func_74299_a(field_74367_ae, this.field_74335_Z); } else if(p_74297_1_ == EnumOptions.CHAT_VISIBILITY) { return var2 + func_74299_a(field_74369_af, this.field_74343_n); } else if(p_74297_1_ == EnumOptions.PARTICLES) { return var2 + func_74299_a(field_74364_ag, this.field_74362_aa); } else if(p_74297_1_ == EnumOptions.FRAMERATE_LIMIT) { return var2 + func_74299_a(field_74365_ah, this.field_74350_i); } else if(p_74297_1_ == EnumOptions.AMBIENT_OCCLUSION) { return var2 + func_74299_a(field_98303_au, this.field_74348_k); } else if(p_74297_1_ == EnumOptions.GRAPHICS) { if(this.field_74347_j) { return var2 + I18n.func_135053_a("options.graphics.fancy"); } else { String var3 = "options.graphics.fast"; return var2 + I18n.func_135053_a("options.graphics.fast"); } } else { return var2; } }
public void func_73866_w_() { this.field_74103_m = I18n.func_135053_a("options.snooper.title"); String var1 = I18n.func_135053_a("options.snooper.desc"); ArrayList var2 = new ArrayList(); Iterator var3 = this.field_73886_k.func_78271_c(var1, this.field_73880_f - 30).iterator(); while(var3.hasNext()) { String var4 = (String)var3.next(); var2.add(var4); } this.field_74101_n = (String[])var2.toArray(new String[0]); this.field_74098_c.clear(); this.field_74096_d.clear(); this.field_73887_h.add(this.field_74099_p = new GuiButton(1, this.field_73880_f / 2 - 152, this.field_73881_g - 30, 150, 20, this.field_74097_b.func_74297_c(EnumOptions.SNOOPER_ENABLED))); this.field_73887_h.add(new GuiButton(2, this.field_73880_f / 2 + 2, this.field_73881_g - 30, 150, 20, I18n.func_135053_a("gui.done"))); boolean var6 = this.field_73882_e.func_71401_C() != null && this.field_73882_e.func_71401_C().func_80003_ah() != null; Iterator var7 = (new TreeMap(this.field_73882_e.func_71378_E().func_76465_c())).entrySet().iterator(); Entry var5; while(var7.hasNext()) { var5 = (Entry)var7.next(); this.field_74098_c.add((var6?"C ":"") + (String)var5.getKey()); this.field_74096_d.add(this.field_73886_k.func_78269_a((String)var5.getValue(), this.field_73880_f - 220)); } if(var6) { var7 = (new TreeMap(this.field_73882_e.func_71401_C().func_80003_ah().func_76465_c())).entrySet().iterator(); while(var7.hasNext()) { var5 = (Entry)var7.next(); this.field_74098_c.add("S " + (String)var5.getKey()); this.field_74096_d.add(this.field_73886_k.func_78269_a((String)var5.getValue(), this.field_73880_f - 220)); } } this.field_74102_o = new GuiSnooperList(this); }
protected void func_73875_a(GuiButton p_73875_1_) { if(p_73875_1_.field_73742_g) { if(p_73875_1_.field_73741_f == 2) { this.field_74097_b.func_74303_b(); this.field_74097_b.func_74303_b(); this.field_73882_e.func_71373_a(this.field_74100_a); } if(p_73875_1_.field_73741_f == 1) { this.field_74097_b.func_74306_a(EnumOptions.SNOOPER_ENABLED, 1); this.field_74099_p.field_73744_e = this.field_74097_b.func_74297_c(EnumOptions.SNOOPER_ENABLED); } } }
public void func_73866_w_() { int var1 = 0; this.field_74054_a = I18n.func_135053_a("options.title"); EnumOptions[] var2 = field_74052_b; int var3 = var2.length; for(int var4 = 0; var4 < var3; ++var4) { EnumOptions var5 = var2[var4]; if(var5.func_74380_a()) { this.field_73887_h.add(new GuiSlider(var5.func_74381_c(), this.field_73880_f / 2 - 155 + var1 % 2 * 160, this.field_73881_g / 6 - 12 + 24 * (var1 >> 1), var5, this.field_74051_d.func_74297_c(var5), this.field_74051_d.func_74296_a(var5))); } else { GuiSmallButton var6 = new GuiSmallButton(var5.func_74381_c(), this.field_73880_f / 2 - 155 + var1 % 2 * 160, this.field_73881_g / 6 - 12 + 24 * (var1 >> 1), var5, this.field_74051_d.func_74297_c(var5)); if(var5 == EnumOptions.DIFFICULTY && this.field_73882_e.field_71441_e != null && this.field_73882_e.field_71441_e.func_72912_H().func_76093_s()) { var6.field_73742_g = false; var6.field_73744_e = I18n.func_135053_a("options.difficulty") + ": " + I18n.func_135053_a("options.difficulty.hardcore"); } this.field_73887_h.add(var6); } ++var1; } this.field_73887_h.add(new GuiButton(101, this.field_73880_f / 2 - 152, this.field_73881_g / 6 + 96 - 6, 150, 20, I18n.func_135053_a("options.video"))); this.field_73887_h.add(new GuiButton(100, this.field_73880_f / 2 + 2, this.field_73881_g / 6 + 96 - 6, 150, 20, I18n.func_135053_a("options.controls"))); this.field_73887_h.add(new GuiButton(102, this.field_73880_f / 2 - 152, this.field_73881_g / 6 + 120 - 6, 150, 20, I18n.func_135053_a("options.language"))); this.field_73887_h.add(new GuiButton(103, this.field_73880_f / 2 + 2, this.field_73881_g / 6 + 120 - 6, 150, 20, I18n.func_135053_a("options.multiplayer.title"))); this.field_73887_h.add(new GuiButton(105, this.field_73880_f / 2 - 152, this.field_73881_g / 6 + 144 - 6, 150, 20, I18n.func_135053_a("options.resourcepack"))); this.field_73887_h.add(new GuiButton(104, this.field_73880_f / 2 + 2, this.field_73881_g / 6 + 144 - 6, 150, 20, I18n.func_135053_a("options.snooper.view"))); this.field_73887_h.add(new GuiButton(200, this.field_73880_f / 2 - 100, this.field_73881_g / 6 + 168, I18n.func_135053_a("gui.done"))); }
public void func_73866_w_() { this.field_74107_a = I18n.func_135053_a("options.videoTitle"); this.field_73887_h.clear(); this.field_73887_h.add(new GuiButton(200, this.field_73880_f / 2 - 100, this.field_73881_g / 6 + 168, I18n.func_135053_a("gui.done"))); this.field_74104_d = false; String[] var1 = new String[]{"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; String[] var2 = var1; int var3 = var1.length; for(int var4 = 0; var4 < var3; ++var4) { String var5 = var2[var4]; String var6 = System.getProperty(var5); if(var6 != null && var6.contains("64")) { this.field_74104_d = true; break; } } int var8 = 0; var3 = this.field_74104_d?0:-15; EnumOptions[] var9 = field_74108_m; int var10 = var9.length; for(int var11 = 0; var11 < var10; ++var11) { EnumOptions var7 = var9[var11]; if(var7.func_74380_a()) { this.field_73887_h.add(new GuiSlider(var7.func_74381_c(), this.field_73880_f / 2 - 155 + var8 % 2 * 160, this.field_73881_g / 7 + var3 + 24 * (var8 >> 1), var7, this.field_74106_c.func_74297_c(var7), this.field_74106_c.func_74296_a(var7))); } else { this.field_73887_h.add(new GuiSmallButton(var7.func_74381_c(), this.field_73880_f / 2 - 155 + var8 % 2 * 160, this.field_73881_g / 7 + var3 + 24 * (var8 >> 1), var7, this.field_74106_c.func_74297_c(var7))); } ++var8; } }
protected void func_73875_a(GuiButton p_73875_1_) { if(p_73875_1_.field_73742_g) { if(p_73875_1_.field_73741_f < 100 && p_73875_1_ instanceof GuiSmallButton) { this.field_73890_c.func_74306_a(((GuiSmallButton)p_73875_1_).func_73753_a(), 1); p_73875_1_.field_73744_e = this.field_73890_c.func_74297_c(EnumOptions.func_74379_a(p_73875_1_.field_73741_f)); } if(p_73875_1_.field_73741_f == 200) { this.field_73882_e.field_71474_y.func_74303_b(); this.field_73882_e.func_71373_a(this.field_73889_b); } } }
/** * Adds the buttons (and other controls) to the screen in question. */ public void initGui() { int i = 0; this.screenTitle = I18n.getString("options.title"); EnumOptions[] aenumoptions = relevantOptions; int j = aenumoptions.length; for (int k = 0; k < j; ++k) { EnumOptions enumoptions = aenumoptions[k]; if (enumoptions.getEnumFloat()) { this.buttonList.add(new GuiSlider(enumoptions.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), enumoptions, this.options.getKeyBinding(enumoptions), this.options.getOptionFloatValue(enumoptions))); } else { GuiSmallButton guismallbutton = new GuiSmallButton(enumoptions.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 - 12 + 24 * (i >> 1), enumoptions, this.options.getKeyBinding(enumoptions)); if (enumoptions == EnumOptions.DIFFICULTY && this.mc.theWorld != null && this.mc.theWorld.getWorldInfo().isHardcoreModeEnabled()) { guismallbutton.enabled = false; guismallbutton.displayString = I18n.getString("options.difficulty") + ": " + I18n.getString("options.difficulty.hardcore"); } this.buttonList.add(guismallbutton); } ++i; } this.buttonList.add(new GuiButton(101, this.width / 2 - 152, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.video"))); this.buttonList.add(new GuiButton(100, this.width / 2 + 2, this.height / 6 + 96 - 6, 150, 20, I18n.getString("options.controls"))); this.buttonList.add(new GuiButton(102, this.width / 2 - 152, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.language"))); this.buttonList.add(new GuiButton(103, this.width / 2 + 2, this.height / 6 + 120 - 6, 150, 20, I18n.getString("options.multiplayer.title"))); this.buttonList.add(new GuiButton(105, this.width / 2 - 152, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.resourcepack"))); this.buttonList.add(new GuiButton(104, this.width / 2 + 2, this.height / 6 + 144 - 6, 150, 20, I18n.getString("options.snooper.view"))); this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); }
/** * Fired when a control is clicked. This is the equivalent of ActionListener.actionPerformed(ActionEvent e). */ protected void actionPerformed(GuiButton par1GuiButton) { if (par1GuiButton.enabled) { int i = this.guiGameSettings.guiScale; if (par1GuiButton.id < 100 && par1GuiButton instanceof GuiSmallButton) { this.guiGameSettings.setOptionValue(((GuiSmallButton)par1GuiButton).returnEnumOptions(), 1); par1GuiButton.displayString = this.guiGameSettings.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); } if (par1GuiButton.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.parentGuiScreen); } if (this.guiGameSettings.guiScale != i) { ScaledResolution scaledresolution = new ScaledResolution(this.mc.gameSettings, this.mc.displayWidth, this.mc.displayHeight); int j = scaledresolution.getScaledWidth(); int k = scaledresolution.getScaledHeight(); this.setWorldAndResolution(this.mc, j, k); } } }
public void func_74304_a(EnumOptions p_74304_1_, float p_74304_2_) { if(p_74304_1_ == EnumOptions.MUSIC) { this.field_74342_a = p_74304_2_; this.field_74317_L.field_71416_A.func_77367_a(); } if(p_74304_1_ == EnumOptions.SOUND) { this.field_74340_b = p_74304_2_; this.field_74317_L.field_71416_A.func_77367_a(); } if(p_74304_1_ == EnumOptions.SENSITIVITY) { this.field_74341_c = p_74304_2_; } if(p_74304_1_ == EnumOptions.FOV) { this.field_74334_X = p_74304_2_; } if(p_74304_1_ == EnumOptions.GAMMA) { this.field_74333_Y = p_74304_2_; } if(p_74304_1_ == EnumOptions.CHAT_OPACITY) { this.field_74357_r = p_74304_2_; this.field_74317_L.field_71456_v.func_73827_b().func_96132_b(); } if(p_74304_1_ == EnumOptions.CHAT_HEIGHT_FOCUSED) { this.field_96694_H = p_74304_2_; this.field_74317_L.field_71456_v.func_73827_b().func_96132_b(); } if(p_74304_1_ == EnumOptions.CHAT_HEIGHT_UNFOCUSED) { this.field_96693_G = p_74304_2_; this.field_74317_L.field_71456_v.func_73827_b().func_96132_b(); } if(p_74304_1_ == EnumOptions.CHAT_WIDTH) { this.field_96692_F = p_74304_2_; this.field_74317_L.field_71456_v.func_73827_b().func_96132_b(); } if(p_74304_1_ == EnumOptions.CHAT_SCALE) { this.field_96691_E = p_74304_2_; this.field_74317_L.field_71456_v.func_73827_b().func_96132_b(); } }
public float func_74296_a(EnumOptions p_74296_1_) { return p_74296_1_ == EnumOptions.FOV?this.field_74334_X:(p_74296_1_ == EnumOptions.GAMMA?this.field_74333_Y:(p_74296_1_ == EnumOptions.MUSIC?this.field_74342_a:(p_74296_1_ == EnumOptions.SOUND?this.field_74340_b:(p_74296_1_ == EnumOptions.SENSITIVITY?this.field_74341_c:(p_74296_1_ == EnumOptions.CHAT_OPACITY?this.field_74357_r:(p_74296_1_ == EnumOptions.CHAT_HEIGHT_FOCUSED?this.field_96694_H:(p_74296_1_ == EnumOptions.CHAT_HEIGHT_UNFOCUSED?this.field_96693_G:(p_74296_1_ == EnumOptions.CHAT_SCALE?this.field_96691_E:(p_74296_1_ == EnumOptions.CHAT_WIDTH?this.field_96692_F:0.0F))))))))); }
protected void func_73875_a(GuiButton p_73875_1_) { if(p_73875_1_.field_73742_g) { if(p_73875_1_.field_73741_f < 100 && p_73875_1_ instanceof GuiSmallButton) { this.field_74051_d.func_74306_a(((GuiSmallButton)p_73875_1_).func_73753_a(), 1); p_73875_1_.field_73744_e = this.field_74051_d.func_74297_c(EnumOptions.func_74379_a(p_73875_1_.field_73741_f)); } if(p_73875_1_.field_73741_f == 101) { this.field_73882_e.field_71474_y.func_74303_b(); this.field_73882_e.func_71373_a(new GuiVideoSettings(this, this.field_74051_d)); } if(p_73875_1_.field_73741_f == 100) { this.field_73882_e.field_71474_y.func_74303_b(); this.field_73882_e.func_71373_a(new GuiControls(this, this.field_74051_d)); } if(p_73875_1_.field_73741_f == 102) { this.field_73882_e.field_71474_y.func_74303_b(); this.field_73882_e.func_71373_a(new GuiLanguage(this, this.field_74051_d, this.field_73882_e.func_135016_M())); } if(p_73875_1_.field_73741_f == 103) { this.field_73882_e.field_71474_y.func_74303_b(); this.field_73882_e.func_71373_a(new ScreenChatOptions(this, this.field_74051_d)); } if(p_73875_1_.field_73741_f == 104) { this.field_73882_e.field_71474_y.func_74303_b(); this.field_73882_e.func_71373_a(new GuiSnooper(this, this.field_74051_d)); } if(p_73875_1_.field_73741_f == 200) { this.field_73882_e.field_71474_y.func_74303_b(); this.field_73882_e.func_71373_a(this.field_74053_c); } if(p_73875_1_.field_73741_f == 105) { this.field_73882_e.field_71474_y.func_74303_b(); this.field_73882_e.func_71373_a(new GuiScreenTemporaryResourcePackSelect(this, this.field_74051_d)); } } }
public GuiSmallButton(int p_i1057_1_, int p_i1057_2_, int p_i1057_3_, String p_i1057_4_) { this(p_i1057_1_, p_i1057_2_, p_i1057_3_, (EnumOptions)null, p_i1057_4_); }
public GuiSmallButton(int p_i1059_1_, int p_i1059_2_, int p_i1059_3_, EnumOptions p_i1059_4_, String p_i1059_5_) { super(p_i1059_1_, p_i1059_2_, p_i1059_3_, 150, 20, p_i1059_5_); this.field_73754_j = p_i1059_4_; }
public EnumOptions func_73753_a() { return this.field_73754_j; }
public void func_73866_w_() { int var1 = 0; this.field_73888_d = I18n.func_135053_a("options.chat.title"); this.field_82268_n = I18n.func_135053_a("options.multiplayer.title"); EnumOptions[] var2 = field_73891_a; int var3 = var2.length; int var4; EnumOptions var5; for(var4 = 0; var4 < var3; ++var4) { var5 = var2[var4]; if(var5.func_74380_a()) { this.field_73887_h.add(new GuiSlider(var5.func_74381_c(), this.field_73880_f / 2 - 155 + var1 % 2 * 160, this.field_73881_g / 6 + 24 * (var1 >> 1), var5, this.field_73890_c.func_74297_c(var5), this.field_73890_c.func_74296_a(var5))); } else { this.field_73887_h.add(new GuiSmallButton(var5.func_74381_c(), this.field_73880_f / 2 - 155 + var1 % 2 * 160, this.field_73881_g / 6 + 24 * (var1 >> 1), var5, this.field_73890_c.func_74297_c(var5))); } ++var1; } if(var1 % 2 == 1) { ++var1; } this.field_82269_o = this.field_73881_g / 6 + 24 * (var1 >> 1); var1 += 2; var2 = field_82267_b; var3 = var2.length; for(var4 = 0; var4 < var3; ++var4) { var5 = var2[var4]; if(var5.func_74380_a()) { this.field_73887_h.add(new GuiSlider(var5.func_74381_c(), this.field_73880_f / 2 - 155 + var1 % 2 * 160, this.field_73881_g / 6 + 24 * (var1 >> 1), var5, this.field_73890_c.func_74297_c(var5), this.field_73890_c.func_74296_a(var5))); } else { this.field_73887_h.add(new GuiSmallButton(var5.func_74381_c(), this.field_73880_f / 2 - 155 + var1 % 2 * 160, this.field_73881_g / 6 + 24 * (var1 >> 1), var5, this.field_73890_c.func_74297_c(var5))); } ++var1; } this.field_73887_h.add(new GuiButton(200, this.field_73880_f / 2 - 100, this.field_73881_g / 6 + 168, I18n.func_135053_a("gui.done"))); }
public GuiSlider(int p_i1056_1_, int p_i1056_2_, int p_i1056_3_, EnumOptions p_i1056_4_, String p_i1056_5_, float p_i1056_6_) { super(p_i1056_1_, p_i1056_2_, p_i1056_3_, 150, 20, p_i1056_5_); this.field_73750_l = p_i1056_4_; this.field_73751_j = p_i1056_6_; }
public static EnumOptions addOptions(String name, String langName, boolean isSlider, boolean isToggle) { return addEnum(EnumOptions.class, name, langName, isSlider, isToggle); }
/** * Adds the buttons (and other controls) to the screen in question. */ public void initGui() { this.snooperTitle = I18n.getString("options.snooper.title"); String s = I18n.getString("options.snooper.desc"); ArrayList arraylist = new ArrayList(); Iterator iterator = this.fontRenderer.listFormattedStringToWidth(s, this.width - 30).iterator(); while (iterator.hasNext()) { String s1 = (String)iterator.next(); arraylist.add(s1); } this.field_74101_n = (String[])arraylist.toArray(new String[0]); this.field_74098_c.clear(); this.field_74096_d.clear(); this.buttonList.add(this.buttonAllowSnooping = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.snooperGameSettings.getKeyBinding(EnumOptions.SNOOPER_ENABLED))); this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.getString("gui.done"))); boolean flag = this.mc.getIntegratedServer() != null && this.mc.getIntegratedServer().getPlayerUsageSnooper() != null; Iterator iterator1 = (new TreeMap(this.mc.getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); Entry entry; while (iterator1.hasNext()) { entry = (Entry)iterator1.next(); this.field_74098_c.add((flag ? "C " : "") + (String)entry.getKey()); this.field_74096_d.add(this.fontRenderer.trimStringToWidth((String)entry.getValue(), this.width - 220)); } if (flag) { iterator1 = (new TreeMap(this.mc.getIntegratedServer().getPlayerUsageSnooper().getCurrentStats())).entrySet().iterator(); while (iterator1.hasNext()) { entry = (Entry)iterator1.next(); this.field_74098_c.add("S " + (String)entry.getKey()); this.field_74096_d.add(this.fontRenderer.trimStringToWidth((String)entry.getValue(), this.width - 220)); } } this.snooperList = new GuiSnooperList(this); }
/** * 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.options.setOptionValue(((GuiSmallButton)par1GuiButton).returnEnumOptions(), 1); par1GuiButton.displayString = this.options.getKeyBinding(EnumOptions.getEnumOptions(par1GuiButton.id)); } if (par1GuiButton.id == 101) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(new GuiVideoSettings(this, this.options)); } if (par1GuiButton.id == 100) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(new GuiControls(this, this.options)); } if (par1GuiButton.id == 102) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(new GuiLanguage(this, this.options, this.mc.getLanguageManager())); } if (par1GuiButton.id == 103) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(new ScreenChatOptions(this, this.options)); } if (par1GuiButton.id == 104) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(new GuiSnooper(this, this.options)); } if (par1GuiButton.id == 200) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(this.parentScreen); } if (par1GuiButton.id == 105) { this.mc.gameSettings.saveOptions(); this.mc.displayGuiScreen(new GuiScreenTemporaryResourcePackSelect(this, this.options)); } } }
public GuiSmallButton(int par1, int par2, int par3, String par4Str) { this(par1, par2, par3, (EnumOptions)null, par4Str); }
public GuiSmallButton(int par1, int par2, int par3, EnumOptions par4EnumOptions, String par5Str) { super(par1, par2, par3, 150, 20, par5Str); this.enumOptions = par4EnumOptions; }
public EnumOptions returnEnumOptions() { return this.enumOptions; }
/** * Adds the buttons (and other controls) to the screen in question. */ public void initGui() { this.screenTitle = I18n.getString("options.videoTitle"); this.buttonList.clear(); this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); this.is64bit = false; String[] astring = new String[] {"sun.arch.data.model", "com.ibm.vm.bitmode", "os.arch"}; String[] astring1 = astring; int i = astring.length; for (int j = 0; j < i; ++j) { String s = astring1[j]; String s1 = System.getProperty(s); if (s1 != null && s1.contains("64")) { this.is64bit = true; break; } } int k = 0; i = this.is64bit ? 0 : -15; EnumOptions[] aenumoptions = videoOptions; int l = aenumoptions.length; for (int i1 = 0; i1 < l; ++i1) { EnumOptions enumoptions = aenumoptions[i1]; if (enumoptions.getEnumFloat()) { this.buttonList.add(new GuiSlider(enumoptions.returnEnumOrdinal(), this.width / 2 - 155 + k % 2 * 160, this.height / 7 + i + 24 * (k >> 1), enumoptions, this.guiGameSettings.getKeyBinding(enumoptions), this.guiGameSettings.getOptionFloatValue(enumoptions))); } else { this.buttonList.add(new GuiSmallButton(enumoptions.returnEnumOrdinal(), this.width / 2 - 155 + k % 2 * 160, this.height / 7 + i + 24 * (k >> 1), enumoptions, this.guiGameSettings.getKeyBinding(enumoptions))); } ++k; } }
/** * Adds the buttons (and other controls) to the screen in question. */ public void initGui() { int i = 0; this.theChatOptions = I18n.getString("options.chat.title"); this.field_82268_n = I18n.getString("options.multiplayer.title"); EnumOptions[] aenumoptions = allScreenChatOptions; int j = aenumoptions.length; int k; EnumOptions enumoptions; for (k = 0; k < j; ++k) { enumoptions = aenumoptions[k]; if (enumoptions.getEnumFloat()) { this.buttonList.add(new GuiSlider(enumoptions.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), enumoptions, this.theSettings.getKeyBinding(enumoptions), this.theSettings.getOptionFloatValue(enumoptions))); } else { this.buttonList.add(new GuiSmallButton(enumoptions.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), enumoptions, this.theSettings.getKeyBinding(enumoptions))); } ++i; } if (i % 2 == 1) { ++i; } this.field_82269_o = this.height / 6 + 24 * (i >> 1); i += 2; aenumoptions = allMultiplayerOptions; j = aenumoptions.length; for (k = 0; k < j; ++k) { enumoptions = aenumoptions[k]; if (enumoptions.getEnumFloat()) { this.buttonList.add(new GuiSlider(enumoptions.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), enumoptions, this.theSettings.getKeyBinding(enumoptions), this.theSettings.getOptionFloatValue(enumoptions))); } else { this.buttonList.add(new GuiSmallButton(enumoptions.returnEnumOrdinal(), this.width / 2 - 155 + i % 2 * 160, this.height / 6 + 24 * (i >> 1), enumoptions, this.theSettings.getKeyBinding(enumoptions))); } ++i; } this.buttonList.add(new GuiButton(200, this.width / 2 - 100, this.height / 6 + 168, I18n.getString("gui.done"))); }
public GuiSlider(int par1, int par2, int par3, EnumOptions par4EnumOptions, String par5Str, float par6) { super(par1, par2, par3, 150, 20, par5Str); this.idFloat = par4EnumOptions; this.sliderValue = par6; }