From e125e80e8c56d6026fd161f5ee01639228d55097 Mon Sep 17 00:00:00 2001 From: Mrbysco Date: Wed, 6 Mar 2024 00:47:10 +0100 Subject: [PATCH] Deprecate SmallerButton --- .../actuallyadditions/mod/inventory/gui/Buttons.java | 1 + .../mod/inventory/gui/FilterSettingsGui.java | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java index ced806756..2909bd4b5 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/Buttons.java @@ -15,6 +15,7 @@ import javax.annotation.Nonnull; public class Buttons { @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 final ResourceLocation resLoc = AssetUtil.getGuiLocation("gui_inputter"); diff --git a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java index 2ba111f16..6aeb821dc 100644 --- a/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java +++ b/src/main/java/de/ellpeck/actuallyadditions/mod/inventory/gui/FilterSettingsGui.java @@ -35,16 +35,18 @@ public class FilterSettingsGui { private final FilterSettings theSettings; - public Buttons.SmallerButton whitelistButton; - public Buttons.SmallerButton modButton; + public Button whitelistButton; + public Button modButton; public FilterSettingsGui(FilterSettings settings, int x, int y, Consumer buttonConsumer, int idOffset) { 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); 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); this.tick();