mirror of
https://github.com/Sollace/Unicopia.git
synced 2024-11-24 05:47:59 +01:00
Fixed key bindings not appearing in the settings screen and adjust the defaults for one-handed gameplay
This commit is contained in:
parent
cc0d661ae7
commit
d9e92ff0ea
3 changed files with 11 additions and 15 deletions
|
@ -19,15 +19,17 @@ public class KeyBindingsHandler {
|
||||||
|
|
||||||
public static final KeyBindingsHandler INSTANCE = new KeyBindingsHandler();
|
public static final KeyBindingsHandler INSTANCE = new KeyBindingsHandler();
|
||||||
|
|
||||||
|
static void bootstrap() {}
|
||||||
|
|
||||||
private final Map<KeyBinding, AbilitySlot> keys = new HashMap<>();
|
private final Map<KeyBinding, AbilitySlot> keys = new HashMap<>();
|
||||||
private final Map<AbilitySlot, KeyBinding> reverse = new HashMap<>();
|
private final Map<AbilitySlot, KeyBinding> reverse = new HashMap<>();
|
||||||
|
|
||||||
private final Set<KeyBinding> pressed = new HashSet<>();
|
private final Set<KeyBinding> pressed = new HashSet<>();
|
||||||
|
|
||||||
public KeyBindingsHandler() {
|
public KeyBindingsHandler() {
|
||||||
addKeybind(GLFW.GLFW_KEY_O, AbilitySlot.PRIMARY);
|
addKeybind(GLFW.GLFW_KEY_R, AbilitySlot.PRIMARY);
|
||||||
addKeybind(GLFW.GLFW_KEY_P, AbilitySlot.SECONDARY);
|
addKeybind(GLFW.GLFW_KEY_F, AbilitySlot.SECONDARY);
|
||||||
addKeybind(GLFW.GLFW_KEY_L, AbilitySlot.TERTIARY);
|
addKeybind(GLFW.GLFW_KEY_C, AbilitySlot.TERTIARY);
|
||||||
}
|
}
|
||||||
|
|
||||||
public KeyBinding getBinding(AbilitySlot slot) {
|
public KeyBinding getBinding(AbilitySlot slot) {
|
||||||
|
@ -35,7 +37,7 @@ public class KeyBindingsHandler {
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addKeybind(int code, AbilitySlot slot) {
|
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);
|
reverse.put(slot, binding);
|
||||||
keys.put(binding, slot);
|
keys.put(binding, slot);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,6 +33,7 @@ public class UnicopiaClient implements ClientModInitializer {
|
||||||
public void onInitializeClient() {
|
public void onInitializeClient() {
|
||||||
InteractionManager.INSTANCE = new ClientInteractionManager();
|
InteractionManager.INSTANCE = new ClientInteractionManager();
|
||||||
|
|
||||||
|
KeyBindingsHandler.bootstrap();
|
||||||
URenderers.bootstrap();
|
URenderers.bootstrap();
|
||||||
|
|
||||||
ClientTickEvents.END_CLIENT_TICK.register(this::onTick);
|
ClientTickEvents.END_CLIENT_TICK.register(this::onTick);
|
||||||
|
|
|
@ -172,17 +172,10 @@
|
||||||
|
|
||||||
"unicopia.category.name": "Pony Abilities",
|
"unicopia.category.name": "Pony Abilities",
|
||||||
|
|
||||||
"unicopia.power.grow": "Primary Earth Pony ability",
|
"key.unicopia.primary": "Primary Ability",
|
||||||
"unicopia.power.earth": "Secondary Earth Pony ability",
|
"key.unicopia.secondary": "Secondary Ability",
|
||||||
|
"key.unicopia.tertiary": "Tertiary Ability",
|
||||||
"unicopia.power.teleport": "Primary Unicorn ability",
|
"key.unicopia.passive": "Passive 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",
|
|
||||||
|
|
||||||
"death.attack.magical_exhaustion": "%1$s exhausted themselves",
|
"death.attack.magical_exhaustion": "%1$s exhausted themselves",
|
||||||
"death.attack.alicorn_amulet": "%1$s was driven insane",
|
"death.attack.alicorn_amulet": "%1$s was driven insane",
|
||||||
|
|
Loading…
Reference in a new issue