From e39e805a35261a27c09cc4ad6f88e19eaf0bb01a Mon Sep 17 00:00:00 2001 From: Juuxel <6596629+Juuxel@users.noreply.github.com> Date: Thu, 21 May 2020 00:24:58 +0300 Subject: Make TestController have a focus test --- .../io/github/cottonmc/test/TestController.java | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'GuiTest') diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/TestController.java b/GuiTest/src/main/java/io/github/cottonmc/test/TestController.java index 1d3c955..267c49f 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/TestController.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/TestController.java @@ -1,10 +1,8 @@ package io.github.cottonmc.test; import io.github.cottonmc.cotton.gui.CottonInventoryController; -import io.github.cottonmc.cotton.gui.widget.WButton; -import io.github.cottonmc.cotton.gui.widget.WGridPanel; -import io.github.cottonmc.cotton.gui.widget.WItemSlot; -import io.github.cottonmc.cotton.gui.widget.WPlayerInvPanel; +import io.github.cottonmc.cotton.gui.widget.*; +import io.github.cottonmc.cotton.gui.widget.data.Axis; import net.minecraft.entity.player.PlayerInventory; import net.minecraft.screen.ScreenHandlerContext; import net.minecraft.text.LiteralText; @@ -17,14 +15,16 @@ public class TestController extends CottonInventoryController { WGridPanel root = (WGridPanel)this.getRootPanel(); root.add(WItemSlot.of(blockInventory, 0, 4, 1), 0, 1); + + root.add(new WButton(new LiteralText("Button A")), 0, 3, 4, 1); + root.add(new WButton(new LiteralText("Button B")), 5, 3, 4, 1); + root.add(new WButton(new LiteralText("Button C")), 0, 5, 4, 1); + root.add(new WButton(new LiteralText("Button D")), 5, 5, 4, 1); + root.add(new WTextField(new LiteralText("Type something...")), 0, 7, 5, 1); + + root.add(createPlayerInventoryPanel(), 0, 9); - WButton button = new WButton(new LiteralText("Test Button")); - root.add(button, 0, 3, 5, 1); - - - root.add(createPlayerInventoryPanel(), 0, 5); - - + this.getRootPanel().validate(this); } } -- cgit