MCPcopy Create free account
hub / github.com/DGVPSH/SlackOpen / initGui

Method initGui

src/main/java/net/minecraft/client/gui/GuiSnooper.java:33–64  ·  view source on GitHub ↗

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.

()

Source from the content-addressed store, hash-verified

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.

Callers

nothing calls this directly

Calls 15

formatMethod · 0.95
addAllMethod · 0.80
getKeyBindingMethod · 0.80
getIntegratedServerMethod · 0.80
entrySetMethod · 0.80
getCurrentStatsMethod · 0.80
trimStringToWidthMethod · 0.80
clearMethod · 0.65
getValueMethod · 0.65
toArrayMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected