fix: Update load popup to use UI components

This commit is contained in:
demenik
2025-11-28 12:58:57 +01:00
parent c540e8a8b7
commit 5e113717e4

View File

@@ -45,22 +45,18 @@ pub fn spawn_load_popup(commands: &mut Commands) {
TextFont::from_font_size(40.0),
TextColor(Color::WHITE),
),
(
Button,
pill_button(
ButtonType::PopupClose,
ButtonVariant::Destructive,
Node {
width: px(40.0),
height: px(40.0),
width: px(40),
height: px(40),
justify_content: JustifyContent::Center,
align_items: AlignItems::Center,
..default()
},
BackgroundColor(Color::srgb(0.8, 0.2, 0.2)),
children![(
Text::new("X"),
TextFont::from_font_size(24.0),
TextColor(Color::WHITE),
)]
"X",
24.0
)
],
));
@@ -81,6 +77,7 @@ pub fn spawn_load_popup(commands: &mut Commands) {
ButtonType::SavegameLoad {
savegame_path: savegame.path.clone(),
},
ButtonVariant::Secondary,
Node {
width: percent(100),
height: px(80),
@@ -91,7 +88,8 @@ pub fn spawn_load_popup(commands: &mut Commands) {
padding: UiRect::horizontal(px(10.0)),
..default()
},
BackgroundColor(NORMAL_BUTTON),
BackgroundColor(ButtonVariant::Secondary.normal_background()),
BorderRadius::all(px(10)),
children![
(
Node {
@@ -121,24 +119,21 @@ pub fn spawn_load_popup(commands: &mut Commands) {
)
]
),
(
Button,
pill_button(
ButtonType::SavegameDelete {
savegame_path: savegame.path.clone()
},
ButtonVariant::Destructive,
Node {
width: px(40.0),
height: px(40.0),
width: px(40),
height: px(40),
justify_content: JustifyContent::Center,
align_items: AlignItems::Center,
..default()
},
children![(
Text::new("X"),
TextFont::from_font_size(24.0),
TextColor(Color::srgb(0.9, 0.9, 0.9))
)]
)
"X",
24.0
),
],
));
}