From 2292cdecead5617ce503f83d095ee7347c86c748 Mon Sep 17 00:00:00 2001 From: johni0702 Date: Sun, 21 Aug 2016 18:04:41 +0200 Subject: [PATCH] Always update path interpolation when loading new timeline Fixes path preview not rendering spectator paths after load due to dirty interpolators --- .../replaymod/pathing/gui/GuiKeyframeRepository.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/replaymod/pathing/gui/GuiKeyframeRepository.java b/src/main/java/com/replaymod/pathing/gui/GuiKeyframeRepository.java index 11187d99..525ef7e8 100644 --- a/src/main/java/com/replaymod/pathing/gui/GuiKeyframeRepository.java +++ b/src/main/java/com/replaymod/pathing/gui/GuiKeyframeRepository.java @@ -6,6 +6,7 @@ import com.google.common.util.concurrent.SettableFuture; import com.replaymod.core.ReplayMod; import com.replaymod.replay.ReplayModReplay; import com.replaymod.replaystudio.pathing.PathingRegistry; +import com.replaymod.replaystudio.pathing.path.Path; import com.replaymod.replaystudio.pathing.path.Timeline; import com.replaymod.replaystudio.replay.ReplayFile; import de.johni0702.minecraft.gui.GuiRenderer; @@ -91,7 +92,15 @@ public class GuiKeyframeRepository extends GuiScreen implements Closeable { @Override public void run() { getMinecraft().displayGuiScreen(null); - future.set(timelines.get(selectedEntry.name)); + try { + Timeline timeline = timelines.get(selectedEntry.name); + for (Path path : timeline.getPaths()) { + path.updateAll(); + } + future.set(timeline); + } catch (Throwable t) { + future.setException(t); + } } }).setSize(75, 20).setI18nLabel("replaymod.gui.load").setDisabled(); public final GuiButton renameButton = new GuiButton(buttonPanel).onClick(new Runnable() {