Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/main/java/dev/isxander/yacl3/gui/OptionListWidget.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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());
Expand Down Expand Up @@ -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());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand All @@ -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);
}
}
13 changes: 13 additions & 0 deletions src/main/resources/assets/minecraft/font/default.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"providers": [
{
"type": "bitmap",
"file": "yet_another_config_lib_v3:font/reset.png",
"ascent": 7,
"height": 8,
"chars": [
"\u27F2"
]
}
]
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading