docs: add comments to UI components, HUD, and start screen (#65)

This commit is contained in:
demenik
2025-12-10 18:12:36 +01:00
parent 040b2742ca
commit 604bbf5f78
15 changed files with 43 additions and 0 deletions

View File

@@ -4,6 +4,7 @@ use components::*;
pub mod components;
/// Plugin for the main menu screen.
pub struct StartScreenPlugin;
impl Plugin for StartScreenPlugin {
@@ -14,6 +15,7 @@ impl Plugin for StartScreenPlugin {
}
}
/// Spawns the main menu UI.
fn setup(mut commands: Commands) {
commands.spawn((
RootMarker::MainMenu,
@@ -60,6 +62,7 @@ fn setup(mut commands: Commands) {
));
}
/// Handles main menu button interactions.
fn menu(
mut commands: Commands,
mut next_state: ResMut<NextState<AppState>>,
@@ -84,6 +87,7 @@ fn menu(
}
}
/// Cleans up main menu resources.
fn cleanup(mut commands: Commands, query: Query<Entity, With<RootMarker>>) {
for entity in query.iter() {
commands.entity(entity).despawn();