diff --git a/flake.nix b/flake.nix index ab6c9df..59059c3 100644 --- a/flake.nix +++ b/flake.nix @@ -24,10 +24,10 @@ rust-toolchain = with fenix.packages.${system}; combine [ - stable.rustc - stable.cargo - stable.rust-src - stable.rust-analyzer + beta.rustc + beta.cargo + beta.rust-src + beta.rust-analyzer ]; bevyDeps = with pkgs; [ diff --git a/src/features/hud/components.rs b/src/features/hud/components.rs index 6d93783..9de7636 100644 --- a/src/features/hud/components.rs +++ b/src/features/hud/components.rs @@ -15,7 +15,6 @@ pub enum TextType { #[derive(Component)] pub enum ButtonType { SettingsOpen, - SettingsClose, SettingsExit, SettingsSave, SettingsTimerChange { diff --git a/src/features/hud/mod.rs b/src/features/hud/mod.rs index 4d358dd..a753243 100644 --- a/src/features/hud/mod.rs +++ b/src/features/hud/mod.rs @@ -1,6 +1,5 @@ use crate::features::phase::components::TimerSettings; use crate::features::savegame::messages::SavegameDumpMessage; -use crate::features::ui::messages::ClosePopupMessage; use crate::features::{inventory, shop}; use crate::prelude::*; use components::*; @@ -17,27 +16,11 @@ impl Plugin for HudPlugin { app.add_systems(OnExit(AppState::GameScreen), cleanup); app.add_systems( Update, - (update_status, buttons, update_timer_settings, close_popup) - .run_if(in_state(AppState::GameScreen)), + (update_status, buttons, update_timer_settings).run_if(in_state(AppState::GameScreen)), ); } } -fn close_popup( - mut commands: Commands, - mut close_popup_reader: MessageReader, - root_query: Query<(Entity, &RootMarker)>, -) { - for _ in close_popup_reader.read() { - for (entity, root) in root_query.iter() { - match *root { - RootMarker::Settings => commands.entity(entity).despawn(), - _ => {} - } - } - } -} - fn setup(mut commands: Commands) { commands.spawn(( RootMarker::Status, @@ -61,28 +44,19 @@ fn setup(mut commands: Commands) { button( shop::components::ButtonType::ShopOpen, ButtonVariant::Secondary, - Node { - padding: UiRect::all(px(10)), - ..default() - }, + Node::from_padding(UiRect::all(px(10))), |color| text("Shop [P]", 16.0, color) ), button( inventory::components::ButtonType::InventoryOpen, ButtonVariant::Secondary, - Node { - padding: UiRect::all(px(10)), - ..default() - }, + Node::from_padding(UiRect::all(px(10))), |color| text("Inventar", 16.0, color) ), button( ButtonType::SettingsOpen, ButtonVariant::Secondary, - Node { - padding: UiRect::all(px(10)), - ..default() - }, + Node::from_padding(UiRect::all(px(10))), |color| text("Einstellungen", 16.0, color) ) ], @@ -106,7 +80,6 @@ fn update_status(phase_res: Res, mut text_query: Query<(&mut Text, fn buttons( mut commands: Commands, mut interaction_query: Query<(&Interaction, &ButtonType), (Changed, With