Refactor simple pathing timeline logic into dedicated class with unit tests
Fix logic for user-set interpolators
This commit is contained in:
@@ -9,10 +9,10 @@ import com.replaymod.replaystudio.pathing.interpolation.Interpolator;
|
||||
import com.replaymod.replaystudio.pathing.path.Keyframe;
|
||||
import com.replaymod.replaystudio.pathing.path.Path;
|
||||
import com.replaymod.replaystudio.pathing.path.PathSegment;
|
||||
import com.replaymod.replaystudio.pathing.path.Timeline;
|
||||
import com.replaymod.replaystudio.util.EntityPositionTracker;
|
||||
import com.replaymod.replaystudio.util.Location;
|
||||
import com.replaymod.simplepathing.ReplayModSimplePathing;
|
||||
import com.replaymod.simplepathing.SPTimeline;
|
||||
import com.replaymod.simplepathing.gui.GuiPathing;
|
||||
import net.minecraft.client.Minecraft;
|
||||
import net.minecraft.client.renderer.GlStateManager;
|
||||
@@ -67,11 +67,11 @@ public class PathPreviewRenderer {
|
||||
if (guiPathing == null) return;
|
||||
EntityPositionTracker entityTracker = guiPathing.getEntityTracker();
|
||||
|
||||
Timeline timeline = mod.getCurrentTimeline();
|
||||
SPTimeline timeline = mod.getCurrentTimeline();
|
||||
if (timeline == null) return;
|
||||
Path path = timeline.getPaths().get(GuiPathing.POSITION_PATH);
|
||||
Path path = timeline.getPositionPath();
|
||||
if (path.getKeyframes().isEmpty()) return;
|
||||
Path timePath = timeline.getPaths().get(GuiPathing.TIME_PATH);
|
||||
Path timePath = timeline.getTimePath();
|
||||
|
||||
path.update();
|
||||
|
||||
@@ -230,7 +230,7 @@ public class PathPreviewRenderer {
|
||||
float posY = 0f;
|
||||
float size = 10f / ReplayMod.TEXTURE_SIZE;
|
||||
|
||||
if (keyframe == mod.getSelectedKeyframe()) {
|
||||
if (mod.isSelected(keyframe)) {
|
||||
posY += size;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user