diff --git a/client/src/ui.rs b/client/src/ui.rs index bbade38..d569111 100644 --- a/client/src/ui.rs +++ b/client/src/ui.rs @@ -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, Without)>, +) { + commands.entity(top_node.into_inner()).despawn(); } /// The basic bundle for generic buttons.