Hide unsupported render methods in settings gui (fixes #284)

This commit is contained in:
Jonas Herzig
2020-07-25 16:24:33 +02:00
parent 34a7465b8e
commit fc1ae0e109
2 changed files with 35 additions and 9 deletions

View File

@@ -47,6 +47,21 @@ public class RenderSettings {
public boolean hasFixedAspectRatio() {
return this == EQUIRECTANGULAR || this == ODS || this == CUBIC;
}
@SuppressWarnings("RedundantIfStatement")
public boolean isSupported() {
//#if MC<10800 || MC>=11500
if (this == BLEND) {
return false;
}
//#endif
return true;
}
public static RenderMethod[] getSupported() {
return Arrays.stream(values()).filter(RenderMethod::isSupported).toArray(RenderMethod[]::new);
}
}
public enum EncodingPreset {
@@ -90,6 +105,18 @@ public class RenderSettings {
public String toString() {
return I18n.translate("replaymod.gui.rendersettings.presets." + name().replace('_', '.').toLowerCase());
}
public boolean isSupported() {
if (this == BLEND) {
return RenderMethod.BLEND.isSupported();
} else {
return true;
}
}
public static EncodingPreset[] getSupported() {
return Arrays.stream(values()).filter(EncodingPreset::isSupported).toArray(EncodingPreset[]::new);
}
}
@AllArgsConstructor