Make video timeline length configurable (closes #261)
This commit is contained in:
@@ -7,6 +7,7 @@ import java.util.stream.Collectors;
|
||||
|
||||
public final class Setting<T> extends SettingsRegistry.SettingKeys<T> {
|
||||
public static final Setting<Boolean> PATH_PREVIEW = make("pathpreview", "pathpreview", true);
|
||||
public static final Setting<Integer> TIMELINE_LENGTH = make("timelineLength", null, 30 * 60);
|
||||
public static final SettingsRegistry.MultipleChoiceSettingKeys<String> DEFAULT_INTERPOLATION;
|
||||
|
||||
static {
|
||||
@@ -27,6 +28,6 @@ public final class Setting<T> extends SettingsRegistry.SettingKeys<T> {
|
||||
}
|
||||
|
||||
public Setting(String key, String displayString, T defaultValue) {
|
||||
super("simplepathing", key, "replaymod.gui.settings." + displayString, defaultValue);
|
||||
super("simplepathing", key, displayString == null ? null : "replaymod.gui.settings." + displayString, defaultValue);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ import com.replaymod.replaystudio.util.EntityPositionTracker;
|
||||
import com.replaymod.simplepathing.ReplayModSimplePathing;
|
||||
import com.replaymod.simplepathing.SPTimeline;
|
||||
import com.replaymod.simplepathing.SPTimeline.SPPath;
|
||||
import com.replaymod.simplepathing.Setting;
|
||||
import de.johni0702.minecraft.gui.GuiRenderer;
|
||||
import de.johni0702.minecraft.gui.RenderInfo;
|
||||
import de.johni0702.minecraft.gui.container.GuiContainer;
|
||||
@@ -170,7 +171,7 @@ public class GuiPathing {
|
||||
}
|
||||
super.draw(renderer, size, renderInfo);
|
||||
}
|
||||
}.setSize(Integer.MAX_VALUE, 20).setLength(30 * 60 * 1000).setMarkers();
|
||||
}.setSize(Integer.MAX_VALUE, 20).setMarkers();
|
||||
|
||||
public final GuiHorizontalScrollbar scrollbar = new GuiHorizontalScrollbar().setSize(Integer.MAX_VALUE, 9);
|
||||
{scrollbar.onValueChanged(new Runnable() {
|
||||
@@ -283,6 +284,8 @@ public class GuiPathing {
|
||||
this.player = new RealtimeTimelinePlayer(replayHandler);
|
||||
final GuiReplayOverlay overlay = replayHandler.getOverlay();
|
||||
|
||||
timeline.setLength(core.getSettingsRegistry().get(Setting.TIMELINE_LENGTH) * 1000);
|
||||
|
||||
playPauseButton.setTexturePosH(new ReadablePoint() {
|
||||
@Override
|
||||
public int getX() {
|
||||
|
||||
Reference in New Issue
Block a user