|
VR-Engage
2.2
|
DtActionMenuUpdater is responsible for initializing, updating, and rendering the action menus in VR-Engage. It coordinates with the menu system to ensure proper visual presentation of menus, handles menu positioning, and responds to changes in simulation state that affect menu content and visibility.
This component works alongside DtActionMenuLogic, which handles the logical aspects of menu behavior, while this class focuses on visual representation and updating.
#include <actionMenuUpdater.h>
Public Member Functions | |
| DtActionMenuUpdater () | |
| virtual | ~DtActionMenuUpdater () override |
| virtual bool | initialize (DtPlayerStation *player, DtInitTable &config) override |
| virtual bool | postInitialize () override |
| virtual void | tick (double dt) override |
| virtual void | shutdown () override |
| virtual const char * | type () const override |
| virtual bool | initializeMenus (DtInitTable &config) |
| virtual DtQmlActionMenu * | qmlActionMenu () |
| virtual void | reinitializeQuick () |
Public Member Functions inherited from makVre::DtPlayerComponent | |
| DtPlayerComponent () | |
| virtual | ~DtPlayerComponent () |
| virtual void | setName (const std::string &name) |
| virtual const std::string & | name () |
| virtual DtPlayerStation & | player () |
| virtual DtAttributeHandle & | playerAttributeStore () |
| virtual const DtAttributeHandle & | playerAttributeStore () const |
Protected Member Functions | |
| virtual void | initializeStateAttributes () override |
| virtual void | initEventMenu () |
| virtual void | initQuick () |
| virtual void | shutdownQuick () |
| virtual makVre::DtVreMessageResult | handleSimState (makVre::DtVreMessage *msg) |
| virtual makVre::DtVreMessageResult | handleApplicationMode (makVre::DtVreMessage *msg) |
Protected Attributes | |
| DtMenuManager * | myMenuManager |
| std::vector< SimulationStateMessage::EmbeddedEntity > | myDeployableObjects |
| DtQmlActionMenu * | myQmlActionMenu |
| int | myVrPositionX |
| int | myVrPositionY |
Protected Attributes inherited from makVre::DtPlayerComponent | |
| std::string | myName |
| DtInitTable | myConfig |
| DtPlayerStation * | myPlayer |
| makVrv::DtDe * | myDe |
| DtEntityResolver * | myResolver |
| DtAttributeCallbackManager | myAttributeCallbacks |
| makVre::DtActionMenuUpdater::DtActionMenuUpdater | ( | ) |
Constructor.
Creates a new action menu updater component with default state.
|
overridevirtual |
Virtual destructor.
Ensures proper cleanup of derived action menu updater classes.
|
overridevirtual |
Initializes the action menu updater.
| player | Pointer to the owning player station |
| config | Configuration data for initialization |
Sets up the action menu updater system based on the provided configuration. This includes creating a menu manager and initializing menu displays.
Reimplemented from makVre::DtPlayerComponent.
References makVre::DtPlayerComponent::player().
|
overridevirtual |
Performs post-initialization setup.
Completes setup tasks that need to occur after basic initialization, such as connecting to message handlers and initializing state attributes.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Updates the menu displays.
| dt | Time interval since the last tick in seconds |
Called once per frame to update the visual representation of menus. This includes updating positions, visibility, and content based on the current simulation state.
Implements makVre::DtPlayerComponent.
|
overridevirtual |
Shuts down the action menu updater.
Performs cleanup when the action menu updater is no longer needed. This includes destroying menu displays and disconnecting from message handlers.
Reimplemented from makVre::DtPlayerComponent.
|
overridevirtual |
Returns the component type identifier.
Returns the type identifier string for this component, which is used by the VR-Engage framework for component identification and management. The returned value matches DtActionMenuUpdaterType.
Implements makVre::DtPlayerComponent.
|
virtual |
Initializes the menu system.
| config | Configuration data for menu initialization |
Sets up the menu system based on the provided configuration data. This includes creating and configuring the menu manager and individual menus.
|
virtual |
Gets the QML action menu component.
Provides access to the QML-based action menu for external use. This is useful for components that need to directly interact with the menu's visual representation.
|
virtual |
Reinitializes the quick menu system.
Rebuilds the quick menu system after changes that require a full reinitialization, such as configuration changes or mode switches.
|
overrideprotectedvirtual |
Initializes state attributes used by the menu system.
Sets up the state attributes needed for menu functionality, such as player state, entity state, and configuration attributes that affect menus.
Reimplemented from makVre::DtPlayerComponent.
|
protectedvirtual |
Initializes the event menu.
Sets up the event menu, which displays event notifications and allows interaction with simulation events.
|
protectedvirtual |
Initializes the quick menu system.
Sets up the quick menu system for context-sensitive interactions. Quick menus appear when the player approaches interactive objects.
|
protectedvirtual |
Shuts down the quick menu system.
Cleans up resources used by the quick menu system when it's no longer needed.
|
protectedvirtual |
Handles simulation state messages.
| msg | Pointer to the simulation state message |
Processes simulation state updates that affect menu content and visibility, such as changes to deployable objects or player state.
|
protectedvirtual |
Handles application mode change messages.
| msg | Pointer to the application mode message |
Processes changes in application mode that affect menu presentation, such as switching between 2D and VR modes or different UI layouts.
|
protected |
Pointer to the menu manager.
The menu manager that coordinates all menus for this player station instance. It handles the creation, organization, and display of menus.
|
protected |
List of deployable objects available to the player.
Stores information about objects that can be deployed by the player, such as sensors, markers, or other equipment.
|
protected |
QML-based action menu component.
The QML implementation of the action menu used for rendering and interaction. QML provides a more modern and flexible UI compared to traditional approaches.
|
protected |
Horizontal position for VR menu rendering.
The X-coordinate for positioning menus in VR mode.
|
protected |
Vertical position for VR menu rendering.
The Y-coordinate for positioning menus in VR mode.