From 526ee76d4ad7ca8ad8f4473a33cbcdfa123372b5 Mon Sep 17 00:00:00 2001 From: johni0702 Date: Sun, 4 Oct 2015 15:44:27 +0200 Subject: [PATCH] Add Play/Pause hotkey --- src/main/java/com/replaymod/replay/ReplayModReplay.java | 9 +++++++++ .../crushedpixel/replaymod/registry/KeybindRegistry.java | 2 -- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/main/java/com/replaymod/replay/ReplayModReplay.java b/src/main/java/com/replaymod/replay/ReplayModReplay.java index 8adf4904..8595eb23 100644 --- a/src/main/java/com/replaymod/replay/ReplayModReplay.java +++ b/src/main/java/com/replaymod/replay/ReplayModReplay.java @@ -76,6 +76,15 @@ public class ReplayModReplay { } } }); + + core.getKeyBindingRegistry().registerKeyBinding("replaymod.input.playpause", Keyboard.KEY_P, new Runnable() { + @Override + public void run() { + if (replayHandler != null) { + replayHandler.getOverlay().playPauseButton.onClick(); + } + } + }); } @Mod.EventHandler diff --git a/src/main/java/eu/crushedpixel/replaymod/registry/KeybindRegistry.java b/src/main/java/eu/crushedpixel/replaymod/registry/KeybindRegistry.java index 6015a365..b47b7b03 100755 --- a/src/main/java/eu/crushedpixel/replaymod/registry/KeybindRegistry.java +++ b/src/main/java/eu/crushedpixel/replaymod/registry/KeybindRegistry.java @@ -35,8 +35,6 @@ public class KeybindRegistry { static { replayModKeyBindings = new ArrayList(); - replayModKeyBindings.add(new KeyBinding(KEY_PLAY_PAUSE, Keyboard.KEY_P, "replaymod.title")); - replayModKeyBindings.add(new KeyBinding(KEY_ROLL_CLOCKWISE, Keyboard.KEY_L, "replaymod.title")); replayModKeyBindings.add(new KeyBinding(KEY_ROLL_COUNTERCLOCKWISE, Keyboard.KEY_J, "replaymod.title")); replayModKeyBindings.add(new KeyBinding(KEY_RESET_TILT, Keyboard.KEY_K, "replaymod.title"));