diff options
Diffstat (limited to 'GuiTest/src')
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java | 7 | ||||
-rw-r--r-- | GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java | 9 |
2 files changed, 7 insertions, 9 deletions
diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java b/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java index 5fbc4b0..b45145e 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java @@ -40,6 +40,13 @@ public class LibGuiTestClient implements ClientModInitializer { }); return 0; })) + .then(literal("scrolling").executes(context -> { + var client = context.getSource().getClient(); + client.send(() -> { + client.openScreen(new CottonClientScreen(new ScrollingTestGui())); + }); + return 0; + })) ); } diff --git a/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java b/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java index 140e27e..56b399c 100644 --- a/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java +++ b/GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java @@ -2,16 +2,13 @@ package io.github.cottonmc.test.client; import net.fabricmc.api.EnvType; import net.fabricmc.api.Environment; -import net.minecraft.client.MinecraftClient; import net.minecraft.client.util.math.MatrixStack; import net.minecraft.text.LiteralText; import net.minecraft.util.Identifier; -import io.github.cottonmc.cotton.gui.client.CottonClientScreen; import io.github.cottonmc.cotton.gui.client.LightweightGuiDescription; import io.github.cottonmc.cotton.gui.client.ScreenDrawing; import io.github.cottonmc.cotton.gui.widget.TooltipBuilder; -import io.github.cottonmc.cotton.gui.widget.WButton; import io.github.cottonmc.cotton.gui.widget.WGridPanel; import io.github.cottonmc.cotton.gui.widget.WLabel; import io.github.cottonmc.cotton.gui.widget.WSlider; @@ -106,12 +103,6 @@ public class TestClientGui extends LightweightGuiDescription { this.b = i; updateCol(col); }); - - WButton openOther = new WButton(new LiteralText("Go to scrolling")); - openOther.setOnClick(() -> { - MinecraftClient.getInstance().openScreen(new CottonClientScreen(new ScrollingTestGui())); - }); - root.add(openOther, 0, 7, 4, 1); root.validate(this); } |