Some refactoring

This commit is contained in:
Frank 2022-07-17 01:21:33 +02:00
parent ef34bc9981
commit 4aed7c6285
17 changed files with 124 additions and 83 deletions

View file

@ -83,7 +83,7 @@ public class MainScreen extends LayoutScreenWithIcon {
@Override
protected LayoutComponent initContent() {
VerticalStack content = new VerticalStack(Value.fit(), Value.fit());
VerticalStack content = new VerticalStack(Value.fit(), Value.fit()).setDebugName("content");
Configs.GENERATOR_CONFIG.getAllOptions()
.stream()
@ -101,11 +101,9 @@ public class MainScreen extends LayoutScreenWithIcon {
.forEach(o -> addRow(content, Configs.CLIENT_CONFIG, o));
VerticalStack grid = new VerticalStack(Value.fill(), Value.fill());
VerticalStack grid = new VerticalStack(Value.fill(), Value.fill()).setDebugName("main grid");
grid.addScrollable(content);
grid.addSpacer(8);
HorizontalStack row = grid.addRow();
row.addFiller();
grid.addButton(Value.fit(), Value.fit(), CommonComponents.GUI_DONE, (button) -> {
Configs.CLIENT_CONFIG.saveChanges();
Configs.GENERATOR_CONFIG.saveChanges();

View file

@ -24,7 +24,7 @@ public class TestScreen extends LayoutScreen {
}
@Override
protected LayoutComponent<?> initContent() {
protected LayoutComponent<?, ?> initContent() {
VerticalStack rows = new VerticalStack(Value.fit(), Value.fitOrFill());
rows.addFiller();
@ -94,8 +94,6 @@ public class TestScreen extends LayoutScreen {
Component.literal("test"),
(bt) -> {
System.out.println("clicked test");
},
(bt, pose, x, y) -> {
}
).centerHorizontal()
);
@ -105,8 +103,6 @@ public class TestScreen extends LayoutScreen {
Component.literal("Hello World"),
(bt) -> {
System.out.println("clicked hello");
},
(bt, pose, x, y) -> {
}
).centerHorizontal()
);