diff --git a/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptionPages.java b/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptionPages.java index d86625ea2f..f9130b6b77 100644 --- a/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptionPages.java +++ b/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptionPages.java @@ -151,7 +151,7 @@ public static OptionPage quality() { .add(OptionImpl.createBuilder(CloudStatus.class, vanillaOpts) .setName(Component.translatable("options.renderClouds")) .setTooltip(Component.translatable("sodium.options.clouds_quality.tooltip")) - .setControl(option -> new CyclingControl<>(option, CloudStatus.class, new Component[] { Component.translatable("options.off"), Component.translatable("options.graphics.fast"), Component.translatable("options.graphics.fancy") })) + .setControl(option -> new CyclingControl<>(option, CloudStatus.class, new Component[] { Component.translatable("options.off"), Component.translatable("options.clouds.fast"), Component.translatable("options.clouds.fancy") })) .setBinding((opts, value) -> { opts.cloudStatus().set(value); @@ -164,17 +164,17 @@ public static OptionPage quality() { }, opts -> opts.cloudStatus().get()) .setImpact(OptionImpact.LOW) .build()) - .add(OptionImpl.createBuilder(SodiumGameOptions.GraphicsQuality.class, sodiumOpts) + .add(OptionImpl.createBuilder(SodiumGameOptions.WeatherQuality.class, sodiumOpts) .setName(Component.translatable("soundCategory.weather")) .setTooltip(Component.translatable("sodium.options.weather_quality.tooltip")) - .setControl(option -> new CyclingControl<>(option, SodiumGameOptions.GraphicsQuality.class)) + .setControl(option -> new CyclingControl<>(option, SodiumGameOptions.WeatherQuality.class)) .setBinding((opts, value) -> opts.quality.weatherQuality = value, opts -> opts.quality.weatherQuality) .setImpact(OptionImpact.MEDIUM) .build()) - .add(OptionImpl.createBuilder(SodiumGameOptions.GraphicsQuality.class, sodiumOpts) + .add(OptionImpl.createBuilder(SodiumGameOptions.LeavesQuality.class, sodiumOpts) .setName(Component.translatable("sodium.options.leaves_quality.name")) .setTooltip(Component.translatable("sodium.options.leaves_quality.tooltip")) - .setControl(option -> new CyclingControl<>(option, SodiumGameOptions.GraphicsQuality.class)) + .setControl(option -> new CyclingControl<>(option, SodiumGameOptions.LeavesQuality.class)) .setBinding((opts, value) -> opts.quality.leavesQuality = value, opts -> opts.quality.leavesQuality) .setImpact(OptionImpact.MEDIUM) .setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD) diff --git a/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptions.java b/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptions.java index 1c80791be2..afc3edba1e 100644 --- a/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptions.java +++ b/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptions.java @@ -61,8 +61,8 @@ public static class AdvancedSettings { } public static class QualitySettings { - public GraphicsQuality weatherQuality = GraphicsQuality.DEFAULT; - public GraphicsQuality leavesQuality = GraphicsQuality.DEFAULT; + public WeatherQuality weatherQuality = WeatherQuality.DEFAULT; + public LeavesQuality leavesQuality = LeavesQuality.DEFAULT; public boolean enableVignette = true; } @@ -74,8 +74,8 @@ public static class NotificationSettings { public enum GraphicsQuality implements TextProvider { DEFAULT("options.gamma.default"), - FANCY("options.clouds.fancy"), - FAST("options.clouds.fast"); + FANCY("options.graphics.fancy"), + FAST("options.graphics.fast"); private final Component name; @@ -93,6 +93,48 @@ public boolean isFancy(GraphicsStatus graphicsStatus) { } } + public enum WeatherQuality implements TextProvider { + DEFAULT("options.gamma.default"), + FANCY("sodium.options.weather_quality.fancy"), + FAST("sodium.options.weather_quality.fast"); + + private final Component name; + + WeatherQuality(String name) { + this.name = Component.translatable(name); + } + + @Override + public Component getLocalizedName() { + return this.name; + } + + public boolean isFancy(GraphicsStatus graphicsMode) { + return (this == FANCY) || (this == DEFAULT && (graphicsMode == GraphicsStatus.FANCY || graphicsMode == GraphicsStatus.FABULOUS)); + } + } + + public enum LeavesQuality implements TextProvider { + DEFAULT("options.gamma.default"), + FANCY("sodium.options.leaves_quality.fancy"), + FAST("sodium.options.leaves_quality.fast"); + + private final Component name; + + LeavesQuality(String name) { + this.name = Component.translatable(name); + } + + @Override + public Component getLocalizedName() { + return this.name; + } + + public boolean isFancy(GraphicsStatus graphicsMode) { + return (this == FANCY) || (this == DEFAULT && (graphicsMode == GraphicsStatus.FANCY || graphicsMode == GraphicsStatus.FABULOUS)); + } + } + private static final Gson GSON = new GsonBuilder() .setFieldNamingPolicy(FieldNamingPolicy.LOWER_CASE_WITH_UNDERSCORES) .setPrettyPrinting() diff --git a/src/main/resources/assets/sodium/lang/en_us.json b/src/main/resources/assets/sodium/lang/en_us.json index 79a6be914a..8687ef9d03 100644 --- a/src/main/resources/assets/sodium/lang/en_us.json +++ b/src/main/resources/assets/sodium/lang/en_us.json @@ -20,7 +20,11 @@ "sodium.options.graphics_quality.tooltip": "The default graphics quality controls some legacy options and is necessary for mod compatibility. If the options below are left to \"Default\", they will use this setting.", "sodium.options.clouds_quality.tooltip": "The quality level used for rendering clouds in the sky. Even though the options are labeled \"Fast\" and \"Fancy\", the effect on performance is negligible.", "sodium.options.weather_quality.tooltip": "Controls the distance that weather effects, such as rain and snow, will be rendered.", + "sodium.options.weather_quality.fast": "Fast", + "sodium.options.weather_quality.fancy": "Fancy", "sodium.options.leaves_quality.name": "Leaves", + "sodium.options.leaves_quality.fast": "Fast", + "sodium.options.leaves_quality.fancy": "Fancy", "sodium.options.leaves_quality.tooltip": "Controls whether leaves will be rendered as transparent (fancy) or opaque (fast).", "sodium.options.particle_quality.tooltip": "Controls the maximum number of particles which can be present on screen at any one time.", "sodium.options.smooth_lighting.tooltip": "Enables the smooth lighting and shading of blocks in the world. This can very slightly increase the amount of time it takes to load or update a chunk, but it doesn't affect frame rates.",