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.
()
| 31 | * window resizes, the buttonList is cleared beforehand. |
| 32 | */ |
| 33 | public void initGui() |
| 34 | { |
| 35 | this.field_146610_i = I18n.format("options.snooper.title"); |
| 36 | String s = I18n.format("options.snooper.desc"); |
| 37 | java.util.List<String> list = Lists.<String>newArrayList(); |
| 38 | |
| 39 | list.addAll(this.fontRendererObj.listFormattedStringToWidth(s, this.width - 30)); |
| 40 | |
| 41 | this.field_146607_r = list.toArray(new String[list.size()]); |
| 42 | this.field_146604_g.clear(); |
| 43 | this.field_146609_h.clear(); |
| 44 | this.buttonList.add(this.field_146605_t = new GuiButton(1, this.width / 2 - 152, this.height - 30, 150, 20, this.game_settings_2.getKeyBinding(GameSettings.Options.SNOOPER_ENABLED))); |
| 45 | this.buttonList.add(new GuiButton(2, this.width / 2 + 2, this.height - 30, 150, 20, I18n.format("gui.done"))); |
| 46 | boolean flag = this.mc.getIntegratedServer() != null && this.mc.getIntegratedServer().getPlayerUsageSnooper() != null; |
| 47 | |
| 48 | for (Entry<String, String> entry : (new TreeMap<String, String>(this.mc.getPlayerUsageSnooper().getCurrentStats())).entrySet()) |
| 49 | { |
| 50 | this.field_146604_g.add((flag ? "C " : "") + entry.getKey()); |
| 51 | this.field_146609_h.add(this.fontRendererObj.trimStringToWidth(entry.getValue(), this.width - 220)); |
| 52 | } |
| 53 | |
| 54 | if (flag) |
| 55 | { |
| 56 | for (Entry<String, String> entry1 : (new TreeMap<String, String>(this.mc.getIntegratedServer().getPlayerUsageSnooper().getCurrentStats())).entrySet()) |
| 57 | { |
| 58 | this.field_146604_g.add("S " + entry1.getKey()); |
| 59 | this.field_146609_h.add(this.fontRendererObj.trimStringToWidth(entry1.getValue(), this.width - 220)); |
| 60 | } |
| 61 | } |
| 62 | |
| 63 | this.field_146606_s = new GuiSnooper.List(); |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Handles mouse input. |
nothing calls this directly
no test coverage detected