aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
authorWyvest <45589059+Wyvest@users.noreply.github.com>2022-05-27 21:53:17 +0700
committerWyvest <45589059+Wyvest@users.noreply.github.com>2022-05-27 21:53:17 +0700
commit606543003a9d205b9c0b6f3c7c2c7dafef5770a4 (patch)
tree9e1aa0ab2c987dc417073072ea1bcb261d502084 /src/main/java
parent3430c2f03e1996ddb8e029f6f577af8c2a4a80aa (diff)
downloadOneConfig-606543003a9d205b9c0b6f3c7c2c7dafef5770a4.tar.gz
OneConfig-606543003a9d205b9c0b6f3c7c2c7dafef5770a4.tar.bz2
OneConfig-606543003a9d205b9c0b6f3c7c2c7dafef5770a4.zip
fix vigilance buttons + fix ukeyboard
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);