MenuDisplaySystem.ixx File
System for controlling menu visibility based on game state. More...
Included Headers
#include <iostream>
#include <algorithm>
#include <vector>
#include <cassert>
#include <helios/helios_config.h>
#include <helios.engine.common.tags.SystemRole>
#include <helios.math>
#include <helios.engine.mechanics.gamestate.types>
#include <helios.engine.state.CombinedStateToIdMapPair>
#include <helios.engine.modules.ui.widgets.components.MenuComponent>
#include <helios.engine.modules.ui.widgets.types.MenuId>
#include <helios.engine.mechanics.match.types>
#include <helios.engine.runtime.world>
#include <helios.engine.modules.rendering.model.components.ModelAabbComponent>
#include <helios.engine.modules.ui.widgets.components.UiFocusComponent>
#include <helios.engine.ecs>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | modules |
|
Domain-specific components and systems. More... | |
| namespace | ui |
|
User interface components and systems for game entities. More... | |
| namespace | widgets |
|
UI widget components and systems. More... | |
| namespace | systems |
|
UI widget processing systems. More... | |
Classes Index
| class | MenuDisplaySystem<StateLft, StateRgt> |
|
Controls menu visibility based on game and match state. More... | |
Description
System for controlling menu visibility based on game state.
File Listing
The file content with the documentation metadata removed is:
32using namespace helios::engine::modules::ui::widgets::types;
33using namespace helios::engine::state;
34using namespace helios::engine::mechanics::gamestate::types;
35using namespace helios::engine::mechanics::match::types;
36using namespace helios::engine::ecs;
37using namespace helios::engine::modules::ui::widgets::components;
38using namespace helios::engine::runtime::world;
42export namespace helios::engine::modules::ui::widgets::systems {
63 class MenuDisplaySystem {
74 CombinedStateToIdMapPair<StateLft, StateRgt, MenuId> stateToMenuMap_;
88 void showMenu(const MenuId menuId, const bool show, View<MenuComponent>& components) {
89 for (auto [entity, mc] : components) {
103 void focusMenu(helios::engine::runtime::world::UpdateContext& updateContext, const MenuId menuId, View<MenuComponent>& components) {
104 for (auto [entity, mc] : components) {
109 auto menuItem = updateContext.find(mc->menuItems()[mc->selectedIndex()]);
110 menuItem->getOrAdd<UiFocusComponent>();
128 explicit MenuDisplaySystem(CombinedStateToIdMapPair<StateLft, StateRgt, MenuId> stateToMenuMap)
144 void update(helios::engine::runtime::world::UpdateContext& updateContext) noexcept {
158 View<MenuComponent> components = updateContext.view<MenuComponent>().whereEnabled();
163 showMenu(prevMenuId, false, components);
169 showMenu(menuId, true,components);
180 for (auto [entity, fc] : updateContext.view<UiFocusComponent>().whereEnabled()) {
198 item.remove<UiFocusComponent>();
203 focusMenu(updateContext, menuIds[0], components);
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.