mirror of
https://github.com/xiaozhou233/OrangeX-Client.git
synced 2026-12-05 13:05:52 +08:00
[Perf] KeyBinding button
This commit is contained in:
1 parent
0c3af1e5ab
commit
ee3b3fee41
6 files changed
+11
-6
No files matched your search
@@ -27,6 +27,8 @@ public abstract class Module {
|
||||
public Module(String name, ModuleCategory category) {
|
||||
this.name = name;
|
||||
this.category = category;
|
||||
|
||||
addValue(keyBind);
|
||||
}
|
||||
|
||||
public Module(String name, ModuleCategory category, int defaultKey) {
|
||||
|
||||
@@ -36,8 +36,6 @@ public class AutoClicker extends Module {
|
||||
addValue(cps);
|
||||
addValue(jitter);
|
||||
addValue(ignoreBlock);
|
||||
|
||||
addValue(keyBind);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -33,7 +33,6 @@ public class Test extends Module{
|
||||
// Number Examples
|
||||
addValue(new NumberValue("Example Number", "Example", 0.0, 0, 100, 0.1));
|
||||
|
||||
addValue(keyBind);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -11,7 +11,6 @@ public class ClickGUI extends Module {
|
||||
super("ClickGUI", ModuleCategory.RENDER);
|
||||
keyBind.setKey(Keyboard.KEY_RSHIFT);
|
||||
|
||||
addValue(keyBind);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -31,7 +31,6 @@ public class HUD extends Module {
|
||||
// TODO: Remove this when config is implemented
|
||||
setEnabled(true);
|
||||
|
||||
addValue(keyBind);
|
||||
}
|
||||
|
||||
@Subscribe
|
||||
|
||||
@@ -41,6 +41,8 @@ public class ClickGuiScreen extends GuiScreen {
|
||||
for (Module module : OrangeX.getInstance().getModuleManager().getModulesByCategory(category)) {
|
||||
ModuleButton button = new ModuleButton(0, 0, panelWidth, module, panel);
|
||||
|
||||
KeybindValue toggleKeybinding = null;
|
||||
|
||||
for (Value<?> value : module.getValues()) {
|
||||
if (value instanceof BooleanValue) {
|
||||
button.addComponent(new BooleanComponent(0, 0, panelWidth, (BooleanValue) value, button));
|
||||
@@ -49,9 +51,15 @@ public class ClickGuiScreen extends GuiScreen {
|
||||
} else if (value instanceof ModeValue) {
|
||||
button.addComponent(new ModeComponent(0, 0, panelWidth, (ModeValue) value, button));
|
||||
} else if (value instanceof KeybindValue) {
|
||||
button.addComponent(new KeybindComponent(0, 0, panelWidth, (KeybindValue) value, button));
|
||||
if (value.getName().equals("Bind")) {
|
||||
toggleKeybinding = (KeybindValue) value;
|
||||
} else {
|
||||
button.addComponent(new KeybindComponent(0, 0, panelWidth, (KeybindValue) value, button));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (toggleKeybinding != null)
|
||||
button.addComponent(new KeybindComponent(0, 0, panelWidth, toggleKeybinding, button));
|
||||
|
||||
panel.addComponent(button);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user