aboutsummaryrefslogtreecommitdiff
path: root/GuiTest/src/main/java
diff options
context:
space:
mode:
authorJuuz <6596629+Juuxel@users.noreply.github.com>2021-06-04 15:52:32 +0300
committerJuuz <6596629+Juuxel@users.noreply.github.com>2021-06-04 15:52:32 +0300
commit01537f7c5e29b7df4e3b6d8cef5880c8ac97a900 (patch)
treed4ff6eb5667caff25689d9e2b91a161a3bbf4969 /GuiTest/src/main/java
parentdd0c2b853dc0c73a4bfd2847bde5f3009682bd37 (diff)
downloadLibGui-01537f7c5e29b7df4e3b6d8cef5880c8ac97a900.tar.gz
LibGui-01537f7c5e29b7df4e3b6d8cef5880c8ac97a900.tar.bz2
LibGui-01537f7c5e29b7df4e3b6d8cef5880c8ac97a900.zip
Move scrolling test gui to a test command
Diffstat (limited to 'GuiTest/src/main/java')
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/client/LibGuiTestClient.java7
-rw-r--r--GuiTest/src/main/java/io/github/cottonmc/test/client/TestClientGui.java9
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);
}