From eb54d9abf387d596d7302756ac3da8d0ac0b4e8e Mon Sep 17 00:00:00 2001 From: johni0702 Date: Fri, 2 Sep 2016 14:46:42 +0200 Subject: [PATCH] Properly texture position keyframe button for spectator keyframes --- .../com/replaymod/simplepathing/gui/GuiPathing.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/replaymod/simplepathing/gui/GuiPathing.java b/src/main/java/com/replaymod/simplepathing/gui/GuiPathing.java index a0d4a898..06e530ea 100644 --- a/src/main/java/com/replaymod/simplepathing/gui/GuiPathing.java +++ b/src/main/java/com/replaymod/simplepathing/gui/GuiPathing.java @@ -253,7 +253,16 @@ public class GuiPathing { positionKeyframeButton.setTexturePosH(new ReadablePoint() { @Override public int getX() { - return 0; + Keyframe keyframe = mod.getSelectedKeyframe(); + if (keyframe == null || !keyframe.getValue(CameraProperties.POSITION).isPresent()) { + // No keyframe or wrong path + keyframe = mod.getCurrentTimeline().getPaths().get(POSITION_PATH).getKeyframe(timeline.getCursorPosition()); + } + if (keyframe == null) { + return replayHandler.isCameraView() ? 0 : 40; + } else { + return keyframe.getValue(SpectatorProperty.PROPERTY).isPresent() ? 40 : 0; + } } @Override