From 74f963bbb30764db0dbc2c243c2799cd270ef8f5 Mon Sep 17 00:00:00 2001 From: Mikerooni <139889766+mikerooni@users.noreply.github.com> Date: Sat, 2 Dec 2023 23:44:27 +0100 Subject: [PATCH] fix: button position & icon for item filter mode (in filter covers) (#603) --- .../gtceu/common/cover/ItemFilterCover.java | 11 +++++----- .../common/cover/data/ItemFilterMode.java | 19 ++++++++++-------- .../gui/icon/item_filter_mode/filter_both.png | Bin 0 -> 329 bytes .../icon/item_filter_mode/filter_extract.png | Bin 0 -> 289 bytes .../icon/item_filter_mode/filter_insert.png | Bin 0 -> 290 bytes 5 files changed, 16 insertions(+), 14 deletions(-) create mode 100644 common/src/main/resources/assets/gtceu/textures/gui/icon/item_filter_mode/filter_both.png create mode 100644 common/src/main/resources/assets/gtceu/textures/gui/icon/item_filter_mode/filter_extract.png create mode 100644 common/src/main/resources/assets/gtceu/textures/gui/icon/item_filter_mode/filter_insert.png diff --git a/common/src/main/java/com/gregtechceu/gtceu/common/cover/ItemFilterCover.java b/common/src/main/java/com/gregtechceu/gtceu/common/cover/ItemFilterCover.java index bbc8fb9fc9..0b2384e456 100644 --- a/common/src/main/java/com/gregtechceu/gtceu/common/cover/ItemFilterCover.java +++ b/common/src/main/java/com/gregtechceu/gtceu/common/cover/ItemFilterCover.java @@ -58,12 +58,11 @@ public boolean canAttach() { @Override public Widget createUIWidget() { - final var group = new WidgetGroup(0, 0, 176, 80); - group.addWidget(new LabelWidget(5, 3, attachItem.getDescriptionId())); - group.addWidget(new EnumSelectorWidget<>(10, 20, 110, 20, - ItemFilterMode.VALUES, ItemFilterMode.FILTER_INSERT, - this::setFilterMode)); - group.addWidget(getItemFilter().openConfigurator((176 - 80) / 2, (60 - 55) / 2 + 15)); + final var group = new WidgetGroup(0, 0, 176, 85); + group.addWidget(new LabelWidget(7, 5, attachItem.getDescriptionId())); + group.addWidget(new EnumSelectorWidget<>(7, 61, 18, 18, + ItemFilterMode.VALUES, ItemFilterMode.FILTER_INSERT, this::setFilterMode)); + group.addWidget(getItemFilter().openConfigurator(30, 25)); return group; } diff --git a/common/src/main/java/com/gregtechceu/gtceu/common/cover/data/ItemFilterMode.java b/common/src/main/java/com/gregtechceu/gtceu/common/cover/data/ItemFilterMode.java index 0c3a7c6df0..de302e8233 100644 --- a/common/src/main/java/com/gregtechceu/gtceu/common/cover/data/ItemFilterMode.java +++ b/common/src/main/java/com/gregtechceu/gtceu/common/cover/data/ItemFilterMode.java @@ -1,18 +1,21 @@ package com.gregtechceu.gtceu.common.cover.data; -import com.gregtechceu.gtceu.api.gui.GuiTextures; import com.gregtechceu.gtceu.api.gui.widget.EnumSelectorWidget; import com.lowdragmc.lowdraglib.gui.texture.IGuiTexture; -import com.lowdragmc.lowdraglib.gui.texture.TextTexture; +import com.lowdragmc.lowdraglib.gui.texture.ResourceTexture; +import net.minecraft.MethodsReturnNonnullByDefault; +import javax.annotation.ParametersAreNonnullByDefault; + +@MethodsReturnNonnullByDefault +@ParametersAreNonnullByDefault public enum ItemFilterMode implements EnumSelectorWidget.SelectableEnum { - FILTER_INSERT("cover.filter.mode.filter_insert"), - FILTER_EXTRACT("cover.filter.mode.filter_extract"), - FILTER_BOTH("cover.filter.mode.filter_both"); + FILTER_INSERT("filter_insert"), + FILTER_EXTRACT("filter_extract"), + FILTER_BOTH("filter_both"); public static final ItemFilterMode[] VALUES = values(); - private static final float OFFSET = 1.0f / VALUES.length; public final String localeName; @@ -22,11 +25,11 @@ public enum ItemFilterMode implements EnumSelectorWidget.SelectableEnum { @Override public String getTooltip() { - return this.localeName; + return "cover.filter.mode." + this.localeName; } @Override public IGuiTexture getIcon() { - return new TextTexture(this.localeName); + return new ResourceTexture("gtceu:textures/gui/icon/item_filter_mode/" + localeName + ".png"); } } diff --git a/common/src/main/resources/assets/gtceu/textures/gui/icon/item_filter_mode/filter_both.png b/common/src/main/resources/assets/gtceu/textures/gui/icon/item_filter_mode/filter_both.png new file mode 100644 index 0000000000000000000000000000000000000000..e2f3be1d75b8cac7b2f0c616ca607bc78c72d977 GIT binary patch literal 329 zcmV-P0k-~$P)ZmM2xm68-{j&iPsAf|V)07K^f&qe74+4`br4NDD2B0M48r{D?K z1c&TYPe=lsI*IJTR;b;<^wgeRO&kk}Uiwr2M)(cxOuK9a5;3-OSroqN=upp>Ece zl1cMc+)sMa`>swUk0W!hnc{?bTfaU!nIy20=cvnC$NsOG)-_qxP{&ueQV}-sirs`fGqtz^onY lMt?=ByH;;ZZAg5;RL5og{LanRdqD3oc)I$ztaD0e0st#{bA12+ literal 0 HcmV?d00001 diff --git a/common/src/main/resources/assets/gtceu/textures/gui/icon/item_filter_mode/filter_insert.png b/common/src/main/resources/assets/gtceu/textures/gui/icon/item_filter_mode/filter_insert.png new file mode 100644 index 0000000000000000000000000000000000000000..122e99e49976504d9c2581fa357b801f5328ddf3 GIT binary patch literal 290 zcmV+-0p0$IP)t-l7V~itTL#*Tc?lH?!j{ZF-D;Tv~cB> zBW!*X7CmUnFLMdnqC`{5z^{R4AhGRAglfA o1Tbs#Ee`i3W-Ac$!vJgG0h|as=P(T(%>V!Z07*qoM6N<$g5EQCy#N3J literal 0 HcmV?d00001