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

Method initGui

src/main/java/net/optifine/shaders/gui/GuiShaders.java:50–83  ·  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

48 * window resizes, the buttonList is cleared beforehand.
49 */
50 public void initGui()
51 {
52 this.screenTitle = I18n.format("of.options.shadersTitle", new Object[0]);
53
54 if (Shaders.shadersConfig == null)
55 {
56 Shaders.loadConfig();
57 }
58
59 int i = 120;
60 int j = 20;
61 int k = this.width - i - 10;
62 int l = 30;
63 int i1 = 20;
64 int j1 = this.width - i - 20;
65 this.shaderList = new GuiSlotShaders(this, j1, this.height, l, this.height - 50, 16);
66 this.shaderList.registerScrollButtons(7, 8);
67 this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.ANTIALIASING, k, 0 * i1 + l, i, j));
68 this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.NORMAL_MAP, k, 1 * i1 + l, i, j));
69 this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.SPECULAR_MAP, k, 2 * i1 + l, i, j));
70 this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.RENDER_RES_MUL, k, 3 * i1 + l, i, j));
71 this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.SHADOW_RES_MUL, k, 4 * i1 + l, i, j));
72 this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.HAND_DEPTH_MUL, k, 5 * i1 + l, i, j));
73 this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.OLD_HAND_LIGHT, k, 6 * i1 + l, i, j));
74 this.buttonList.add(new GuiButtonEnumShaderOption(EnumShaderOption.OLD_LIGHTING, k, 7 * i1 + l, i, j));
75 int k1 = Math.min(150, j1 / 2 - 10);
76 int l1 = j1 / 4 - k1 / 2;
77 int i2 = this.height - 25;
78 this.buttonList.add(new GuiButton(201, l1, i2, k1 - 22 + 1, j, Lang.get("of.options.shaders.shadersFolder")));
79 this.buttonList.add(new GuiButtonDownloadShaders(210, l1 + k1 - 22 - 1, i2));
80 this.buttonList.add(new GuiButton(202, j1 / 4 * 3 - k1 / 2, this.height - 25, k1, j, I18n.format("gui.done", new Object[0])));
81 this.buttonList.add(new GuiButton(203, k, this.height - 25, i, j, Lang.get("of.options.shaders.shaderOptions")));
82 this.updateButtons();
83 }
84
85 public void updateButtons()
86 {

Callers

nothing calls this directly

Calls 6

formatMethod · 0.95
loadConfigMethod · 0.95
getMethod · 0.95
updateButtonsMethod · 0.95
registerScrollButtonsMethod · 0.80
addMethod · 0.45

Tested by

no test coverage detected