Add undo/redo to keyframe timeline (closes #305)
This commit is contained in:
@@ -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).
|
||||
|
||||
@@ -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); }
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user