Skip to content

Commit f490c6f

Browse files
committed
adjust TestGuis
1 parent c987110 commit f490c6f

File tree

1 file changed

+5
-23
lines changed

1 file changed

+5
-23
lines changed

src/main/java/com/cleanroommc/modularui/test/TestGuis.java

Lines changed: 5 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,11 @@ public class TestGuis extends CustomModularScreen {
6767

6868
@Override
6969
public @NotNull ModularPanel buildUI(ModularGuiContext context) {
70-
return buildGridListUI(context);
70+
return buildToggleGridListUI(context);
7171
}
7272

73-
public @NotNull ModularPanel buildGridListUI(ModularGuiContext context) {
73+
public @NotNull ModularPanel buildToggleGridListUI(ModularGuiContext context) {
74+
useTheme(EventHandler.TEST_THEME);
7475
boolean[][] states = new boolean[4][16];
7576
return new ModularPanel("grid_list")
7677
.height(100)
@@ -86,32 +87,13 @@ public class TestGuis extends CustomModularScreen {
8687
return new ToggleButton()
8788
.overlay(GuiTextures.BOOKMARK)
8889
.value(new BoolValue.Dynamic(() -> states[i][j], val -> states[i][j] = val))
89-
.size(8)
90+
.size(10)
9091
.margin(1)
91-
.debugName("G" + i + ",I" + j);
92+
.debugName("G:" + i + ",W:" + j);
9293
})));
9394

9495
}
9596

96-
public @NotNull ModularPanel buildToggleUI(ModularGuiContext context) {
97-
useTheme(EventHandler.TEST_THEME);
98-
boolean[] states = new boolean[60];
99-
return new ModularPanel("toggle")
100-
.size(150)
101-
.padding(7)
102-
.child(new ListWidget<>()
103-
.sizeRel(1f)
104-
.children(10, i -> Flow.row()
105-
.coverChildren()
106-
.children(6, j -> {
107-
final int index = i * 6 + j;
108-
return new ToggleButton()
109-
.overlay(GuiTextures.BOOKMARK)
110-
.value(new BoolValue.Dynamic(() -> states[index], val -> states[index] = val))
111-
.margin(2);
112-
})));
113-
}
114-
11597
public @NotNull ModularPanel buildAnimationUI(ModularGuiContext context) {
11698
IWidget widget = GuiTextures.MUI_LOGO.asWidget().size(20).pos(65, 65);
11799
Animator animator = new Animator()

0 commit comments

Comments
 (0)