Deprecate SmallerButton

This commit is contained in:
Mrbysco 2024-03-06 00:47:10 +01:00
parent 9f0a9926ac
commit e125e80e8c
2 changed files with 7 additions and 4 deletions

View file

@ -15,6 +15,7 @@ import javax.annotation.Nonnull;
public class Buttons { public class Buttons {
@OnlyIn(Dist.CLIENT) @OnlyIn(Dist.CLIENT)
@Deprecated(forRemoval = true) //Vanilla's Button class can render small just fine and even allows text scrolling
public static class SmallerButton extends Button { public static class SmallerButton extends Button {
public final ResourceLocation resLoc = AssetUtil.getGuiLocation("gui_inputter"); public final ResourceLocation resLoc = AssetUtil.getGuiLocation("gui_inputter");

View file

@ -35,16 +35,18 @@ public class FilterSettingsGui {
private final FilterSettings theSettings; private final FilterSettings theSettings;
public Buttons.SmallerButton whitelistButton; public Button whitelistButton;
public Buttons.SmallerButton modButton; public Button modButton;
public FilterSettingsGui(FilterSettings settings, int x, int y, Consumer<AbstractButton> buttonConsumer, int idOffset) { public FilterSettingsGui(FilterSettings settings, int x, int y, Consumer<AbstractButton> buttonConsumer, int idOffset) {
this.theSettings = settings; this.theSettings = settings;
this.whitelistButton = new Buttons.SmallerButton( x, y, Component.literal("WH"), true, $ -> buttonClicked(idOffset)); //TODO these need translation keys this.whitelistButton = Button.builder(Component.literal("WH"), $ -> buttonClicked(idOffset))
.bounds(x, y, 16, 12).build();
buttonConsumer.accept(this.whitelistButton); buttonConsumer.accept(this.whitelistButton);
y += 14; y += 14;
this.modButton = new Buttons.SmallerButton( x, y, Component.literal("MO"), true, $ -> buttonClicked(idOffset + 1)); this.modButton = Button.builder(Component.literal("MO"), $ -> buttonClicked(idOffset + 1))
.bounds(x, y, 16, 12).build();
buttonConsumer.accept(this.modButton); buttonConsumer.accept(this.modButton);
this.tick(); this.tick();