VR-Engage  2.3
Loading...
Searching...
No Matches
makVre::DtVreLoadingPlayerPage Class Reference

Detailed Description

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>

Inheritance diagram for makVre::DtVreLoadingPlayerPage:
[legend]

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)
 

Constructor & Destructor Documentation

◆ DtVreLoadingPlayerPage()

makVre::DtVreLoadingPlayerPage::DtVreLoadingPlayerPage ( DtPlayerStationApp & app,
const std::string & target_window = "" )

Constructor.

Parameters
appReference to the player station application
target_windowName of the window to display in (empty for default)

◆ ~DtVreLoadingPlayerPage()

virtual makVre::DtVreLoadingPlayerPage::~DtVreLoadingPlayerPage ( )
overridevirtual

Virtual destructor.

Member Function Documentation

◆ tick()

virtual void makVre::DtVreLoadingPlayerPage::tick ( double dt)
overridevirtual

Updates the page each frame.

Parameters
dtTime 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.

◆ initMain()

virtual void makVre::DtVreLoadingPlayerPage::initMain ( )
overridevirtual

Initializes the main UI elements after QML loads.

Implements makVre::DtVreBaseUI.

◆ setVisibility()

virtual void makVre::DtVreLoadingPlayerPage::setVisibility ( bool visible)
overridevirtual

Controls page visibility.

Parameters
visibleTrue 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.

◆ setStatusText()

virtual void makVre::DtVreLoadingPlayerPage::setStatusText ( const QString & text)
virtual

Sets the status text shown on the loading screen.

Parameters
textThe status message to display (e.g. "Creating components...")

◆ updateHeaderTitle()

virtual void makVre::DtVreLoadingPlayerPage::updateHeaderTitle ( )
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).

◆ beginFadeOut()

virtual void makVre::DtVreLoadingPlayerPage::beginFadeOut ( )
virtual

Begins the fade-out-to-black animation.

Called by DtLoadingPlayerState when initialization is complete. After the animation finishes the QML emits fadeOutFinished().

◆ isFadeOutComplete()

bool makVre::DtVreLoadingPlayerPage::isFadeOutComplete ( ) const

Checks whether the fade-out animation has completed.

Returns
True if the fade-out is finished and the page is ready to hide

◆ isFadeInComplete()

bool makVre::DtVreLoadingPlayerPage::isFadeInComplete ( ) const

Checks whether the fade-in animation has completed.

Returns
True if the fade-in is finished and the page is fully visible

◆ slot_fadeOutFinished

void makVre::DtVreLoadingPlayerPage::slot_fadeOutFinished ( )
slot

Called when the QML fade-out animation finishes.

◆ slot_fadeInFinished

void makVre::DtVreLoadingPlayerPage::slot_fadeInFinished ( )
slot

Called when the QML fade-in animation finishes.

Member Data Documentation

◆ myFadeOutComplete

bool makVre::DtVreLoadingPlayerPage::myFadeOutComplete
protected

Tracks whether the fade-out animation has completed.

◆ myFadeInComplete

bool makVre::DtVreLoadingPlayerPage::myFadeInComplete
protected

Tracks whether the fade-in animation has completed.

◆ myAnimationAccumulator

double makVre::DtVreLoadingPlayerPage::myAnimationAccumulator
protected

Accumulated time for the petal spinner animation (seconds)

◆ myActivePetal

int makVre::DtVreLoadingPlayerPage::myActivePetal
protected

Current active petal index (0-7), advanced every 500ms.


The documentation for this class was generated from the following file: