Skip to content

Commit

Permalink
Improve look of the config screen
Browse files Browse the repository at this point in the history
Fixes #171. Also removed the test text field.
  • Loading branch information
Juuxel committed Aug 16, 2022
1 parent ca5035e commit 167037e
Showing 1 changed file with 4 additions and 25 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,14 +10,12 @@
import io.github.cottonmc.cotton.gui.impl.client.LibGuiClient;
import io.github.cottonmc.cotton.gui.widget.WButton;
import io.github.cottonmc.cotton.gui.widget.WGridPanel;
import io.github.cottonmc.cotton.gui.widget.WTextField;
import io.github.cottonmc.cotton.gui.widget.WToggleButton;
import io.github.cottonmc.cotton.gui.widget.data.Insets;

public class ConfigGui extends LightweightGuiDescription {

public ConfigGui(Screen previous) {
WGridPanel root = new WGridPanel();
WGridPanel root = new WGridPanel(20);
root.setInsets(Insets.ROOT_PANEL);
setRootPanel(root);

Expand All @@ -29,36 +27,17 @@ public void onToggle(boolean on) {
}
};
darkmodeButton.setToggle(LibGuiClient.config.darkMode);
root.add(darkmodeButton, 0, 2, 6, 1);

WTextField testField = new WTextField();
testField.setSuggestion(Text.literal("test"));
root.add(testField, 0, 3, 4, 1);

/*
WSlider verticalSlider = new WSlider(-100, 100, Axis.VERTICAL);
verticalSlider.setDraggingFinishedListener(() -> System.out.println("Mouse released"));
verticalSlider.setValueChangeListener(System.out::println);
WLabeledSlider horizontalSlider = new WLabeledSlider(0, 500);
horizontalSlider.setLabelUpdater(value -> new LiteralText(value + "!"));
horizontalSlider.setDraggingFinishedListener(() -> System.out.println("Mouse released"));
horizontalSlider.setValue(250);
root.add(verticalSlider, 6, 0, 1, 3);
root.add(horizontalSlider, 1, 4, 4, 1);
*/
root.add(darkmodeButton, 0, 1, 6, 1);

root.add(new WKirbSprite(), 5, 4);
root.add(new WKirbSprite(), 5, 2);

WButton doneButton = new WButton(ScreenTexts.DONE);
doneButton.setOnClick(()->{
MinecraftClient.getInstance().setScreen(previous);
});
root.add(doneButton, 0, 5, 3, 1);
root.add(doneButton, 0, 3, 3, 1);

root.setBackgroundPainter(BackgroundPainter.VANILLA);
root.setSize(7*18, 6*18);

root.validate(this);
}
Expand Down

0 comments on commit 167037e

Please sign in to comment.