diff --git a/src/main/java/de/fullrisk/citrusDev/UI/Module_FPS.java b/src/main/java/de/fullrisk/citrusDev/UI/Module_FPS.java index 4bafc5b..5683db0 100644 --- a/src/main/java/de/fullrisk/citrusDev/UI/Module_FPS.java +++ b/src/main/java/de/fullrisk/citrusDev/UI/Module_FPS.java @@ -15,7 +15,7 @@ public class Module_FPS { private static LabelComponent fpsLabel; private static FlowLayout fpsContainer; static boolean toggle = true; - private static boolean shown = false; // tracks current visible/built state + private static boolean shown = false; private static final Surface GLASS_PANEL = Surface.blur(5f, 15f) .and(Surface.flat(0x40FFFFFF)); @@ -30,7 +30,6 @@ public class Module_FPS { fpsContainer.verticalAlignment(VerticalAlignment.CENTER); fpsContainer.horizontalAlignment(HorizontalAlignment.CENTER); fpsContainer.positioning(Positioning.absolute(10, 10)); - // start hidden; tick()/first update will populate it fpsContainer.padding(Insets.of(0)); } return fpsContainer; @@ -41,7 +40,6 @@ public class Module_FPS { if (fpsContainer == null) return; if (toggle && !shown) { - // turning on: restore the panel chrome and label fpsContainer.surface(GLASS_PANEL); fpsContainer.padding(Insets.of(6)); fpsContainer.child(fpsLabel); diff --git a/src/main/java/de/fullrisk/citrusDev/UI/MyScreen.java b/src/main/java/de/fullrisk/citrusDev/UI/MyScreen.java index e8cfb7a..6bb4ed4 100644 --- a/src/main/java/de/fullrisk/citrusDev/UI/MyScreen.java +++ b/src/main/java/de/fullrisk/citrusDev/UI/MyScreen.java @@ -294,7 +294,51 @@ public class MyScreen extends BaseOwoScreen { } private void buildSettingsPanel(FlowLayout content) { - content.child(UIComponents.label(Component.literal("Settings tab - coming soon"))); + content.child(UIComponents.label(Component.literal("Settings"))); + content.child(makeCyclingButton()); + } + + private record ButtonState(String label, Runnable onSelect) {} + + private FlowLayout makeCyclingButton() { // muss ich noch fertig machen, bitte es geht mir nd gut, es ist 23:00 + List states = List.of( + new ButtonState("Off", () -> { + }), + new ButtonState("Low", () -> { + }), + new ButtonState("Medium", () -> { + }), + new ButtonState("High", () -> { + + }) + ); + + int[] currentIndex = {0}; + + FlowLayout button = UIContainers.verticalFlow(Sizing.fixed(60), Sizing.fixed(20)); + button.verticalAlignment(VerticalAlignment.CENTER); + button.horizontalAlignment(HorizontalAlignment.CENTER); + button.surface(FLAT); + + var label = UIComponents.label(Component.literal(states.get(0).label())) + .color(Color.ofRgb(0xFFFFFF)); + button.child(label); + + button.mouseDown().subscribe((click, doubled) -> { + Minecraft.getInstance().getSoundManager().play( + SimpleSoundInstance.forUI(SoundEvents.UI_BUTTON_CLICK.value(), 2.0F, 2) + ); + + currentIndex[0] = (currentIndex[0] + 1) % states.size(); + ButtonState newState = states.get(currentIndex[0]); + + label.text(Component.literal(newState.label())); + newState.onSelect().run(); + + return true; + }); + + return button; } private FlowLayout makeSmallButton(Surface baseSurface, Identifier texture, Runnable onClick) { diff --git a/src/main/resources/assets/citrus-dev/textures/icons/citrus-logo.png b/src/main/resources/assets/citrus-dev/textures/icons/citrus-logo.png new file mode 100644 index 0000000..98a06ab Binary files /dev/null and b/src/main/resources/assets/citrus-dev/textures/icons/citrus-logo.png differ diff --git a/src/main/resources/assets/citrus-dev/textures/icons/settings.png b/src/main/resources/assets/citrus-dev/textures/icons/settings.png new file mode 100644 index 0000000..c618f76 Binary files /dev/null and b/src/main/resources/assets/citrus-dev/textures/icons/settings.png differ