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
17
19
20class DtScenarioExplorer;
21
22namespace makVre
23{
24class DtVreStartMenuQml;
25class 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.
34{
35public:
36 //! \brief Constructor for the session menu state
37 //! \param app Reference to the player station application
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
75protected:
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
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
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
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
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
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
117
118protected:
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
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:163
Class for passing arguments during state transitions.
Definition playerStationState.h:45
DtPlayerStationApp & app() const
Gets a reference to the player station application.
DtPlayerStationState(DtPlayerStationApp &app, std::string stateType)
Constructor.
virtual DtVreMessageResult handleChooseSessionButtonClicked(DtVreMessage *msg)
Handles button click to choose a session.
virtual DtVreMessageResult handleEscKey(DtVreMessage *msg)
Handles ESC key press.
virtual DtVreMessageResult handleVrfSessionStatus(DtVreMessage *msg)
Handles session status messages from VRF.
virtual DtVreMessageResult handleStartHostedSessionClicked(DtVreMessage *msg)
Handles requests to start a hosted session.
virtual void onExit() override
Called when exiting this state.
virtual DtVreMessageResult handleStartUnhostedSessionClicked(DtVreMessage *msg)
Handles requests to start an unhosted session.
virtual void tick(double dt) override
Called every frame to update the state.
std::shared_ptr< DtVreStartPage > myStartPage
Reference to the start page UI component.
Definition sessionMenuState.h:123
virtual void onStacked() override
Called when another state is pushed on top of this state.
virtual ~DtSessionMenuState() override
Virtual destructor for proper cleanup.
DtSessionMenuState(DtPlayerStationApp &app)
Constructor for the session menu state.
virtual DtVreMessageResult handleBackButtonClicked(DtVreMessage *msg)
Handles back button clicks in the UI.
virtual void onExposed() override
Called when this state becomes the top-most visible state.
virtual void onEnter(const DtPlayerStationStateArgs *args) override
Called when entering this state.
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
Start page UI component for VR-Engage.
Definition vreStartPage.h:355
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Defines base classes for the VR-Engage state management system.