DtVreChatManager provides a Qt-free public API for sending chat messages, managing channels, controlling the chat window UI, and registering slash commands. It is a member of DtPlayerStationApp and is available through app.chatManager().
DtVreChatManager participates in the per-class creator factory via DtVreUniqueBase. Override the default implementation by calling DtVreChatManager::registerCreator<MyManager>() before app initialization. Custom subclasses must have a default constructor and override initialize().
#include <vreChatManager.h>
◆ DtVreChatManager()
| makVre::DtVreChatManager::DtVreChatManager |
( |
| ) |
|
◆ ~DtVreChatManager()
| virtual makVre::DtVreChatManager::~DtVreChatManager |
( |
| ) |
|
|
virtual |
Virtual destructor; removes registered message handlers.
◆ initialize()
Phase-2 initializer — call immediately after create()
- Parameters
-
| app | Reference to the owning player station application |
Registers all message handlers, sets up configuration file paths, and connects the application state change callback.
- Note
- Must be called once before the first window is constructed.
◆ setWindow()
Wires the concrete chat window to this manager.
- Parameters
-
Called automatically by DtVreChatWindow at the end of its constructor. Triggers initial channel configuration load and updateAvailableChannels(). Guarded: all subsequent window calls check for null.
◆ send()
| virtual void makVre::DtVreChatManager::send |
( |
const std::string & | message | ) |
|
|
virtual |
Sends a message or slash command through the chat window.
- Parameters
-
| message | Text or /command string |
◆ sendChatMessage()
| virtual void makVre::DtVreChatManager::sendChatMessage |
( |
const std::string & | message, |
|
|
const std::string & | channel, |
|
|
int | force ) |
|
virtual |
Sends a chat message to a specific channel.
◆ sendToSystemChannel()
| virtual void makVre::DtVreChatManager::sendToSystemChannel |
( |
const std::string & | message | ) |
|
|
virtual |
Sends a message to the system notification channel.
◆ isChannelActive()
| virtual bool makVre::DtVreChatManager::isChannelActive |
( |
const std::string & | channelName, |
|
|
int | force ) const |
|
virtual |
Checks whether a channel is currently active.
◆ open()
| virtual void makVre::DtVreChatManager::open |
( |
| ) |
|
|
virtual |
◆ close()
| virtual void makVre::DtVreChatManager::close |
( |
| ) |
|
|
virtual |
◆ openOrFocus()
| virtual void makVre::DtVreChatManager::openOrFocus |
( |
| ) |
|
|
virtual |
Opens the chat window or focuses its input if already open.
◆ togglePinChat()
| virtual void makVre::DtVreChatManager::togglePinChat |
( |
| ) |
|
|
virtual |
Toggles the pinned (always-visible) state of the chat window.
◆ isVisible()
| virtual bool makVre::DtVreChatManager::isVisible |
( |
| ) |
const |
|
virtual |
Returns true if the chat window root item is visible.
◆ isFullChatVisible()
| virtual bool makVre::DtVreChatManager::isFullChatVisible |
( |
| ) |
const |
|
virtual |
Returns true if the full chat panel is visible.
◆ isShowingAllowed()
| virtual bool makVre::DtVreChatManager::isShowingAllowed |
( |
| ) |
const |
|
virtual |
Returns true if the chat window is permitted to be shown.
◆ setShowingAllowed()
| virtual void makVre::DtVreChatManager::setShowingAllowed |
( |
bool | canShow | ) |
|
|
virtual |
Sets whether the chat window is permitted to be shown.
◆ updateChatChannelsFromScenario()
| virtual bool makVre::DtVreChatManager::updateChatChannelsFromScenario |
( |
const DtFilename & | scenario | ) |
|
|
virtual |
Updates chat channels from a scenario file.
- Parameters
-
| scenario | Full path to the scenario file |
- Returns
- True if the configuration changed
◆ updateChatChannelsFromConfigFile()
| virtual bool makVre::DtVreChatManager::updateChatChannelsFromConfigFile |
( |
const DtFilename & | chatConfigFile | ) |
|
|
virtual |
Updates chat channels from a configuration file.
- Parameters
-
| chatConfigFile | Path to the chat channel config (.mtl) file |
- Returns
- True if the configuration changed
◆ getChatConfigFile()
| virtual DtFilename makVre::DtVreChatManager::getChatConfigFile |
( |
const DtFilename & | scenarioFilename | ) |
const |
|
virtual |
Returns the chat config file to use for a given scenario.
- Parameters
-
| scenarioFilename | Full path to the scenario (may be empty) |
- Returns
- Path to the appropriate chat config file
◆ addCommand()
| virtual bool makVre::DtVreChatManager::addCommand |
( |
const std::string & | commandString, |
|
|
std::shared_ptr< DtChatCommand > | command, |
|
|
bool | takeOwnership = false ) |
|
virtual |
Registers a slash command.
- Parameters
-
| commandString | Trigger word (without the leading slash) |
| command | Shared pointer to the command implementation |
| takeOwnership | If true, manager holds a strong reference |
- Returns
- True if the command was added successfully
◆ removeCommand()
| virtual void makVre::DtVreChatManager::removeCommand |
( |
const std::string & | commandString | ) |
|
|
virtual |
Unregisters a slash command by its trigger word.
◆ runCommand()
| virtual bool makVre::DtVreChatManager::runCommand |
( |
const std::string & | consoleString | ) |
|
|
virtual |
Executes a slash command from a console input string.
- Parameters
-
| consoleString | Full string (e.g. "help" or "username Alice") |
- Returns
- True if a matching command was found and executed
◆ helpText()
| virtual std::string makVre::DtVreChatManager::helpText |
( |
const std::string & | parameters | ) |
const |
|
virtual |
Generates formatted help text for all visible commands.
- Parameters
-
| parameters | Optional filter or context string |
- Returns
- Multi-line help string
◆ handlePlayerCreatedMessage()
◆ handlePlayerDestroyedMessage()
◆ handleIncomingChatMessage()
◆ handleVrfSessionStatusMessage()
◆ handleEnterPlayerState()
◆ handleExitPlayerState()
◆ onCurrentStateChanged()
| virtual void makVre::DtVreChatManager::onCurrentStateChanged |
( |
std::string | state | ) |
|
|
protectedvirtual |
◆ myWindow
Non-owning pointer to the active chat window; set via setWindow()
◆ myApp
◆ myDefaultChatConfigFile
| DtFilename makVre::DtVreChatManager::myDefaultChatConfigFile |
|
protected |
◆ myCurrentChatConfigFile
| DtFilename makVre::DtVreChatManager::myCurrentChatConfigFile |
|
protected |
◆ myDefaultConfigFilename
| DtFilename makVre::DtVreChatManager::myDefaultConfigFilename = DtFilename("defaultChatConfig.mtl") |
|
protected |
◆ myDefaultConfigDirectory
| DtFilename makVre::DtVreChatManager::myDefaultConfigDirectory = DtFilename("$(APP_DIR)/settings") |
|
protected |
◆ myDefaultChatConfigUserFilenamePostfix
| DtFilename makVre::DtVreChatManager::myDefaultChatConfigUserFilenamePostfix = DtFilename("_ChatConfig.mtl") |
|
protected |
◆ myDefaultChatConfigUserDirectory
| DtFilename makVre::DtVreChatManager::myDefaultChatConfigUserDirectory = DtFilename("$(USER_DIR)/chatConfigs") |
|
protected |
◆ myAttributeCallbacks
Tracks attribute change callbacks; ensures cleanup on destruction.
◆ myCommandMap
| std::unordered_map<std::string, std::weak_ptr<DtChatCommand> > makVre::DtVreChatManager::myCommandMap |
|
protected |
Slash-command registry (absorbed from DtChatCommandsManager)
◆ myOwnedCommandMap
| std::unordered_map<std::string, std::shared_ptr<DtChatCommand> > makVre::DtVreChatManager::myOwnedCommandMap |
|
protected |
Slash-command registry (absorbed from DtChatCommandsManager)
The documentation for this class was generated from the following file: