MenuItemConfig.ixx File
Fluent configuration for menu item GameObjects. More...
Included Headers
#include <cassert>
#include <optional>
#include <helios.math>
#include <helios.engine.modules.ui.widgets.components.UiActionComponent>
#include <helios.engine.modules.ui.widgets.components.UiStyleComponent>
#include <helios.engine.modules.ui.widgets.components.MenuComponent>
#include <helios.engine.core.data>
#include <helios.engine.modules.ui.widgets.components.UiStateComponent>
#include <helios.engine.ecs.GameObject>
Namespaces Index
| namespace | helios |
| namespace | engine |
|
Main engine module aggregating core infrastructure and game systems. More... | |
| namespace | builder |
|
Fluent builder pattern for constructing GameObjects. More... | |
| namespace | gameObject |
|
Factory and prototype classes for GameObject construction. More... | |
| namespace | builders |
|
Domain-specific builders for configuring different aspects of GameObjects. More... | |
| namespace | configs |
|
Fine-grained configuration classes for component setup. More... | |
Classes Index
| class | MenuItemConfig |
|
Fluent configuration for menu item GameObjects. More... | |
Description
Fluent configuration for menu item GameObjects.
File Listing
The file content with the documentation metadata removed is:
24export namespace helios::engine::builder::gameObject::builders::configs {
33 class MenuItemConfig {
38 helios::engine::ecs::GameObject gameObject_;
43 helios::engine::ecs::GameObject* parentMenu_ = nullptr;
61 auto* mc = parentMenu_->get<helios::engine::modules::ui::widgets::components::MenuComponent>();
78 explicit MenuItemConfig(
80 helios::engine::ecs::GameObject& parentMenu
81 ) : gameObject_(gameObject), parentMenu_(&parentMenu) {
84 gameObject_.getOrAdd<helios::engine::modules::ui::widgets::components::UiStyleComponent>();
85 gameObject_.getOrAdd<helios::engine::modules::ui::widgets::components::UiStateComponent>();
88 assert(parentMenu_->has<helios::engine::modules::ui::widgets::components::MenuComponent>() &&
101 MenuItemConfig& selected(const bool isSelected) {
108 parentMenu_->get<helios::engine::modules::ui::widgets::components::MenuComponent>()
124 MenuItemConfig& normalColor(const helios::math::vec4f color) {
125 gameObject_.get<helios::engine::modules::ui::widgets::components::UiStyleComponent>()
138 MenuItemConfig& normalScale(const float scale) {
139 gameObject_.get<helios::engine::modules::ui::widgets::components::UiStyleComponent>()
152 MenuItemConfig& selectedColor(helios::math::vec4f color) {
153 gameObject_.get<helios::engine::modules::ui::widgets::components::UiStyleComponent>()
166 MenuItemConfig& selectedScale(const float scale) {
167 gameObject_.get<helios::engine::modules::ui::widgets::components::UiStyleComponent>()
182 gameObject_.add<helios::engine::modules::ui::widgets::components::UiActionComponent>(actionId);
194 MenuItemConfig& index(const size_t index) {
196 parentMenu_->get<helios::engine::modules::ui::widgets::components::MenuComponent>()
197 ->insert(gameObject_, index);
200 parentMenu_->get<helios::engine::modules::ui::widgets::components::MenuComponent>()
201 ->setSelectedIndex(index);
204 index_ = index;
Generated via doxygen2docusaurus 2.0.0 by Doxygen 1.15.0.