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

Method initGui

The 5zig Mod/src/eu/the5zig/mod/gui/GuiProfile.java:40–88  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

38 }
39
40 @Override
41 public void initGui() {
42 addButton(The5zigMod.getVars().createButton(200, getWidth() / 2 - 100, getHeight() / 6 + 170, 200, 20, MinecraftFactory.getVars().translate("gui.done")));
43
44 rows.clear();
45 int maxWidth = getWidth() / 2 + 155 - (getWidth() / 2 - 155 + 16 + 88) - 10;
46 rows.add(new BasicRow(ChatColor.UNDERLINE + I18n.translate("profile.title"), maxWidth) {
47 @Override
48 public int getLineHeight() {
49 return 14;
50 }
51 });
52 rows.add(new BasicRow(String.format("%s%s: %s#%s", ChatColor.YELLOW, I18n.translate("profile.id"), ChatColor.RESET, The5zigMod.getDataManager().getProfile().getId()), maxWidth));
53 rows.add(new BasicRow(String.format("%s%s: %s", ChatColor.YELLOW, I18n.translate("profile.name"), The5zigMod.getDataManager().getColoredName()), maxWidth));
54 rows.add(new BasicRow(String.format("%s%s: %s", ChatColor.YELLOW, I18n.translate("profile.first_login_time"), ChatColor.RESET + Utils.convertToDate(
55 The5zigMod.getDataManager().getProfile().getFirstTime()).replace("Today", I18n.translate("profile.today")).replace("Yesterday", I18n.translate("profile.yesterday"))),
56 maxWidth));
57 rows.add(new BasicRow(String.format("%s%s: %s", ChatColor.YELLOW, I18n.translate("profile.cape"),
58 ChatColor.RESET + WordUtils.capitalize(The5zigMod.getDataManager().getProfile().getRank().toString().toLowerCase(Locale.ROOT))), maxWidth));
59 int x = getWidth() / 2 - 155 + 16 + 88 + The5zigMod.getVars().getStringWidth(ChatColor.YELLOW + I18n.translate("profile.message") + ":") + 10;
60 rows.add(new ButtonRow(
61 The5zigMod.getVars().createStringButton(9, x, 88 + 40, The5zigMod.getVars().getStringWidth(I18n.translate("profile.edit")) + 2, 9, I18n.translate("profile.edit")), null) {
62 @Override
63 public void draw(int x, int y) {
64 The5zigMod.getVars().drawString(ChatColor.YELLOW + I18n.translate("profile.message") + ":", x + 2, y + 2);
65 }
66
67 @Override
68 public int getLineHeight() {
69 return 12;
70 }
71 });
72
73 rows.add(new BasicRow(The5zigMod.getDataManager().getProfile().getProfileMessage(), maxWidth));
74
75 IGuiList statusMessage = The5zigMod.getVars().createGuiList(null, getWidth(), getHeight(), 40, 40 + 110, getWidth() / 2 - 155 + 16 + 88, getWidth() / 2 + 155, rows);
76 statusMessage.setBottomPadding(4);
77 statusMessage.setRowWidth(400);
78 statusMessage.setLeftbound(true);
79 statusMessage.setDrawSelection(false);
80 statusMessage.setScrollX(getWidth() / 2 + 155 - 5);
81 addGuiList(statusMessage);
82
83 addButton(The5zigMod.getVars().createButton(1, getWidth() / 2 - 155, getHeight() / 6 + 120, 150, 20, I18n.translate("profile.settings.view")));
84 addButton(The5zigMod.getVars().createButton(2, getWidth() / 2 + 5, getHeight() / 6 + 120, 150, 20, I18n.translate("chat.settings")));
85 addButton(The5zigMod.getVars().createButton(3, getWidth() / 2 - 155, getHeight() / 6 + 144, 150, 20, I18n.translate("profile.blocked_contacts")));
86 addButton(The5zigMod.getVars().createButton(4, getWidth() / 2 + 5, getHeight() / 6 + 144, 150, 20, I18n.translate("profile.show_statistics")));
87
88 }
89
90 @Override
91 protected void actionPerformed(IButton button) {

Callers

nothing calls this directly

Calls 15

getVarsMethod · 0.95
getVarsMethod · 0.95
translateMethod · 0.95
getDataManagerMethod · 0.95
convertToDateMethod · 0.95
setBottomPaddingMethod · 0.95
setRowWidthMethod · 0.95
setLeftboundMethod · 0.95
setDrawSelectionMethod · 0.95
setScrollXMethod · 0.95
addButtonMethod · 0.80
formatMethod · 0.80

Tested by

no test coverage detected