Implement menu despawner

This commit is contained in:
2025-10-20 08:07:58 -05:00
parent 845765513d
commit 8b290fdd0d

View File

@@ -46,8 +46,16 @@ pub fn spawn_main_menu(mut commands: Commands) {
});
}
pub fn despawn_main_menu(mut commands: Commands) {
warn!("->> ui.rs: despawn_main_menu() is not implemented.");
/// Despawns the main menu (which is assumed to be the top-most node)
///
/// TODO: Add a marker component, but only in debug builds. A unit test can
/// assert this condition so I don't actually have to check it at runtime
/// on release builds.
pub fn despawn_main_menu(
mut commands: Commands,
top_node: Single<Entity, (With<Node>, Without<ChildOf>)>,
) {
commands.entity(top_node.into_inner()).despawn();
}
/// The basic bundle for generic buttons.