docs: add comments to UI components, HUD, and start screen (#65)
This commit is contained in:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user