VR-Engage
2.2
Loading...
Searching...
No Matches
sessionMenuState.h
Go to the documentation of this file.
1
/******************************************************************************
2
** Copyright (c) 2025 MAK Technologies
3
** All rights reserved.
4
******************************************************************************/
5
6
//! \file sessionMenuState.h
7
//! \brief Presents menu for selecting scenario to start hosted session or
8
//! terrain to start unhosted session.
9
//!
10
//! This file defines the session menu state that presents options for
11
//! starting a hosted session with a scenario or an unhosted session with
12
//! a terrain selection. It handles UI interactions for session setup.
13
14
#pragma once
15
16
#include "
vrePlayerStation/export.h
"
17
18
#include "
vrePlayerStation/playerStationState.h
"
19
20
class
DtScenarioExplorer;
21
22
namespace
makVre
23
{
24
class
DtVreStartMenuQml;
25
class
DtVreStartPage
;
26
27
//! \brief Player station state that manages the session menu UI and functionality
28
//!
29
//! Handles the UI for selecting and starting sessions, both hosted and unhosted.
30
//! Manages the session menu and responds to user interactions for session creation,
31
//! including scenario selection for hosted sessions and terrain selection for
32
//! unhosted sessions.
33
class
PLAYERSTATION_DLL
DtSessionMenuState
:
virtual
public
DtPlayerStationState
34
{
35
public
:
36
//! \brief Constructor for the session menu state
37
//! \param app Reference to the player station application
38
DtSessionMenuState
(
DtPlayerStationApp
&
app
);
39
40
//! \brief Virtual destructor for proper cleanup
41
virtual
~DtSessionMenuState
()
override
;
42
43
//! \brief Called when entering this state
44
//! \param args Optional arguments passed when transitioning to this state
45
//!
46
//! Initializes the session menu UI, registers message handlers, and checks startup
47
//! configuration for special options. May automatically transition to another state
48
//! based on startup configuration (join, start, or host modes).
49
virtual
void
onEnter
(
const
DtPlayerStationStateArgs
* args)
override
;
50
51
//! \brief Called when exiting this state
52
//!
53
//! Removes all registered message handlers, closes the start menu UI,
54
//! and performs cleanup of the connection page if it's visible.
55
virtual
void
onExit
()
override
;
56
57
//! \brief Called when this state becomes the top-most visible state
58
//!
59
//! Re-registers UI message handlers and makes the menu visible.
60
//! This occurs when a state on top of this one is removed.
61
virtual
void
onExposed
()
override
;
62
63
//! \brief Called when another state is pushed on top of this state
64
//!
65
//! Removes UI message handlers and hides the menu UI but keeps
66
//! the state alive in the background.
67
virtual
void
onStacked
()
override
;
68
69
//! \brief Called every frame to update the state
70
//! \param dt Time elapsed since the last frame in seconds
71
//!
72
//! Handles periodic updates for this state. Currently minimal implementation.
73
virtual
void
tick
(
double
dt)
override
;
74
75
protected
:
76
//! \brief Handles session status messages from VRF
77
//! \param msg The session status message
78
//! \return Result of message handling (HANDLED or IGNORED)
79
//!
80
//! Processes session status info and updates the UI accordingly
81
virtual
DtVreMessageResult
handleVrfSessionStatus
(
DtVreMessage
* msg);
82
83
//! \brief Handles button click to choose a session
84
//! \param msg The button click message
85
//! \return Result of message handling (HANDLED or IGNORED)
86
//!
87
//! Transitions to the state for choosing a session
88
virtual
DtVreMessageResult
handleChooseSessionButtonClicked
(
DtVreMessage
* msg);
89
90
//! \brief Handles ESC key press
91
//! \param msg The escape key message
92
//! \return Result of message handling (HANDLED or IGNORED)
93
//!
94
//! Transitions back to the previous state
95
virtual
DtVreMessageResult
handleEscKey
(
DtVreMessage
* msg);
96
97
//! \brief Handles back button clicks in the UI
98
//! \param msg The back button click message
99
//! \return Result of message handling (HANDLED or IGNORED)
100
//!
101
//! Transitions back to the previous state
102
virtual
DtVreMessageResult
handleBackButtonClicked
(
DtVreMessage
* msg);
103
104
//! \brief Handles requests to start a hosted session
105
//! \param msg The host session message containing scenario info
106
//! \return Result of message handling (HANDLED or IGNORED)
107
//!
108
//! Creates a SessionLoadDataMessage and transitions to JOINED_SESSION_STATE
109
virtual
DtVreMessageResult
handleStartHostedSessionClicked
(
DtVreMessage
* msg);
110
111
//! \brief Handles requests to start an unhosted session
112
//! \param msg The unhosted session message containing terrain info
113
//! \return Result of message handling (HANDLED or IGNORED)
114
//!
115
//! Creates a SessionLoadDataMessage and transitions to JOINED_SESSION_STATE
116
virtual
DtVreMessageResult
handleStartUnhostedSessionClicked
(
DtVreMessage
* msg);
117
118
protected
:
119
//! \brief Reference to the start page UI component
120
//!
121
//! Provides access to the start menu UI for displaying and managing
122
//! session options and controls
123
std::shared_ptr<DtVreStartPage>
myStartPage
;
124
};
125
126
}
// namespace makVre
makVre::DtPlayerStationApp
Top-level class representing the VR-Engage application.
Definition
playerStationApp.h:163
makVre::DtPlayerStationStateArgs
Class for passing arguments during state transitions.
Definition
playerStationState.h:45
makVre::DtPlayerStationState::app
DtPlayerStationApp & app() const
Gets a reference to the player station application.
makVre::DtPlayerStationState::DtPlayerStationState
DtPlayerStationState(DtPlayerStationApp &app, std::string stateType)
Constructor.
makVre::DtSessionMenuState::handleChooseSessionButtonClicked
virtual DtVreMessageResult handleChooseSessionButtonClicked(DtVreMessage *msg)
Handles button click to choose a session.
makVre::DtSessionMenuState::handleEscKey
virtual DtVreMessageResult handleEscKey(DtVreMessage *msg)
Handles ESC key press.
makVre::DtSessionMenuState::handleVrfSessionStatus
virtual DtVreMessageResult handleVrfSessionStatus(DtVreMessage *msg)
Handles session status messages from VRF.
makVre::DtSessionMenuState::handleStartHostedSessionClicked
virtual DtVreMessageResult handleStartHostedSessionClicked(DtVreMessage *msg)
Handles requests to start a hosted session.
makVre::DtSessionMenuState::onExit
virtual void onExit() override
Called when exiting this state.
makVre::DtSessionMenuState::handleStartUnhostedSessionClicked
virtual DtVreMessageResult handleStartUnhostedSessionClicked(DtVreMessage *msg)
Handles requests to start an unhosted session.
makVre::DtSessionMenuState::tick
virtual void tick(double dt) override
Called every frame to update the state.
makVre::DtSessionMenuState::myStartPage
std::shared_ptr< DtVreStartPage > myStartPage
Reference to the start page UI component.
Definition
sessionMenuState.h:123
makVre::DtSessionMenuState::onStacked
virtual void onStacked() override
Called when another state is pushed on top of this state.
makVre::DtSessionMenuState::~DtSessionMenuState
virtual ~DtSessionMenuState() override
Virtual destructor for proper cleanup.
makVre::DtSessionMenuState::DtSessionMenuState
DtSessionMenuState(DtPlayerStationApp &app)
Constructor for the session menu state.
makVre::DtSessionMenuState::handleBackButtonClicked
virtual DtVreMessageResult handleBackButtonClicked(DtVreMessage *msg)
Handles back button clicks in the UI.
makVre::DtSessionMenuState::onExposed
virtual void onExposed() override
Called when this state becomes the top-most visible state.
makVre::DtSessionMenuState::onEnter
virtual void onEnter(const DtPlayerStationStateArgs *args) override
Called when entering this state.
makVre::DtVreMessage
Abstract base class for all VREngage messages.
Definition
vreMessage.h:50
makVre::DtVreStartPage
Start page UI component for VR-Engage.
Definition
vreStartPage.h:355
export.h
Defines export macros for the VR-Engage Player Station library.
PLAYERSTATION_DLL
#define PLAYERSTATION_DLL
Definition
export.h:24
makVre
Include export definitions for this library.
Definition
glsVreMessageUtil.h:49
makVre::DtVreMessageResult
DtVreMessageResult
Enumeration of possible message handling results.
Definition
vreMessage.h:33
playerStationState.h
Defines base classes for the VR-Engage state management system.
Generated on 2026-01-13 from SVN revision 282860 - Copyright © 2005-2026 MAK Technologies. All Rights Reserved.