diff options
author | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-21 00:24:58 +0300 |
---|---|---|
committer | Juuxel <6596629+Juuxel@users.noreply.github.com> | 2020-05-21 00:25:10 +0300 |
commit | e39e805a35261a27c09cc4ad6f88e19eaf0bb01a (patch) | |
tree | 20866d8e76876d579fab2343b578a42ebc83a7c3 /GuiTest | |
parent | d4e2d0b54ffa56f744ecb5630ded432fcde6ca37 (diff) | |
download | LibGui-e39e805a35261a27c09cc4ad6f88e19eaf0bb01a.tar.gz LibGui-e39e805a35261a27c09cc4ad6f88e19eaf0bb01a.tar.bz2 LibGui-e39e805a35261a27c09cc4ad6f88e19eaf0bb01a.zip |
Make TestController have a focus test
Diffstat (limited to 'GuiTest')
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/TestController.java | 22 |
1 files changed, 11 insertions, 11 deletions
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); } } |