MenuDisplaySystem Class Template
Controls menu visibility based on game and match state. More...
Declaration
Public Member Typedefs Index
template <typename StateLft, typename StateRgt> | |
| using | EngineRoleTag = helios::engine::common::tags::SystemRole |
Public Constructors Index
template <typename StateLft, typename StateRgt> | |
| MenuDisplaySystem (CombinedStateToIdMapPair< StateLft, StateRgt, MenuId > stateToMenuMap) | |
|
Constructs the system with a state-to-menu policy. More... | |
Public Member Functions Index
template <typename StateLft, typename StateRgt> | |
| void | update (helios::engine::runtime::world::UpdateContext &updateContext) noexcept |
|
Updates menu visibility based on current state. More... | |
Protected Member Functions Index
template <typename StateLft, typename StateRgt> | |
| void | focusMenu (helios::engine::runtime::world::UpdateContext &updateContext, const MenuId menuId, View< MenuComponent > &components) |
|
Focuses the first item of a menu. More... | |
Private Member Functions Index
template <typename StateLft, typename StateRgt> | |
| void | showMenu (const MenuId menuId, const bool show, View< MenuComponent > &components) |
|
Shows or hides a menu by ID. More... | |
Private Member Attributes Index
template <typename StateLft, typename StateRgt> | |
| std::vector< MenuId > | prevMenuIds_ |
|
Previously active menu IDs for change detection. More... | |
template <typename StateLft, typename StateRgt> | |
| CombinedStateToIdMapPair< StateLft, StateRgt, MenuId > | stateToMenuMap_ |
|
Policy mapping states to menu IDs. More... | |
template <typename StateLft, typename StateRgt> | |
| std::vector< GameObject > | inactiveItems_ |
|
Cache for inactive focused items to be cleaned up. More... | |
Description
Controls menu visibility based on game and match state.
Uses a CombinedStateToIdMapPair to determine which menus should be active for the current state combination. Automatically shows/hides menus and manages focus when states change.
## Behavior
- Menus not associated with the current state are hidden
- Menus associated with the current state are shown
- When no item has focus, the first menu's default item is focused
- Inactive focused items have their UiFocusComponent removed
- See Also
- See Also
- See Also
Definition at line 63 of file MenuDisplaySystem.ixx.
Public Member Typedefs
EngineRoleTag
|
Definition at line 120 of file MenuDisplaySystem.ixx.
Public Constructors
MenuDisplaySystem()
| inline explicit |
Constructs the system with a state-to-menu policy.
- Parameters
-
stateToMenuMap Policy mapping game/match states to menu IDs.
Definition at line 128 of file MenuDisplaySystem.ixx.
Public Member Functions
update()
| inline noexcept |
Updates menu visibility based on current state.
Queries the current game and match state, then: 1. Hides menus that are no longer active 2. Shows menus for the current state 3. Ensures at least one menu item has focus
- Parameters
-
updateContext The current frame's update context.
Definition at line 144 of file MenuDisplaySystem.ixx.
Reference helios::engine::modules::ui::widgets::systems::MenuDisplaySystem< StateLft, StateRgt >::focusMenu.
Protected Member Functions
focusMenu()
| inline protected |
Focuses the first item of a menu.
- Parameters
-
menuId The menu to focus.
components View of all MenuComponent entities.
Definition at line 103 of file MenuDisplaySystem.ixx.
Reference helios::engine::runtime::world::UpdateContext::find.
Referenced by helios::engine::modules::ui::widgets::systems::MenuDisplaySystem< StateLft, StateRgt >::update.
Private Member Functions
showMenu()
| inline |
Shows or hides a menu by ID.
- Parameters
-
menuId The menu to show/hide.
show True to show, false to hide.
components View of all MenuComponent entities.
Definition at line 88 of file MenuDisplaySystem.ixx.
Private Member Attributes
inactiveItems_
|
Cache for inactive focused items to be cleaned up.
Definition at line 79 of file MenuDisplaySystem.ixx.
prevMenuIds_
|
Previously active menu IDs for change detection.
Definition at line 69 of file MenuDisplaySystem.ixx.
stateToMenuMap_
|
Policy mapping states to menu IDs.
Definition at line 74 of file MenuDisplaySystem.ixx.
The documentation for this class was generated from the following file:
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.