VR-Engage  2.2
Loading...
Searching...
No Matches
commentLogic.h
Go to the documentation of this file.
1/******************************************************************************
2** Copyright (c) 2024 MAK Technologies
3** All rights reserved.
4******************************************************************************/
5
6#pragma once
7
10
11//! String identifier used to register the comment logic component with the
12//! player station component factory.
13constexpr auto DtCommentLogicType = "DtCommentLogic";
14
15namespace makVre
16{
17class DtMenu;
18class DtMenuElement;
19
20//! Component that manages displaying incoming comment messages in the
21//! player station action menu.
22//!
23//! DtCommentLogic subscribes to internal CommentMessage traffic and menu
24//! action messages. For each received network comment targeted at the
25//! local entity, it creates an entry in a dedicated "Comment" menu and
26//! drives the menu state so the user can view and dismiss comments.
28{
29public:
30 //! Constructs a new comment logic component with no menu attached yet.
32
33 //! Virtual destructor to allow safe subclassing.
34 virtual ~DtCommentLogic() override;
35
36 //! Returns the component type string used during factory registration.
37 virtual const char* type() const override;
38
39 //! Initializes the component, registers message handlers, and creates
40 //! the comment menu if a menu manager is available from the attribute store.
41 virtual bool initialize(DtPlayerStation* player, DtInitTable& config) override;
42
43 //! Per-frame update hook. This example does not require per-tick work
44 //! but keeps the standard component interface.
45 virtual void tick(double dt) override;
46
47 //! Cleans up message handlers and releases any menu resources on shutdown.
48 virtual void shutdown() override;
49
50 //! Handles menu action messages generated when the user interacts with
51 //! the comment menu (for example, closing a displayed comment).
53
54 //! Handles internal CommentMessage instances produced by the network
55 //! connector and adds corresponding entries to the comment menu.
57
58protected:
59 //! Menu used to present received comments to the player.
61};
62
63} // namespace makVre
virtual void tick(double dt) override
Per-frame update hook. This example does not require per-tick work but keeps the standard component i...
DtMenu * myMenu
Menu used to present received comments to the player.
Definition commentLogic.h:60
DtCommentLogic()
Constructs a new comment logic component with no menu attached yet.
virtual DtVreMessageResult handleMenuMessage(makVre::DtVreMessage *msg)
Handles menu action messages generated when the user interacts with the comment menu (for example,...
virtual void shutdown() override
Cleans up message handlers and releases any menu resources on shutdown.
virtual ~DtCommentLogic() override
Virtual destructor to allow safe subclassing.
virtual bool initialize(DtPlayerStation *player, DtInitTable &config) override
Initializes the component, registers message handlers, and creates the comment menu if a menu manager...
virtual const char * type() const override
Returns the component type string used during factory registration.
virtual DtVreMessageResult handleCommentMessage(makVre::DtVreMessage *msg)
Handles internal CommentMessage instances produced by the network connector and adds corresponding en...
Table-based access to Lua state for configuration data.
Definition initializer.h:38
Core class for all interactive menus in VR-Engage.
Definition actionMenu.h:67
virtual DtPlayerStation & player()
Gets the player station.
DtPlayerComponent()
Constructor.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
constexpr auto DtCommentLogicType
String identifier used to register the comment logic component with the player station component fact...
Definition commentLogic.h:13
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Defines the DtPlayerComponent base class for VR-Engage role components.
Defines the central message manager for the VREngage messaging system.