MenuComponent.ixx File
Component for managing UI menu structures. More...
Included Headers
#include <span>
#include <vector>
#include <helios.engine.ecs.EntityHandle>
#include <helios.engine.ecs.GameObject>
#include <helios.engine.modules.ui.widgets.types.MenuId>
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 | components |
|
UI widget state components. More... | |
Classes Index
| class | MenuComponent |
|
Manages a collection of menu items for UI navigation. More... | |
Description
Component for managing UI menu structures.
File Listing
The file content with the documentation metadata removed is:
16export namespace helios::engine::modules::ui::widgets::components {
27class MenuComponent {
37 helios::engine::modules::ui::widgets::types::MenuId menuId_{};
66 void setMenuId(helios::engine::modules::ui::widgets::types::MenuId id) noexcept {
75 [[nodiscard]] helios::engine::modules::ui::widgets::types::MenuId menuId() const noexcept {
86 void setSelectedIndex(const size_t index) noexcept {
88 markDirty();
97 void selectDefaultIndex() {
98 setSelectedIndex(defaultSelectedIndex_);
106 [[nodiscard]] size_t selectedIndex() const noexcept {
116 void addMenuItem(const helios::engine::ecs::GameObject menuItem) {
117 markDirty();
118 menuItems_.push_back(menuItem.entityHandle());
133 void clearDirty() {
158 [[nodiscard]] size_t previousSelectedIndex() const noexcept {
171 void insert(const helios::engine::ecs::GameObject menuItem, const size_t index) {
177 if (i == index && menuItems_[i] == menuItem.entityHandle()) {
183 menuItems_[index] = menuItem.entityHandle();
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.