From 01537f7c5e29b7df4e3b6d8cef5880c8ac97a900 Mon Sep 17 00:00:00 2001 From: Juuz <6596629+Juuxel@users.noreply.github.com> Date: Fri, 4 Jun 2021 15:52:32 +0300 Subject: Move scrolling test gui to a test command --- .../java/io/github/cottonmc/test/client/LibGuiTestClient.java | 7 +++++++ .../main/java/io/github/cottonmc/test/client/TestClientGui.java | 9 --------- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'GuiTest/src/main/java') 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); } -- cgit