diff --git a/common/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptionPages.java b/common/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptionPages.java index b97e3fa433..c3be09a38e 100644 --- a/common/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptionPages.java +++ b/common/src/main/java/net/caffeinemc/mods/sodium/client/gui/SodiumGameOptionPages.java @@ -272,7 +272,7 @@ public static OptionPage performance() { .add(OptionImpl.createBuilder(int.class, sodiumOpts) .setName(Component.translatable("sodium.options.chunk_update_threads.name")) .setTooltip(Component.translatable("sodium.options.chunk_update_threads.tooltip")) - .setControl(o -> new SliderControl(o, 0, Runtime.getRuntime().availableProcessors(), 1, ControlValueFormatter.quantityOrDisabled("threads", "Default"))) + .setControl(o -> new SliderControl(o, 0, Runtime.getRuntime().availableProcessors(), 1, ControlValueFormatter.quantityOrDisabled("sodium.options.chunk_update_threads.value", "options.gamma.default"))) .setImpact(OptionImpact.HIGH) .setBinding((opts, value) -> opts.performance.chunkBuilderThreads = value, opts -> opts.performance.chunkBuilderThreads) .setFlags(OptionFlag.REQUIRES_RENDERER_RELOAD) diff --git a/common/src/main/java/net/caffeinemc/mods/sodium/client/gui/options/control/ControlValueFormatter.java b/common/src/main/java/net/caffeinemc/mods/sodium/client/gui/options/control/ControlValueFormatter.java index c7d8e30507..429fd56c81 100644 --- a/common/src/main/java/net/caffeinemc/mods/sodium/client/gui/options/control/ControlValueFormatter.java +++ b/common/src/main/java/net/caffeinemc/mods/sodium/client/gui/options/control/ControlValueFormatter.java @@ -31,6 +31,8 @@ static ControlValueFormatter brightness() { return (v) -> { if (v == 0) { return Component.translatable("options.gamma.min"); + } else if (v == 50) { + return Component.translatable("options.gamma.default"); } else if (v == 100) { return Component.translatable("options.gamma.max"); } else { @@ -57,8 +59,8 @@ static ControlValueFormatter multiplier() { return (v) -> Component.literal(v + "x"); } - static ControlValueFormatter quantityOrDisabled(String name, String disableText) { - return (v) -> Component.literal(v == 0 ? disableText : v + " " + name); + static ControlValueFormatter quantityOrDisabled(String valueKey, String disableKey) { + return (v) -> v == 0 ? Component.translatable(disableKey) : Component.translatable(valueKey, v); } static ControlValueFormatter number() { diff --git a/common/src/main/resources/assets/sodium/lang/en_us.json b/common/src/main/resources/assets/sodium/lang/en_us.json index d1d1e6b6a7..8599437b66 100644 --- a/common/src/main/resources/assets/sodium/lang/en_us.json +++ b/common/src/main/resources/assets/sodium/lang/en_us.json @@ -48,6 +48,7 @@ "sodium.options.use_persistent_mapping.tooltip": "For debugging only. If enabled, persistent memory mappings will be used for the staging buffer so that unnecessary memory copies can be avoided. Disabling this can be useful for narrowing down the cause of graphical corruption.\n\nRequires OpenGL 4.4 or ARB_buffer_storage.", "sodium.options.chunk_update_threads.name": "Chunk Update Threads", "sodium.options.chunk_update_threads.tooltip": "Specifies the number of threads to use for chunk building and sorting. Using more threads can speed up chunk loading and update speed, but may negatively impact frame times. The default value is usually good enough for all situations.", + "sodium.options.chunk_update_threads.value": "%s thread(s)", "sodium.options.always_defer_chunk_updates.name": "Always Defer Chunk Updates", "sodium.options.always_defer_chunk_updates.tooltip": "If enabled, rendering will never wait for chunk updates to finish, even if they are important. This can greatly improve frame rates in some scenarios, but it may create significant visual lag where blocks take a while to appear or disappear.", "sodium.options.sort_behavior.name": "Translucency Sorting",