Rename main menu marker to "MarkerMainMenu"

This commit is contained in:
2025-08-13 15:38:53 -05:00
parent f4df2ae33a
commit 4102446e90

View File

@@ -15,7 +15,7 @@ pub struct PluginGameMenu;
impl Plugin for PluginGameMenu { impl Plugin for PluginGameMenu {
fn build(&self, app: &mut App) { fn build(&self, app: &mut App) {
app.add_systems(OnEnter(GameState::TitleScreen), spawn_menu) app.add_systems(OnEnter(GameState::TitleScreen), spawn_menu)
.add_systems(OnExit(GameState::TitleScreen), despawn::<TitleUI>) .add_systems(OnExit(GameState::TitleScreen), despawn::<MarkerMainMenu>)
.add_systems( .add_systems(
Update, Update,
handle_spacebar.run_if(in_state(GameState::TitleScreen)), handle_spacebar.run_if(in_state(GameState::TitleScreen)),
@@ -55,7 +55,7 @@ impl Plugin for PluginGameOver {
// Marker component for the title screen UI entity. // Marker component for the title screen UI entity.
// This way, a query for the TitleUI can be used to despawn the title screen // This way, a query for the TitleUI can be used to despawn the title screen
#[derive(Component)] #[derive(Component)]
struct TitleUI; struct MarkerMainMenu;
/// Marker component for things on the get-ready indicator /// Marker component for things on the get-ready indicator
#[derive(Component)] #[derive(Component)]
@@ -98,7 +98,7 @@ fn despawn<T: Component>(mut commands: Commands, to_despawn: Query<Entity, With<
fn spawn_menu(mut commands: Commands) { fn spawn_menu(mut commands: Commands) {
commands commands
.spawn(( .spawn((
TitleUI, MarkerMainMenu,
Node { Node {
flex_direction: FlexDirection::Column, flex_direction: FlexDirection::Column,
..Default::default() ..Default::default()