aboutsummaryrefslogtreecommitdiff
path: root/GuiTest
diff options
context:
space:
mode:
authorfrqnny <45723631+frqnny@users.noreply.github.com>2021-06-22 12:19:07 -0400
committerGitHub <noreply@github.com>2021-06-22 19:19:07 +0300
commita8a2d36a9bb32fe15a391a65666717ed26e0eb70 (patch)
tree43ed80f3884fce5b9ad9a2d3d2718f5280cfab31 /GuiTest
parent8d7ddd12a2226a54533b68cdc9294e6118585c3b (diff)
downloadLibGui-a8a2d36a9bb32fe15a391a65666717ed26e0eb70.tar.gz
LibGui-a8a2d36a9bb32fe15a391a65666717ed26e0eb70.tar.bz2
LibGui-a8a2d36a9bb32fe15a391a65666717ed26e0eb70.zip
Add Icon API to WItemSlot (#119)
* Add Icon API to WItemSlot * Fix checkstyle * Clean up test description
Diffstat (limited to 'GuiTest')
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java4
-rw-r--r--GuiTest/src/main/resources/assets/libgui-test/saddle.pngbin0 -> 179 bytes
2 files changed, 4 insertions, 0 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java b/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java
index e6c3564..ce579ae 100644
--- a/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java
+++ b/GuiTest/src/main/java/io/github/cottonmc/test/TestDescription.java
@@ -4,6 +4,8 @@ import io.github.cottonmc.cotton.gui.SyncedGuiDescription;
import io.github.cottonmc.cotton.gui.networking.NetworkSide;
import io.github.cottonmc.cotton.gui.networking.ScreenNetworking;
import io.github.cottonmc.cotton.gui.widget.*;
+import io.github.cottonmc.cotton.gui.widget.icon.TextureIcon;
+
import net.minecraft.entity.player.PlayerInventory;
import net.minecraft.screen.ScreenHandlerContext;
import net.minecraft.screen.ScreenHandlerType;
@@ -38,6 +40,8 @@ public class TestDescription extends SyncedGuiDescription {
root.add(new WLabel(new LiteralText("Large slot:")), 0, 9);
root.add(WItemSlot.outputOf(blockInventory, 0), 4, 9);
+ root.add(WItemSlot.of(blockInventory, 7).setIcon(new TextureIcon(new Identifier("libgui-test", "saddle.png"))), 7, 9);
+
root.add(createPlayerInventoryPanel(), 0, 11);
System.out.println(root.toString());
diff --git a/GuiTest/src/main/resources/assets/libgui-test/saddle.png b/GuiTest/src/main/resources/assets/libgui-test/saddle.png
new file mode 100644
index 0000000..84394b9
--- /dev/null
+++ b/GuiTest/src/main/resources/assets/libgui-test/saddle.png
Binary files differ