Fix camera path always playing from the beginning regardless of ctrl key

This commit is contained in:
johni0702
2016-10-23 14:45:14 +02:00
parent 4805e5e9f5
commit b240f8a276
3 changed files with 10 additions and 2 deletions

View File

@@ -235,7 +235,9 @@ public class GuiPathing {
if (!preparePathsForPlayback()) return;
timePath.setActive(!Keyboard.isKeyDown(Keyboard.KEY_LSHIFT));
ListenableFuture<Void> future = player.start(timeline);
// Start from cursor time unless the control key is pressed (then start from beginning)
int startTime = Keyboard.isKeyDown(Keyboard.KEY_LCONTROL)? 0 : GuiPathing.this.timeline.getCursorPosition();
ListenableFuture<Void> future = player.start(timeline, startTime);
overlay.setCloseable(false);
overlay.setMouseVisible(true);
Futures.addCallback(future, new FutureCallback<Void>() {