diff --git a/docs/content.md b/docs/content.md index cd699df0..b6a11747 100755 --- a/docs/content.md +++ b/docs/content.md @@ -147,6 +147,8 @@ If two Keyframes are 5 seconds apart, the Camera Path will take 5 seconds to int You can drag Keyframes on the **Keyframe Timeline** by left-clicking them, holding the mouse button and moving your mouse. +> **Hint:** Made a mistake? You can use `Ctrl+Z` to undo your changes to the keyframe timeline. Changed you mind? Press `Ctrl+Y` (or `Ctrl+Shift+Z`) to redo them. + ### Position Keyframes [place] The basic components of a Camera Path are **Position Keyframes**. A Position Keyframe stores a **Camera Position** (x, y, z, yaw, pitch, roll). diff --git a/src/main/java/com/replaymod/simplepathing/ReplayModSimplePathing.java b/src/main/java/com/replaymod/simplepathing/ReplayModSimplePathing.java index f9ef0ee3..fd60d3d8 100644 --- a/src/main/java/com/replaymod/simplepathing/ReplayModSimplePathing.java +++ b/src/main/java/com/replaymod/simplepathing/ReplayModSimplePathing.java @@ -22,6 +22,7 @@ import com.replaymod.replaystudio.replay.ReplayFile; import com.replaymod.simplepathing.SPTimeline.SPPath; import com.replaymod.simplepathing.gui.GuiPathing; import com.replaymod.simplepathing.preview.PathPreview; +import net.minecraft.client.gui.screen.Screen; import net.minecraft.util.crash.CrashReport; import net.minecraft.util.crash.CrashException; import org.apache.logging.log4j.LogManager; @@ -114,6 +115,32 @@ public class ReplayModSimplePathing extends EventRegistrations implements Module guiPathing.toggleKeyframe(SPPath.POSITION, false); } }, true); + core.getKeyBindingRegistry().registerRaw(Keyboard.KEY_Z, () -> { + if (Screen.hasControlDown() && currentTimeline != null) { + Timeline timeline = currentTimeline.getTimeline(); + if (Screen.hasShiftDown()) { + if (timeline.peekRedoStack() != null) { + timeline.redoLastChange(); + } + } else { + if (timeline.peekUndoStack() != null) { + timeline.undoLastChange(); + } + } + return true; + } + return false; + }); + core.getKeyBindingRegistry().registerRaw(Keyboard.KEY_Y, () -> { + if (Screen.hasControlDown() && currentTimeline != null) { + Timeline timeline = currentTimeline.getTimeline(); + if (timeline.peekRedoStack() != null) { + timeline.redoLastChange(); + } + return true; + } + return false; + }); } { on(ReplayOpenedCallback.EVENT, this::onReplayOpened); } diff --git a/versions/common.gradle b/versions/common.gradle index 238c8021..ef679e0e 100644 --- a/versions/common.gradle +++ b/versions/common.gradle @@ -305,7 +305,7 @@ dependencies { shadow 'com.github.ReplayMod.JavaBlend:2.79.0:a0696f8' - shadow "com.github.ReplayMod:ReplayStudio:9558f9e", shadeExclusions + shadow "com.github.ReplayMod:ReplayStudio:919db4e", shadeExclusions implementation(jGui){ transitive = false // FG 1.2 puts all MC deps into the compile configuration and we don't want to shade those