Add linear interpolation to simplepathing

This commit is contained in:
johni0702
2016-09-03 13:32:17 +02:00
parent dca1131d49
commit ef00c45068
4 changed files with 15 additions and 1 deletions

View File

@@ -3,6 +3,7 @@ package com.replaymod.simplepathing;
import com.google.gson.stream.JsonReader;
import com.google.gson.stream.JsonWriter;
import com.replaymod.core.ReplayMod;
import com.replaymod.core.events.SettingsChangedEvent;
import com.replaymod.pathing.properties.CameraProperties;
import com.replaymod.pathing.properties.SpectatorProperty;
import com.replaymod.pathing.properties.TimestampProperty;
@@ -62,6 +63,15 @@ public class ReplayModSimplePathing implements PathingRegistry {
selectedKeyframe = null;
}
@SubscribeEvent
public void onSettingsChanged(SettingsChangedEvent event) {
if (event.getKey() == Setting.LINEAR_INTERPOLATION) {
if (currentTimeline != null && guiPathing != null) {
currentTimeline.applyChange(guiPathing.updateInterpolators());
}
}
}
private Timeline currentTimeline = createTimeline(); { currentTimeline.createPath(); currentTimeline.createPath(); }
private Keyframe selectedKeyframe;