Add keybindings for the two keyframe buttons (closes #312)

And one to add a position keyframe even when spectating.
And one to press both buttons with a single key.
This commit is contained in:
Jonas Herzig
2020-08-28 15:45:34 +02:00
parent c2f51d41fa
commit fd48e56238
3 changed files with 23 additions and 7 deletions

View File

@@ -91,6 +91,21 @@ public class ReplayModSimplePathing extends EventRegistrations implements Module
core.getKeyBindingRegistry().registerRaw(Keyboard.KEY_DELETE, () -> {
if (guiPathing != null) guiPathing.deleteButtonPressed();
});
core.getKeyBindingRegistry().registerKeyBinding("replaymod.input.positionkeyframe", Keyboard.KEY_I, () -> {
if (guiPathing != null) guiPathing.toggleKeyframe(SPPath.POSITION, false);
}, true);
core.getKeyBindingRegistry().registerKeyBinding("replaymod.input.positiononlykeyframe", 0, () -> {
if (guiPathing != null) guiPathing.toggleKeyframe(SPPath.POSITION, true);
}, true);
core.getKeyBindingRegistry().registerKeyBinding("replaymod.input.timekeyframe", Keyboard.KEY_O, () -> {
if (guiPathing != null) guiPathing.toggleKeyframe(SPPath.TIME, false);
}, true);
core.getKeyBindingRegistry().registerKeyBinding("replaymod.input.bothkeyframes", 0, () -> {
if (guiPathing != null) {
guiPathing.toggleKeyframe(SPPath.TIME, false);
guiPathing.toggleKeyframe(SPPath.POSITION, false);
}
}, true);
}
{ on(ReplayOpenedCallback.EVENT, this::onReplayOpened); }