Fix incorrect extension for custom screenshot file name (fixes #337)

This commit is contained in:
Jonas Herzig
2020-09-27 13:45:03 +02:00
parent d9e3622254
commit fb447dc252
2 changed files with 29 additions and 0 deletions

View File

@@ -95,6 +95,11 @@ public class GuiCreateScreenshot extends GuiRenderSettings implements Loadable {
} }
} }
@Override
public void load(RenderSettings settings) {
super.load(settings.withEncodingPreset(RenderSettings.EncodingPreset.PNG));
}
@Override @Override
protected Path getSettingsPath() { protected Path getSettingsPath() {
return getMinecraft().runDirectory.toPath().resolve("config/replaymod-screenshotsettings.json"); return getMinecraft().runDirectory.toPath().resolve("config/replaymod-screenshotsettings.json");

View File

@@ -206,6 +206,30 @@ public class RenderSettings {
this.highPerformance = highPerformance; this.highPerformance = highPerformance;
} }
public RenderSettings withEncodingPreset(EncodingPreset encodingPreset) {
return new RenderSettings(
renderMethod,
encodingPreset,
videoWidth,
videoHeight,
framesPerSecond,
bitRate,
outputFile,
renderNameTags,
stabilizeYaw,
stabilizePitch,
stabilizeRoll,
chromaKeyingColor,
sphericalFovX,
sphericalFovY,
injectSphericalMetadata,
antiAliasing,
exportCommand,
exportArguments,
highPerformance
);
}
/** /**
* @return the width of the output video during rendering, including the upscale for Anti-Aliasing. * @return the width of the output video during rendering, including the upscale for Anti-Aliasing.
*/ */