Added clearKeyframesCallback Replay Setting to determine whether a confirmation screen will be opened before clearing Keyframes using 'c'
Removed unused Replay Settings and removed all warnings from ReplaySettings.java
This commit is contained in:
@@ -6,23 +6,12 @@ import net.minecraft.client.resources.I18n;
|
|||||||
import net.minecraftforge.common.config.Configuration;
|
import net.minecraftforge.common.config.Configuration;
|
||||||
import net.minecraftforge.common.config.Property;
|
import net.minecraftforge.common.config.Property;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.Arrays;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
public class ReplaySettings {
|
public class ReplaySettings {
|
||||||
|
|
||||||
public List<ValueEnum> getValueEnums() {
|
|
||||||
List<ValueEnum> enums = new ArrayList<ReplaySettings.ValueEnum>();
|
|
||||||
enums.addAll(Arrays.asList(ReplayOptions.values()));
|
|
||||||
enums.addAll(Arrays.asList(RenderOptions.values()));
|
|
||||||
return enums;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final String[] CATEGORIES = new String[]{"recording", "replay", "render", "advanced"};
|
private static final String[] CATEGORIES = new String[]{"recording", "replay", "render", "advanced"};
|
||||||
|
|
||||||
public void readValues() {
|
public void readValues() {
|
||||||
Configuration config = ReplayMod.instance.config;
|
Configuration config = ReplayMod.config;
|
||||||
|
|
||||||
config.load();
|
config.load();
|
||||||
|
|
||||||
@@ -68,20 +57,6 @@ public class ReplaySettings {
|
|||||||
rewriteSettings();
|
rewriteSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
public double getVideoQuality() {
|
|
||||||
return (Double) RenderOptions.videoQuality.getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setVideoQuality(double videoQuality) {
|
|
||||||
RenderOptions.videoQuality.setValue(Math.min(0.9f, Math.max(0.1f, videoQuality)));
|
|
||||||
rewriteSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setEnableIndicator(boolean enable) {
|
|
||||||
RecordingOptions.indicator.setValue(enable);
|
|
||||||
rewriteSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean showRecordingIndicator() {
|
public boolean showRecordingIndicator() {
|
||||||
return (Boolean) RecordingOptions.indicator.getValue();
|
return (Boolean) RecordingOptions.indicator.getValue();
|
||||||
}
|
}
|
||||||
@@ -90,29 +65,14 @@ public class ReplaySettings {
|
|||||||
return (Boolean) RecordingOptions.recordServer.getValue();
|
return (Boolean) RecordingOptions.recordServer.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnableRecordingServer(boolean enableRecordingServer) {
|
|
||||||
RecordingOptions.recordServer.setValue(enableRecordingServer);
|
|
||||||
rewriteSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isEnableRecordingSingleplayer() {
|
public boolean isEnableRecordingSingleplayer() {
|
||||||
return (Boolean) RecordingOptions.recordSingleplayer.getValue();
|
return (Boolean) RecordingOptions.recordSingleplayer.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setEnableRecordingSingleplayer(boolean enableRecordingSingleplayer) {
|
|
||||||
RecordingOptions.recordSingleplayer.setValue(enableRecordingSingleplayer);
|
|
||||||
rewriteSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isShowNotifications() {
|
public boolean isShowNotifications() {
|
||||||
return (Boolean) RecordingOptions.notifications.getValue();
|
return (Boolean) RecordingOptions.notifications.getValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setShowNotifications(boolean showNotifications) {
|
|
||||||
RecordingOptions.notifications.setValue(showNotifications);
|
|
||||||
rewriteSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean isLinearMovement() {
|
public boolean isLinearMovement() {
|
||||||
return (Boolean) ReplayOptions.linear.getValue();
|
return (Boolean) ReplayOptions.linear.getValue();
|
||||||
}
|
}
|
||||||
@@ -132,15 +92,6 @@ public class ReplaySettings {
|
|||||||
rewriteSettings();
|
rewriteSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean getUseResourcePacks() {
|
|
||||||
return (Boolean) ReplayOptions.useResources.getValue();
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setUseResourcePacks(boolean use) {
|
|
||||||
ReplayOptions.useResources.setValue(use);
|
|
||||||
rewriteSettings();
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean getWaitForChunks() {
|
public boolean getWaitForChunks() {
|
||||||
return (Boolean) RenderOptions.waitForChunks.getValue();
|
return (Boolean) RenderOptions.waitForChunks.getValue();
|
||||||
}
|
}
|
||||||
@@ -150,13 +101,17 @@ public class ReplaySettings {
|
|||||||
rewriteSettings();
|
rewriteSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean showPathPreview() { return (Boolean) ReplayOptions.previewPath.getValue(); };
|
public boolean showPathPreview() { return (Boolean) ReplayOptions.previewPath.getValue(); }
|
||||||
|
|
||||||
public void setShowPathPreview(boolean show) {
|
public void setShowPathPreview(boolean show) {
|
||||||
ReplayOptions.previewPath.setValue(show);
|
ReplayOptions.previewPath.setValue(show);
|
||||||
rewriteSettings();
|
rewriteSettings();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean showClearKeyframesCallback() {
|
||||||
|
return (Boolean) ReplayOptions.keyframeCleanCallback.getValue();
|
||||||
|
}
|
||||||
|
|
||||||
public void rewriteSettings() {
|
public void rewriteSettings() {
|
||||||
ReplayMod.config.load();
|
ReplayMod.config.load();
|
||||||
|
|
||||||
@@ -250,14 +205,15 @@ public class ReplaySettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() { return I18n.format(name); };
|
public String getName() { return I18n.format(name); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum ReplayOptions implements ValueEnum {
|
public enum ReplayOptions implements ValueEnum {
|
||||||
linear(false, "replaymod.gui.settings.interpolation"),
|
linear(false, "replaymod.gui.settings.interpolation"),
|
||||||
lighting(false, "replaymod.gui.settings.lighting"),
|
lighting(false, "replaymod.gui.settings.lighting"),
|
||||||
useResources(true, "replaymod.gui.settings.resources"),
|
useResources(true, "replaymod.gui.settings.resources"),
|
||||||
previewPath(false, "replaymod.gui.settings.pathpreview");
|
previewPath(false, "replaymod.gui.settings.pathpreview"),
|
||||||
|
keyframeCleanCallback(true, "replaymod.gui.settings.keyframecleancallback");
|
||||||
|
|
||||||
private Object value;
|
private Object value;
|
||||||
private String name;
|
private String name;
|
||||||
@@ -278,7 +234,7 @@ public class ReplaySettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() { return I18n.format(name); };
|
public String getName() { return I18n.format(name); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum RenderOptions implements ValueEnum {
|
public enum RenderOptions implements ValueEnum {
|
||||||
@@ -305,7 +261,7 @@ public class ReplaySettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() { return I18n.format(name); };
|
public String getName() { return I18n.format(name); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public enum AdvancedOptions implements ValueEnum {
|
public enum AdvancedOptions implements ValueEnum {
|
||||||
@@ -332,7 +288,7 @@ public class ReplaySettings {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String getName() { return I18n.format(name); };
|
public String getName() { return I18n.format(name); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public interface ValueEnum {
|
public interface ValueEnum {
|
||||||
|
|||||||
@@ -221,6 +221,7 @@ replaymod.gui.settings.forcechunks=Force Render Chunks
|
|||||||
replaymod.gui.settings.resources=Server Resource Packs
|
replaymod.gui.settings.resources=Server Resource Packs
|
||||||
replaymod.gui.settings.interpolation=Path Interpolation
|
replaymod.gui.settings.interpolation=Path Interpolation
|
||||||
replaymod.gui.settings.pathpreview=Show Path Preview
|
replaymod.gui.settings.pathpreview=Show Path Preview
|
||||||
|
replaymod.gui.settings.keyframecleancallback=Clearing Keyframes confirmation
|
||||||
|
|
||||||
replaymod.gui.settings.videoquality.draft=Draft
|
replaymod.gui.settings.videoquality.draft=Draft
|
||||||
replaymod.gui.settings.videoquality.normal=Normal
|
replaymod.gui.settings.videoquality.normal=Normal
|
||||||
|
|||||||
Reference in New Issue
Block a user