diff options
author | Juuz <6596629+Juuxel@users.noreply.github.com> | 2023-11-26 16:27:26 +0200 |
---|---|---|
committer | Juuz <6596629+Juuxel@users.noreply.github.com> | 2023-11-26 16:27:26 +0200 |
commit | c9af717918d1553df6d7d6338a1d4a270f274870 (patch) | |
tree | 845323c4bf9dfa02e69dd8eb7ab92bc5f743ba24 /src/testMod | |
parent | 20e4bcf624d211ac0be0cfad54d795fff2e3fec0 (diff) | |
download | LibGui-c9af717918d1553df6d7d6338a1d4a270f274870.tar.gz LibGui-c9af717918d1553df6d7d6338a1d4a270f274870.tar.bz2 LibGui-c9af717918d1553df6d7d6338a1d4a270f274870.zip |
Fix WItemSlot.iconOnlyPaintedForEmptySlots being flipped
Fixes #229.
Diffstat (limited to 'src/testMod')
-rw-r--r-- | src/testMod/java/io/github/cottonmc/test/TestDescription.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/testMod/java/io/github/cottonmc/test/TestDescription.java b/src/testMod/java/io/github/cottonmc/test/TestDescription.java index fdea211..7c24610 100644 --- a/src/testMod/java/io/github/cottonmc/test/TestDescription.java +++ b/src/testMod/java/io/github/cottonmc/test/TestDescription.java @@ -15,6 +15,7 @@ import io.github.cottonmc.cotton.gui.widget.WGridPanel; import io.github.cottonmc.cotton.gui.widget.WItemSlot; import io.github.cottonmc.cotton.gui.widget.WLabel; import io.github.cottonmc.cotton.gui.widget.WTextField; +import io.github.cottonmc.cotton.gui.widget.WToggleButton; import io.github.cottonmc.cotton.gui.widget.data.Texture; import io.github.cottonmc.cotton.gui.widget.icon.TextureIcon; @@ -49,7 +50,12 @@ public class TestDescription extends SyncedGuiDescription { root.add(new WTextField(Text.literal("Type something...")).setMaxLength(64), 0, 7, 5, 1); root.add(new WLabel(Text.literal("Large Glass-only output:")), 0, 9); - root.add(WItemSlot.outputOf(blockInventory, 0).setOutputFilter(stack -> stack.isOf(Items.GLASS)), 4, 9); + WItemSlot glassOutputSlot = WItemSlot.outputOf(blockInventory, 0).setOutputFilter(stack -> stack.isOf(Items.GLASS)); + glassOutputSlot.setIcon(new TextureIcon(new Identifier("minecraft:textures/block/glass.png"))); + root.add(glassOutputSlot, 4, 9); + WToggleButton glassIconToggle = new WToggleButton(Text.literal("Show glass icon only when empty?")); + glassIconToggle.setOnToggle(glassOutputSlot::setIconOnlyPaintedForEmptySlots); + root.add(glassIconToggle, 0, 10); root.add(WItemSlot.of(blockInventory, 7).setIcon(new TextureIcon(new Identifier("libgui-test", "saddle.png"))).setInputFilter(stack -> stack.isOf(Items.SADDLE)), 7, 10); |