From f4df2ae33ae4e1a46d415278d49b7607111c99d8 Mon Sep 17 00:00:00 2001 From: Robert Garrett Date: Wed, 13 Aug 2025 15:36:14 -0500 Subject: [PATCH] Rearrange the main menu components & systems I'm trying to keep things somewhat in order. Plugins, then components, then systems. Within those, they're roughly ordered by game state. --- src/widgets.rs | 53 +++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 26 deletions(-) diff --git a/src/widgets.rs b/src/widgets.rs index d7fa640..f5fe460 100644 --- a/src/widgets.rs +++ b/src/widgets.rs @@ -52,6 +52,11 @@ impl Plugin for PluginGameOver { } } +// Marker component for the title screen UI entity. +// This way, a query for the TitleUI can be used to despawn the title screen +#[derive(Component)] +struct TitleUI; + /// Marker component for things on the get-ready indicator #[derive(Component)] struct OnReadySetGo; @@ -90,6 +95,27 @@ fn despawn(mut commands: Commands, to_despawn: Query>, mut game_state: ResMut>) { if input.just_pressed(KeyCode::Space) { game_state.set(GameState::GetReady);