diff --git a/src/main/java/dev/isxander/yacl3/gui/OptionListWidget.java b/src/main/java/dev/isxander/yacl3/gui/OptionListWidget.java index 28e1131c..6c66583e 100644 --- a/src/main/java/dev/isxander/yacl3/gui/OptionListWidget.java +++ b/src/main/java/dev/isxander/yacl3/gui/OptionListWidget.java @@ -310,7 +310,7 @@ public class OptionEntry extends Entry { public final AbstractWidget widget; - private final TextScaledButtonWidget resetButton; + private final TooltipButtonWidget resetButton; private final String categoryName; private final String groupName; @@ -325,7 +325,7 @@ public OptionEntry(Option option, ConfigCategory category, OptionGroup group, this.groupName = group.name().getString().toLowerCase(); if (option.canResetToDefault() && this.widget.canReset()) { this.widget.setDimension(this.widget.getDimension().expanded(-20, 0)); - this.resetButton = new TextScaledButtonWidget(yaclScreen, widget.getDimension().xLimit(), -50, 20, 20, 2f, Component.literal("\u21BB"), button -> { + this.resetButton = new TooltipButtonWidget(yaclScreen, widget.getDimension().xLimit(), -50, 20, 20, Component.literal("\u27F2"), null, button -> { option.requestSetDefault(); }); option.addListener((opt, val) -> this.resetButton.active = !opt.isPendingValueDefault() && opt.available()); @@ -539,14 +539,14 @@ public void updateNarration(NarrationElementOutput builder) { public class ListGroupSeparatorEntry extends GroupSeparatorEntry { private final ListOption listOption; - private final TextScaledButtonWidget resetListButton; + private final TooltipButtonWidget resetListButton; private final TooltipButtonWidget addListButton; private ListGroupSeparatorEntry(ListOption group, Screen screen) { super(group, screen); this.listOption = group; - this.resetListButton = new TextScaledButtonWidget(screen, getRowRight() - 20, -50, 20, 20, 1f, Component.literal("\u21BB"), button -> { + this.resetListButton = new TooltipButtonWidget(screen, getRowRight() - 20, -50, 20, 20, Component.literal("\u27F2"), null, button -> { group.requestSetDefault(); }); group.addListener((opt, val) -> this.resetListButton.active = !opt.isPendingValueDefault() && opt.available()); diff --git a/src/main/java/dev/isxander/yacl3/gui/TextScaledButtonWidget.java b/src/main/java/dev/isxander/yacl3/gui/TextScaledButtonWidget.java index c92b16f6..52c40152 100644 --- a/src/main/java/dev/isxander/yacl3/gui/TextScaledButtonWidget.java +++ b/src/main/java/dev/isxander/yacl3/gui/TextScaledButtonWidget.java @@ -5,6 +5,7 @@ import net.minecraft.network.chat.Component; import org.jetbrains.annotations.NotNull; +@Deprecated(forRemoval = true) public class TextScaledButtonWidget extends TooltipButtonWidget { public float textScale; @@ -16,10 +17,4 @@ public TextScaledButtonWidget(Screen screen, int x, int y, int width, int height public TextScaledButtonWidget(Screen screen, int x, int y, int width, int height, float textScale, Component message, OnPress onPress) { this(screen, x, y, width, height, textScale, message, null, onPress); } - - // FIXME: i cannot figure out how to compensate a scale with a translation so for now the reset button is small fuck you - @Override - protected void extractDefaultLabel(ActiveTextCollector output) { - super.extractDefaultLabel(output); - } } diff --git a/src/main/resources/assets/minecraft/font/default.json b/src/main/resources/assets/minecraft/font/default.json new file mode 100644 index 00000000..02a2a09f --- /dev/null +++ b/src/main/resources/assets/minecraft/font/default.json @@ -0,0 +1,13 @@ +{ + "providers": [ + { + "type": "bitmap", + "file": "yet_another_config_lib_v3:font/reset.png", + "ascent": 7, + "height": 8, + "chars": [ + "\u27F2" + ] + } + ] +} diff --git a/src/main/resources/assets/yet_another_config_lib_v3/textures/font/reset.png b/src/main/resources/assets/yet_another_config_lib_v3/textures/font/reset.png new file mode 100644 index 00000000..54436676 Binary files /dev/null and b/src/main/resources/assets/yet_another_config_lib_v3/textures/font/reset.png differ