From d9e92ff0ea082045a10c63ae951f9e5bab862f1e Mon Sep 17 00:00:00 2001 From: Sollace Date: Fri, 25 Sep 2020 13:06:41 +0200 Subject: [PATCH] Fixed key bindings not appearing in the settings screen and adjust the defaults for one-handed gameplay --- .../unicopia/client/KeyBindingsHandler.java | 10 ++++++---- .../unicopia/client/UnicopiaClient.java | 1 + .../resources/assets/unicopia/lang/en_us.json | 15 ++++----------- 3 files changed, 11 insertions(+), 15 deletions(-) diff --git a/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java b/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java index 1d3533c2..35d530c8 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java +++ b/src/main/java/com/minelittlepony/unicopia/client/KeyBindingsHandler.java @@ -19,15 +19,17 @@ public class KeyBindingsHandler { public static final KeyBindingsHandler INSTANCE = new KeyBindingsHandler(); + static void bootstrap() {} + private final Map keys = new HashMap<>(); private final Map reverse = new HashMap<>(); private final Set pressed = new HashSet<>(); public KeyBindingsHandler() { - addKeybind(GLFW.GLFW_KEY_O, AbilitySlot.PRIMARY); - addKeybind(GLFW.GLFW_KEY_P, AbilitySlot.SECONDARY); - addKeybind(GLFW.GLFW_KEY_L, AbilitySlot.TERTIARY); + addKeybind(GLFW.GLFW_KEY_R, AbilitySlot.PRIMARY); + addKeybind(GLFW.GLFW_KEY_F, AbilitySlot.SECONDARY); + addKeybind(GLFW.GLFW_KEY_C, AbilitySlot.TERTIARY); } public KeyBinding getBinding(AbilitySlot slot) { @@ -35,7 +37,7 @@ public class KeyBindingsHandler { } public void addKeybind(int code, AbilitySlot slot) { - KeyBinding binding = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.unicopia" + slot.name().toLowerCase(), code, KEY_CATEGORY)); + KeyBinding binding = KeyBindingHelper.registerKeyBinding(new KeyBinding("key.unicopia." + slot.name().toLowerCase(), code, KEY_CATEGORY)); reverse.put(slot, binding); keys.put(binding, slot); } diff --git a/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java b/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java index 0c7798e8..8fa66106 100644 --- a/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java +++ b/src/main/java/com/minelittlepony/unicopia/client/UnicopiaClient.java @@ -33,6 +33,7 @@ public class UnicopiaClient implements ClientModInitializer { public void onInitializeClient() { InteractionManager.INSTANCE = new ClientInteractionManager(); + KeyBindingsHandler.bootstrap(); URenderers.bootstrap(); ClientTickEvents.END_CLIENT_TICK.register(this::onTick); diff --git a/src/main/resources/assets/unicopia/lang/en_us.json b/src/main/resources/assets/unicopia/lang/en_us.json index cb8e0635..963bfcce 100644 --- a/src/main/resources/assets/unicopia/lang/en_us.json +++ b/src/main/resources/assets/unicopia/lang/en_us.json @@ -172,17 +172,10 @@ "unicopia.category.name": "Pony Abilities", - "unicopia.power.grow": "Primary Earth Pony ability", - "unicopia.power.earth": "Secondary Earth Pony ability", - - "unicopia.power.teleport": "Primary Unicorn ability", - "unicopia.power.magic": "Secondary Unicorn ability", - - "unicopia.power.cloud": "Primary Pegasus ability", - "unicopia.power.carry": "Pick up & Drop riders", - - "unicopia.power.feed": "Primary Changeling ability", - "unicopia.power.disguise": "Secondary Changeling ability", + "key.unicopia.primary": "Primary Ability", + "key.unicopia.secondary": "Secondary Ability", + "key.unicopia.tertiary": "Tertiary Ability", + "key.unicopia.passive": "Passive Ability", "death.attack.magical_exhaustion": "%1$s exhausted themselves", "death.attack.alicorn_amulet": "%1$s was driven insane",