Added Shortcut to toggle Interpolation ('O' key)

This commit is contained in:
CrushedPixel
2015-08-05 13:03:16 +02:00
parent e03610bcef
commit d4259c103f
4 changed files with 13 additions and 0 deletions

View File

@@ -229,5 +229,9 @@ public class KeyInputHandler {
if(kb.getKeyDescription().equals(KeybindRegistry.KEY_OBJECT_MANAGER) && (kb.isPressed() || kb.getKeyCode() == keyCode)) { if(kb.getKeyDescription().equals(KeybindRegistry.KEY_OBJECT_MANAGER) && (kb.isPressed() || kb.getKeyCode() == keyCode)) {
mc.displayGuiScreen(new GuiObjectManager()); mc.displayGuiScreen(new GuiObjectManager());
} }
if(kb.getKeyDescription().equals(KeybindRegistry.KEY_TOGGLE_INTERPOLATION) && (kb.isPressed() || kb.getKeyCode() == keyCode)) {
ReplayMod.replaySettings.toggleInterpolation();
}
} }
} }

View File

@@ -26,6 +26,7 @@ public class KeybindRegistry {
public static final String KEY_PATH_PREVIEW = "replaymod.input.pathpreview"; public static final String KEY_PATH_PREVIEW = "replaymod.input.pathpreview";
public static final String KEY_ASSET_MANAGER = "replaymod.input.assetmanager"; public static final String KEY_ASSET_MANAGER = "replaymod.input.assetmanager";
public static final String KEY_OBJECT_MANAGER = "replaymod.input.objectmanager"; public static final String KEY_OBJECT_MANAGER = "replaymod.input.objectmanager";
public static final String KEY_TOGGLE_INTERPOLATION = "replaymod.input.interpolation";
private static Minecraft mc = Minecraft.getMinecraft(); private static Minecraft mc = Minecraft.getMinecraft();
@Getter @Getter
@@ -54,6 +55,8 @@ public class KeybindRegistry {
replayModKeyBindings.add(new KeyBinding(KEY_ASSET_MANAGER, Keyboard.KEY_G, "replaymod.title")); replayModKeyBindings.add(new KeyBinding(KEY_ASSET_MANAGER, Keyboard.KEY_G, "replaymod.title"));
replayModKeyBindings.add(new KeyBinding(KEY_OBJECT_MANAGER, Keyboard.KEY_F, "replaymod.title")); replayModKeyBindings.add(new KeyBinding(KEY_OBJECT_MANAGER, Keyboard.KEY_F, "replaymod.title"));
replayModKeyBindings.add(new KeyBinding(KEY_TOGGLE_INTERPOLATION, Keyboard.KEY_O, "replaymod.title"));
} }
public static void initialize() { public static void initialize() {

View File

@@ -57,6 +57,11 @@ public class ReplaySettings {
rewriteSettings(); rewriteSettings();
} }
public void toggleInterpolation() {
ReplayOptions.linear.setValue(!((Boolean)ReplayOptions.linear.getValue()));
rewriteSettings();
}
public boolean showRecordingIndicator() { public boolean showRecordingIndicator() {
return (Boolean) RecordingOptions.indicator.getValue(); return (Boolean) RecordingOptions.indicator.getValue();
} }

View File

@@ -272,6 +272,7 @@ replaymod.input.marker=Add Event Marker
replaymod.input.pathpreview=Toggle Path Preview replaymod.input.pathpreview=Toggle Path Preview
replaymod.input.assetmanager=Asset Manager replaymod.input.assetmanager=Asset Manager
replaymod.input.objectmanager=Object Manager replaymod.input.objectmanager=Object Manager
replaymod.input.interpolation=Toggle Interpolation
#Keyframe Presets GUI #Keyframe Presets GUI
replaymod.gui.keyframerepository.title=Keyframe Repository replaymod.gui.keyframerepository.title=Keyframe Repository