Skip to content

Commit

Permalink
misc cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
UpcraftLP committed Aug 1, 2024
1 parent b301b1b commit 63285c5
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@
import org.quiltmc.config.api.metadata.NamingScheme;
import org.quiltmc.config.api.values.TrackedValue;

import java.util.Locale;

public class ConfigTextUtils {
private final Config config;
private final NamingScheme scheme;
Expand All @@ -34,10 +36,10 @@ public Component getOptionTextTooltip(TrackedValue<?> trackedValue) {
}

public Component getEnumOptionText(TrackedValue<?> trackedValue, ConfigEnums.ConfigEnum configEnum) {
return Component.translatable(String.format("config.%s.%s.%s", this.config.family(), this.scheme.coerce(trackedValue.key().toString()), configEnum.toString().toLowerCase()));
return Component.translatable(String.format("config.%s.%s.%s", this.config.family(), this.scheme.coerce(trackedValue.key().toString()), configEnum.toString().toLowerCase(Locale.ROOT)));
}

public Component getEnumOptionTextTooltip(TrackedValue<?> trackedValue, ConfigEnums.ConfigEnum configEnum) {
return Component.translatable(String.format("config.%s.%s.%s.tooltip", this.config.family(), this.scheme.coerce(trackedValue.key().toString()), configEnum.toString().toLowerCase()));
return Component.translatable(String.format("config.%s.%s.%s.tooltip", this.config.family(), this.scheme.coerce(trackedValue.key().toString()), configEnum.toString().toLowerCase(Locale.ROOT)));
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import org.quiltmc.config.api.values.ValueTreeNode;
import org.quiltmc.loader.api.minecraft.ClientOnly;

import java.util.Locale;
import java.util.Map;
import java.util.Set;

Expand Down Expand Up @@ -176,9 +177,9 @@ protected void init() {
}

this.entryListWidget.addCategory(Component.translatable("config.ok_zoomer.presets"));
var presetButton = CycleButton.<ConfigEnums.ZoomPresets>builder(value -> Component.translatable(String.format("config.ok_zoomer.presets.preset.%s", value.toString().toLowerCase())))
var presetButton = CycleButton.<ConfigEnums.ZoomPresets>builder(value -> Component.translatable(String.format("config.ok_zoomer.presets.preset.%s", value.toString().toLowerCase(Locale.ROOT))))
.withValues(ConfigEnums.ZoomPresets.values())
.withTooltip(value -> Tooltip.create(Component.translatable(String.format("config.ok_zoomer.presets.preset.%s.tooltip", value.toString().toLowerCase()))))
.withTooltip(value -> Tooltip.create(Component.translatable(String.format("config.ok_zoomer.presets.preset.%s.tooltip", value.toString().toLowerCase(Locale.ROOT)))))
.withInitialValue(ConfigEnums.ZoomPresets.DEFAULT)
.create(0, 0, 150, 20,
Component.translatable("config.ok_zoomer.presets.preset"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,6 @@ public class OwoUtils {

public static void printOwo() {
Random random = new Random();
ZoomUtils.LOGGER.info(String.format("[Ok Zoomer] %s what's this", OWO_ARRAY[random.nextInt(OWO_ARRAY.length)]));
ZoomUtils.LOGGER.info("[Ok Zoomer] {} what's this", OWO_ARRAY[random.nextInt(OWO_ARRAY.length)]);
}
}

0 comments on commit 63285c5

Please sign in to comment.