MCPcopy Create free account
hub / github.com/5zig/The-5zig-Mod / initGui

Method initGui

The 5zig Mod/src/eu/the5zig/mod/gui/GuiModules.java:31–69  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

29 }
30
31 @Override
32 public void initGui() {
33 addBottomDoneButton();
34
35 guiList = The5zigMod.getVars().createGuiList(this, getWidth(), getHeight(), 50, getHeight() - 32 - 48, getWidth() / 2 - 180, getWidth() / 2 - 10,
36 The5zigMod.getModuleMaster().getModules());
37 guiList.setRowWidth(160);
38 guiList.setLeftbound(true);
39 guiList.setScrollX(getWidth() / 2 - 15);
40 guiList.setSelectedId(lastSelected);
41 guiList.setHeaderPadding(The5zigMod.getVars().getFontHeight());
42 guiList.setHeader(I18n.translate("modules.list.title"));
43 addGuiList(guiList);
44
45 IGuiList modulePreviewList = The5zigMod.getVars().createGuiList(null, getWidth(), getHeight(), 50, getHeight() - 50 - 48, getWidth() / 2 + 10, getWidth() / 2 + 180,
46 Collections.singletonList(previewRow = new StaticModulePreviewRow(guiList.getSelectedRow(), getWidth() / 2 + 10, 51, 170, getHeight() - 150)));
47 modulePreviewList.setLeftbound(true);
48 modulePreviewList.setDrawSelection(false);
49 modulePreviewList.setScrollX(getWidth() / 2 + 175);
50 addGuiList(modulePreviewList);
51
52
53 String helpText = I18n.translate("modules.help");
54 addButton(The5zigMod.getVars().createStringButton(99, getWidth() / 2 - 180, 30,
55 The5zigMod.getVars().getStringWidth(ChatColor.ITALIC.toString() + ChatColor.UNDERLINE.toString() + helpText), 10,
56 ChatColor.ITALIC.toString() + ChatColor.UNDERLINE.toString() + helpText));
57 String resetText = I18n.translate("modules.reset");
58 addButton(The5zigMod.getVars()
59 .createStringButton(98, getWidth() / 2 + 180 - The5zigMod.getVars().getStringWidth(resetText), 30, The5zigMod.getVars().getStringWidth(resetText), 10, resetText));
60
61 addButton(The5zigMod.getVars().createButton(1, getWidth() / 2 - 180, getHeight() - 48 - 20, 145, 20, I18n.translate("modules.add")));
62 addButton(The5zigMod.getVars().createButton(2, getWidth() / 2 - 30, getHeight() - 48 - 20, 20, 20, "-"));
63 addButton(The5zigMod.getVars().createButton(5, getWidth() / 2 + 10, getHeight() - 48 - 44, 80, 20, I18n.translate("modules.settings")));
64 addButton(The5zigMod.getVars().createButton(6, getWidth() / 2 + 100, getHeight() - 48 - 44, 80, 20, I18n.translate("modules.enable")));
65 addButton(The5zigMod.getVars().createButton(10, getWidth() / 2 + 10, getHeight() - 48 - 20, 80, 20, I18n.translate("modules.move_up")));
66 addButton(The5zigMod.getVars().createButton(11, getWidth() / 2 + 100, getHeight() - 48 - 20, 80, 20, I18n.translate("modules.move_down")));
67
68 closeHelpButton = The5zigMod.getVars().createButton(50, getWidth() / 2 - 75, (getHeight() - 200) / 2 + 135, 150, 20, The5zigMod.getVars().translate("gui.done"));
69 }
70
71 @Override
72 protected void actionPerformed(IButton button) {

Callers

nothing calls this directly

Calls 15

getVarsMethod · 0.95
getModuleMasterMethod · 0.95
setLeftboundMethod · 0.95
setScrollXMethod · 0.95
translateMethod · 0.95
setDrawSelectionMethod · 0.95
addBottomDoneButtonMethod · 0.80
getModulesMethod · 0.80
addGuiListMethod · 0.80
addButtonMethod · 0.80
createGuiListMethod · 0.65
getWidthMethod · 0.65

Tested by

no test coverage detected