Files
pomomon-garden/src/features/hud/ui/settings.rs

93 lines
3.7 KiB
Rust

use super::super::components::*;
use super::timer_settings::timer_settings;
use crate::prelude::*;
/// Spawns the settings popup.
pub fn open_settings(commands: &mut Commands) {
spawn_popup(
commands,
RootMarker::Settings,
"Spiel Einstellungen",
Node {
width: px(700),
..default()
},
|parent| {
parent.spawn((
Node::vstack(px(10)),
children![
button(
ButtonType::SettingsExit,
ButtonVariant::Secondary,
Node::from_padding(UiRect::all(px(10))),
|color| text("Spiel verlassen", 24.0, color)
),
button(
ButtonType::SettingsSave,
ButtonVariant::Secondary,
Node::from_padding(UiRect::all(px(10))),
|color| text("Spiel speichern", 24.0, color)
),
button(
ButtonType::SettingsAchievements,
ButtonVariant::Secondary,
Node::from_padding(UiRect::all(px(10))),
|color| text("Erfolge", 24.0, color)
),(
Node {
justify_content: JustifyContent::Center,
..Node::hstack(px(30))
},
children![
(
Node {
width: percent(40),
..Node::vstack(px(10))
},
children![
text("Spiel Einstellungen", 18.0, Color::WHITE),
text(
"Tipp: Benutze [Umstellen] um in 10er Schritten zu inkrementieren oder dekrementieren!",
16.0,
Color::WHITE
),
]
),
(
Node {
align_items: AlignItems::Center,
..Node::vstack(px(10))
},
children![
text("Fokus Phase", 12.0, Color::WHITE),
timer_settings(TimerType::Focus)
]
),
(
Node {
align_items: AlignItems::Center,
..Node::vstack(px(10))
},
children![
text("Kurze Pause", 12.0, Color::WHITE),
timer_settings(TimerType::ShortBreak)
]
),
(
Node {
align_items: AlignItems::Center,
..Node::vstack(px(10))
},
children![
text("Lange Pause", 12.0, Color::WHITE),
timer_settings(TimerType::LongBreak)
]
)
],
)
],
));
},
);
}