Skip to main content

concinnity_core/components/
screen_command.rs

1// src/components/screen_command.rs
2
3use crate::ecs::asset_id::AssetId;
4
5/// Runtime-only event sent by UiInputSystem when a `screen:*` action fires.
6/// UiInputSystem reads these from its `Events<ScreenCommand>` queue on the next
7/// step and applies the stack transition. World authors never declare this type
8/// directly.
9#[derive(Debug, Clone, Default)]
10pub enum ScreenCommand {
11    /// Replace the top of the stack (menu navigation).
12    Show(AssetId),
13    /// Pop the top of the stack, revealing what was beneath.
14    #[default]
15    Hide,
16    /// Pop if the screen is topmost, push it otherwise.
17    Toggle(AssetId),
18    /// Push on top of whatever is already showing.
19    Push(AssetId),
20    /// Empty the stack (a scene change dismisses every open screen).
21    Clear,
22}