Fix active timeline changes affecting render queue (fixes #814)

The `Timeline` type is mutable, so we need to create a copy before we pass it to
GuiKeyframeRepository because we don't want anything stored in there (or more
specifically in render queue which can also be added to from that gui) to be
affected by subsequent changes.
This commit is contained in:
Jonas Herzig
2023-03-26 19:21:30 +02:00
parent 8037a9ad30
commit bf32672536

View File

@@ -395,8 +395,11 @@ public class GuiPathing {
public void keyframeRepoButtonPressed() {
abortPathPlayback();
try {
TimelineSerialization serialization = new TimelineSerialization(mod.getCurrentTimeline(), null);
String serialized = serialization.serialize(Collections.singletonMap("", mod.getCurrentTimeline().getTimeline()));
Timeline currentTimeline = serialization.deserialize(serialized).get("");
GuiKeyframeRepository gui = new GuiKeyframeRepository(
mod.getCurrentTimeline(), replayHandler.getReplayFile(), mod.getCurrentTimeline().getTimeline());
mod.getCurrentTimeline(), replayHandler.getReplayFile(), currentTimeline);
Futures.addCallback(gui.getFuture(), new FutureCallback<Timeline>() {
@Override
public void onSuccess(Timeline result) {