|
VR-Engage
2.2
|
DtMenuState provides common functionality for states that display a menu interface to the user. It manages the application page that contains the menu, handles input events like Escape key and Back button clicks, and applies visual effects like depth of field blur to emphasize the menu.
Derived states implement specific menu interfaces, such as the main menu, settings menu, role selection menu, or session selection menu.
#include <menuState.h>
Public Member Functions | |
| DtMenuState (DtPlayerStationApp &app) | |
| virtual | ~DtMenuState () override |
| virtual void | tick (double dt) override |
| virtual void | onEnter (const DtPlayerStationStateArgs *args) override |
| virtual void | onExit () override |
| virtual void | onExposed (const DtPlayerStationStateArgs *args) override |
| virtual void | onStacked () override |
Public Member Functions inherited from makVre::DtPlayerStationState | |
| DtPlayerStationState (DtPlayerStationApp &app, std::string stateType) | |
| virtual | ~DtPlayerStationState () |
| DtPlayerStationState (const DtPlayerStationState &)=delete | |
| DtPlayerStationState & | operator= (const DtPlayerStationState &)=delete |
| virtual void | onEnter () |
| virtual void | onExposed () |
| bool | active () const |
| bool | exposed () const |
| bool | exiting () const |
| bool | stacking () const |
| const std::string & | stateType () const |
| DtPlayerStationApp & | app () const |
Protected Member Functions | |
| virtual DtVreMessageResult | handleEscKey (DtVreMessage *message) |
| virtual DtVreMessageResult | handleAppModeUpdated (DtVreMessage *message) |
| virtual DtVreMessageResult | handleBackButtonClicked (DtVreMessage *message) |
| virtual void | updateAppPageButtons () |
Protected Member Functions inherited from makVre::DtPlayerStationState | |
| bool | pushState (const std::string &newState, DtPlayerStationStateArgs *args=NULL) |
| bool | popSelf () |
| bool | popUntilSelf () |
| bool | popUntilState (const std::string &parentState, DtPlayerStationStateArgs *args=NULL) |
| bool | switchToState (const std::string &newState, DtPlayerStationStateArgs *args=NULL) |
| bool | pushSelf () |
Protected Attributes | |
| std::shared_ptr< DtVreAppPage > | myAppPage |
| int | myCachedObserverMode |
| std::string | myCachedSensorMode |
| DtDepthOfFieldSettings | myCachedDepthOfFieldSettings |
Protected Attributes inherited from makVre::DtPlayerStationState | |
| DtPlayerStationApp & | myApp |
| makVre::DtMenuState::DtMenuState | ( | DtPlayerStationApp & | app | ) |
Constructor.
| app | Reference to the player station application |
Initializes a new menu state with a reference to the application. Registers message handlers for input events.
References makVre::DtPlayerStationState::app().
|
overridevirtual |
Virtual destructor.
Ensures proper cleanup of derived menu state classes.
|
overridevirtual |
Updates the menu state each frame.
| dt | Time elapsed since the last update in seconds |
Called once per frame to update the menu state. This handles animation updates, timed transitions, and other continuous operations for the menu.
Reimplemented from makVre::DtPlayerStationState.
|
overridevirtual |
Called when entering this state.
| args | Arguments passed from the previous state |
Initializes the menu state when it is pushed onto the state stack. This typically involves creating the UI page, caching camera settings, applying depth of field effects, and setting up the menu environment.
Reimplemented from makVre::DtPlayerStationState.
|
overridevirtual |
Called when exiting this state.
Cleans up resources when the menu state is removed from the state stack. This typically involves hiding the UI page, restoring cached camera settings, and removing depth of field effects.
Reimplemented from makVre::DtPlayerStationState.
|
overridevirtual |
Called when this state becomes the top state again.
| args | Arguments passed when exposing this state |
Handles the case when a state that was pushed on top of this one is popped, making this menu state the active state again. This typically refreshes the UI to reflect any changes made while this state was covered.
Reimplemented from makVre::DtPlayerStationState.
|
overridevirtual |
Called when another state is pushed on top of this one.
Handles the case when a new state is pushed on top of this menu state. This typically involves pausing menu animations or temporarily hiding UI elements that would otherwise be visible underneath.
Reimplemented from makVre::DtPlayerStationState.
|
protectedvirtual |
Handles Escape key press messages.
| message | The escape key message to process |
Processes escape key press events, typically used to navigate back or close the current menu. The default implementation pops this state from the stack, returning to the previous state.
|
protectedvirtual |
Handles application mode change messages.
| message | The application mode message to process |
Processes notifications about application mode changes, such as transitioning between normal, admin, or lockdown modes. Updates the UI and available options based on the new mode.
|
protectedvirtual |
Handles back button click messages.
| message | The back button message to process |
Processes click events from the back button in the UI. Similar to the escape key handler, this typically pops the current state from the stack.
|
protectedvirtual |
Updates the state of UI buttons in the application page.
Updates the enabled/disabled state of buttons in the UI based on current application state and context. This is called when the state changes or becomes visible again after being covered by another state.
|
protected |
Shared pointer to the UI page.
Reference to the QML-based UI page that displays the menu interface. This page is created when entering the state and destroyed when exiting.
|
protected |
|
protected |
|
protected |
Cached depth of field settings.
Stores the original depth of field camera settings that were active before entering this state. When a menu is shown, a depth of field blur effect is typically applied to the 3D scene to emphasize the menu interface. These settings are restored when exiting the menu state.