Reset export arguments when upgrading from old version (fixes #148)
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
package com.replaymod.render;
|
||||
|
||||
import com.google.gson.annotations.SerializedName;
|
||||
import com.replaymod.core.versions.MCVer;
|
||||
import de.johni0702.minecraft.gui.utils.lwjgl.ReadableColor;
|
||||
import lombok.AllArgsConstructor;
|
||||
@@ -125,6 +126,13 @@ public class RenderSettings {
|
||||
private final AntiAliasing antiAliasing;
|
||||
|
||||
private final String exportCommand;
|
||||
// We switched from rgb24 to bgra for performance at one point, so for backwards compatibility we need to
|
||||
// reset the arguments if they're from an older version. Easiest way to do that is to just change the key
|
||||
// and handle the null during loading.
|
||||
@SerializedName("exportArguments")
|
||||
// using an empty string as default because old versions will realize it's not a preset and prompt the user
|
||||
private final String exportArgumentsPreBgra = "";
|
||||
@SerializedName("exportArgumentsBgra")
|
||||
private final String exportArguments;
|
||||
|
||||
private final boolean highPerformance;
|
||||
|
||||
@@ -523,7 +523,12 @@ public class GuiRenderSettings extends GuiScreen implements Closeable {
|
||||
injectSphericalMetadata.setChecked(settings.isInjectSphericalMetadata());
|
||||
antiAliasingDropdown.setSelected(settings.getAntiAliasing());
|
||||
exportCommand.setText(settings.getExportCommand());
|
||||
exportArguments.setText(settings.getExportArguments());
|
||||
String exportArguments = settings.getExportArguments();
|
||||
if (exportArguments == null) {
|
||||
// backwards compat, see RenderSettings#exportArguments
|
||||
exportArguments = settings.getEncodingPreset().getValue();
|
||||
}
|
||||
this.exportArguments.setText(exportArguments);
|
||||
|
||||
updateInputs();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user