|
VR-Engage
2.3
|
DtVreLoadingPlayerPage wraps loadingPlayerPage.qml and provides C++ methods for updating the status text and controlling fade animations. It follows the HeaderFooterBaseUI pattern: the header and footer remain visible to keep the app looking alive, while the content area shows a black background with a centered spinner and status message.
DtLoadingPlayerState drives this page by calling setStatusText() at each phase transition. On completion, beginFadeOut() triggers a fade-to-black before the state transitions to ENGAGED_STATE.
#include <vreLoadingPlayerPage.h>
Public Slots | |
| void | slot_fadeOutFinished () |
| void | slot_fadeInFinished () |
Public Member Functions | |
| DtVreLoadingPlayerPage (DtPlayerStationApp &app, const std::string &target_window="") | |
| virtual | ~DtVreLoadingPlayerPage () override |
| virtual void | tick (double dt) override |
| virtual void | initMain () override |
| virtual void | setVisibility (bool visible) override |
| virtual void | setStatusText (const QString &text) |
| virtual void | updateHeaderTitle () |
| virtual void | beginFadeOut () |
| bool | isFadeOutComplete () const |
| bool | isFadeInComplete () const |
Public Member Functions inherited from makVre::DtVreBaseUI | |
| DtVreBaseUI (DtPlayerStationApp &app, const std::string &file, const std::string &target_window="") | |
| virtual | ~DtVreBaseUI () override |
| QQuickItem * | root () |
| DtVreHeaderFooterUI * | headerFooterUI () |
| virtual bool | isVisible () |
| virtual void | close () |
| virtual void | open () |
| virtual bool | isMainContentVisible () |
| virtual void | setMainContentVisibility (bool visible) |
| DtVreMessageResult | handleBackButtonClicked (DtVreMessage *msg) |
| DtVreMessageResult | handleEscapeMessage (DtVreMessage *msg) |
Protected Attributes | |
| bool | myFadeOutComplete |
| bool | myFadeInComplete |
| double | myAnimationAccumulator |
| int | myActivePetal |
Protected Attributes inherited from makVre::DtVreBaseUI | |
| DtPlayerStationApp & | myApp |
| QQuickItem * | myRoot |
| std::string | myTargetWindow |
| std::string | myTargetFile |
| std::string | myMainContentId |
Additional Inherited Members | |
Protected Member Functions inherited from makVre::DtVreBaseUI | |
| virtual void | connectToHeaderFooter () |
| virtual void | onConnectionClicked () |
| virtual void | onPopupOpened () |
| virtual void | onPopupClosed () |
| virtual void | onAppModeChanged (const std::string &newAppMode, const std::string &oldAppMode) |
| makVre::DtVreLoadingPlayerPage::DtVreLoadingPlayerPage | ( | DtPlayerStationApp & | app, |
| const std::string & | target_window = "" ) |
Constructor.
| app | Reference to the player station application |
| target_window | Name of the window to display in (empty for default) |
|
overridevirtual |
Virtual destructor.
|
overridevirtual |
Updates the page each frame.
| dt | Time in seconds since the last update |
Drives the petal spinner animation by accumulating wall-clock time and advancing the active petal index at the interval configured in QML. Handles frame stalls gracefully by stepping multiple petals when dt exceeds the interval.
Implements makVre::DtVreBaseUI.
|
overridevirtual |
Initializes the main UI elements after QML loads.
Implements makVre::DtVreBaseUI.
|
overridevirtual |
Controls page visibility.
| visible | True to show the page, false to hide it |
When showing the page, resets the fade state and triggers the fade-in animation. When hiding, resets the fade overlay.
Reimplemented from makVre::DtVreBaseUI.
|
virtual |
Sets the status text shown on the loading screen.
| text | The status message to display (e.g. "Creating components...") |
|
virtual |
Updates the header title bar with the current role and entity.
Reads the current attach entity and station name from the app and formats them into the header title. Called automatically from setVisibility(true) and can be called again when the role changes (e.g., during an embarkation chain load).
|
virtual |
Begins the fade-out-to-black animation.
Called by DtLoadingPlayerState when initialization is complete. After the animation finishes the QML emits fadeOutFinished().
| bool makVre::DtVreLoadingPlayerPage::isFadeOutComplete | ( | ) | const |
Checks whether the fade-out animation has completed.
| bool makVre::DtVreLoadingPlayerPage::isFadeInComplete | ( | ) | const |
Checks whether the fade-in animation has completed.
|
slot |
Called when the QML fade-out animation finishes.
|
slot |
Called when the QML fade-in animation finishes.
|
protected |
Tracks whether the fade-out animation has completed.
|
protected |
Tracks whether the fade-in animation has completed.
|
protected |
Accumulated time for the petal spinner animation (seconds)
|
protected |
Current active petal index (0-7), advanced every 500ms.