aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilanceConfig.java2
-rw-r--r--src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java21
2 files changed, 9 insertions, 14 deletions
diff --git a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilanceConfig.java b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilanceConfig.java
index 0fbfa62..3115f3a 100644
--- a/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilanceConfig.java
+++ b/src/main/java/cc/polyfrost/oneconfig/config/compatibility/VigilanceConfig.java
@@ -91,7 +91,7 @@ public class VigilanceConfig extends Config {
options.add(new CompatConfigColorElement(getFieldOfProperty(option), option.getInstance(), getName(attributes), 2));
break;
case BUTTON:
- options.add(new ConfigButton(() -> ((CallablePropertyValue) option.getValue()).invoke(option.getInstance()), option.getInstance(), getName(attributes), 2, attributes.getPlaceholder()));
+ options.add(new ConfigButton(() -> ((CallablePropertyValue) option.getValue()).invoke(option.getInstance()), option.getInstance(), getName(attributes), 2, attributes.getPlaceholder().isEmpty() ? "Activate" : attributes.getPlaceholder()));
break;
}
if (attributes.getType() == PropertyType.SWITCH || attributes.getType() == PropertyType.CHECKBOX) {
diff --git a/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java b/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java
index e94ef44..72e8e58 100644
--- a/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java
+++ b/src/main/java/cc/polyfrost/oneconfig/gui/HudGui.java
@@ -305,19 +305,14 @@ public class HudGui extends UScreen {
if (editingHud != null) {
float x = editingHud.getXScaled(this.width);
float y = editingHud.getYScaled(this.height);
- switch (keyCode) {
- case UKeyboard.KEY_UP:
- setPosition(x, y - 1, false);
- break;
- case UKeyboard.KEY_DOWN:
- setPosition(x, y + 1, false);
- break;
- case UKeyboard.KEY_LEFT:
- setPosition(x - 1, y, false);
- break;
- case UKeyboard.KEY_RIGHT:
- setPosition(x + 1, y, false);
- break;
+ if (keyCode == UKeyboard.KEY_UP) {
+ setPosition(x, y - 1, false);
+ } else if (keyCode == UKeyboard.KEY_DOWN) {
+ setPosition(x, y + 1, false);
+ } else if (keyCode == UKeyboard.KEY_LEFT) {
+ setPosition(x - 1, y, false);
+ } else if (keyCode == UKeyboard.KEY_RIGHT) {
+ setPosition(x + 1, y, false);
}
}
super.onKeyPressed(keyCode, typedChar, modifiers);