-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAimgModGiu.java
More file actions
113 lines (92 loc) · 4.19 KB
/
AimgModGiu.java
File metadata and controls
113 lines (92 loc) · 4.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
package com.example.aimmod;
import net.minecraft.client.gui.GuiButton;
import net.minecraft.client.gui.GuiScreen;
import net.minecraft.client.gui.GuiTextField;
import org.lwjgl.input.Keyboard;
import java.io.IOException;
public class AimModGui extends GuiScreen {
private final AimMod mod;
private GuiButton toggleButton;
private GuiTextField blockInput;
private GuiButton addExcludeButton;
private GuiButton addPriorityButton;
private GuiButton closeButton;
private GuiButton breakingButton;
private String targetedBlockName;
public AimModGui(AimMod mod) {
this.mod = mod;
}
@Override
public void func_73866_w_() {
this.field_146292_n.clear();
int buttonWidth = 200;
int buttonHeight = 20;
int spacing = 4;
int centerX = this.field_146294_l / 2 - buttonWidth / 2;
int startY = this.field_146295_m / 4;
this.toggleButton = new GuiButton(0, centerX, startY, buttonWidth, buttonHeight, "Toggle AimMod: " + (mod.isEnabled() ? "ON" : "OFF"));
this.field_146292_n.add(this.toggleButton);
this.blockInput = new GuiTextField(1, this.field_146289_q, centerX, startY + buttonHeight + spacing, buttonWidth, buttonHeight);
this.blockInput.func_146195_b(true);
this.blockInput.func_146203_f(50);
this.addExcludeButton = new GuiButton(2, centerX, startY + (buttonHeight + spacing) * 2, buttonWidth, buttonHeight, "Add/Remove Block from Exclusion");
this.field_146292_n.add(this.addExcludeButton);
this.addPriorityButton = new GuiButton(3, centerX, startY + (buttonHeight + spacing) * 3, buttonWidth, buttonHeight, "Add/Remove Block from Priority");
this.field_146292_n.add(this.addPriorityButton);
this.breakingButton = new GuiButton(5, centerX, startY + (buttonHeight + spacing) * 4, buttonWidth, buttonHeight, "Auto-breaking: " + (mod.isBreakingEnabled() ? "ON" : "OFF"));
this.field_146292_n.add(this.breakingButton);
this.closeButton = new GuiButton(4, centerX, startY + (buttonHeight + spacing) * 5, buttonWidth, buttonHeight, "Close");
this.field_146292_n.add(this.closeButton);
this.targetedBlockName = mod.getTargetedBlockName();
}
@Override
protected void func_146284_a(GuiButton button) throws IOException {
switch (button.field_146127_k) {
case 0:
mod.toggleMod();
this.toggleButton.field_146126_j = "Toggle AimMod: " + (mod.isEnabled() ? "ON" : "OFF");
break;
case 2:
mod.toggleBlock(blockInput.func_146179_b());
break;
case 3:
mod.togglePriorityBlock(blockInput.func_146179_b());
break;
case 4:
this.field_146297_k.func_147108_a(null);
break;
case 5:
mod.toggleBreaking();
this.breakingButton.field_146126_j = "Auto-breaking: " + (mod.isBreakingEnabled() ? "ON" : "OFF");
break;
}
}
@Override
protected void func_73869_a(char typedChar, int keyCode) throws IOException {
super.func_73869_a(typedChar, keyCode);
this.blockInput.func_146201_a(typedChar, keyCode);
}
@Override
protected void func_73864_a(int mouseX, int mouseY, int mouseButton) throws IOException {
super.func_73864_a(mouseX, mouseY, mouseButton);
this.blockInput.func_146192_a(mouseX, mouseY, mouseButton);
}
@Override
public void func_73876_c() {
super.func_73876_c();
this.blockInput.func_146178_a();
this.targetedBlockName = mod.getTargetedBlockName();
}
@Override
public void func_73863_a(int mouseX, int mouseY, float partialTicks) {
this.func_146276_q_();
this.func_73732_a(this.field_146289_q, "AimMod Settings", this.field_146294_l / 2, 10, 0xFFFFFF);
this.func_73731_b(this.field_146289_q, "Targeted Block: " + targetedBlockName, 10, this.field_146295_m - 20, 0xFFFFFF);
this.blockInput.func_146194_f();
super.func_73863_a(mouseX, mouseY, partialTicks);
}
@Override
public boolean func_73868_f() {
return false;
}
}