22#include <vlutil/vlFilename.h>
26#include <unordered_map>
47 virtual bool execute(
const std::string& parameters) = 0;
50 virtual std::weak_ptr<DtChatCommand>
getWeak() {
return shared_from_this(); }
54 virtual std::string
help(
const std::string& parameters) {
return parameters; }
65 std::vector<std::string>& tokenized,
const char delimiter =
' ');
110 virtual void send(
const std::string& message);
114 const std::string& channel,
int force);
179 std::shared_ptr<DtChatCommand> command,
bool takeOwnership =
false);
192 virtual std::string
helpText(
const std::string& parameters)
const;
228 std::unordered_map<std::string, std::weak_ptr<DtChatCommand>>
myCommandMap;
Provides a callback mechanism for attribute changes in the VREngage system.
Provides base classes for shared pointer managed objects with factory creation support.
Convenience manager that owns and organises a collection of attribute callbacks.
Definition attributeCallback.h:223
Abstract base class for chat slash-commands.
Definition vreChatManager.h:39
virtual std::string help(const std::string ¶meters)
Returns help text for this command.
Definition vreChatManager.h:54
static bool splitString(const std::string &stringToSplit, std::vector< std::string > &tokenized, const char delimiter=' ')
Splits a string into tokens on a delimiter.
virtual std::weak_ptr< DtChatCommand > getWeak()
Returns a weak pointer to this command instance.
Definition vreChatManager.h:50
virtual ~DtChatCommand()=default
Virtual destructor.
virtual bool execute(const std::string ¶meters)=0
Executes this command with the given parameter string.
virtual bool showInHelp() const
Whether this command appears in /help output.
Definition vreChatManager.h:57
Pure abstract interface for the chat window component.
Definition vreChatWindowInterface.h:28
Top-level class representing the VR-Engage application.
Definition playerStationApp.h:155
virtual bool addCommand(const std::string &commandString, std::shared_ptr< DtChatCommand > command, bool takeOwnership=false)
Registers a slash command.
virtual void initialize(DtPlayerStationApp &app)
Phase-2 initializer — call immediately after create()
virtual bool runCommand(const std::string &consoleString)
Executes a slash command from a console input string.
virtual void openOrFocus()
Opens the chat window or focuses its input if already open.
std::unordered_map< std::string, std::shared_ptr< DtChatCommand > > myOwnedCommandMap
Slash-command registry (absorbed from DtChatCommandsManager)
Definition vreChatManager.h:229
DtFilename myDefaultChatConfigFile
Configuration file paths (moved from DtVreChatWindow)
Definition vreChatManager.h:215
DtVreChatManager()
Default constructor (required by DtVreUniqueBase factory)
virtual DtVreMessageResult handlePlayerCreatedMessage(DtVreMessage *msg)
Message handlers (moved from DtVreChatWindow)
virtual void sendToSystemChannel(const std::string &message)
Sends a message to the system notification channel.
virtual std::string helpText(const std::string ¶meters) const
Generates formatted help text for all visible commands.
virtual bool isShowingAllowed() const
Returns true if the chat window is permitted to be shown.
virtual DtVreMessageResult handleIncomingChatMessage(DtVreMessage *msg)
Message handlers (moved from DtVreChatWindow)
virtual void onCurrentStateChanged(std::string state)
Message handlers (moved from DtVreChatWindow)
virtual void setShowingAllowed(bool canShow)
Sets whether the chat window is permitted to be shown.
virtual bool updateChatChannelsFromScenario(const DtFilename &scenario)
Updates chat channels from a scenario file.
DtFilename myDefaultConfigDirectory
Configuration file paths (moved from DtVreChatWindow)
Definition vreChatManager.h:218
DtAttributeCallbackManager myAttributeCallbacks
Tracks attribute change callbacks; ensures cleanup on destruction.
Definition vreChatManager.h:224
virtual void togglePinChat()
Toggles the pinned (always-visible) state of the chat window.
DtFilename myDefaultChatConfigUserDirectory
Configuration file paths (moved from DtVreChatWindow)
Definition vreChatManager.h:220
virtual void close()
Closes the chat window.
virtual DtVreMessageResult handleVrfSessionStatusMessage(DtVreMessage *msg)
Message handlers (moved from DtVreChatWindow)
std::unordered_map< std::string, std::weak_ptr< DtChatCommand > > myCommandMap
Slash-command registry (absorbed from DtChatCommandsManager)
Definition vreChatManager.h:228
virtual DtVreMessageResult handleExitPlayerState(DtVreMessage *msg)
Message handlers (moved from DtVreChatWindow)
DtFilename myCurrentChatConfigFile
Configuration file paths (moved from DtVreChatWindow)
Definition vreChatManager.h:216
virtual bool isVisible() const
Returns true if the chat window root item is visible.
virtual bool isChannelActive(const std::string &channelName, int force) const
Checks whether a channel is currently active.
virtual ~DtVreChatManager()
Virtual destructor; removes registered message handlers.
virtual void send(const std::string &message)
Sends a message or slash command through the chat window.
virtual DtFilename getChatConfigFile(const DtFilename &scenarioFilename) const
Returns the chat config file to use for a given scenario.
virtual DtVreMessageResult handleEnterPlayerState(DtVreMessage *msg)
Message handlers (moved from DtVreChatWindow)
virtual void open()
Opens the chat window.
virtual void removeCommand(const std::string &commandString)
Unregisters a slash command by its trigger word.
DtFilename myDefaultConfigFilename
Configuration file paths (moved from DtVreChatWindow)
Definition vreChatManager.h:217
DtChatWindowInterface * myWindow
Non-owning pointer to the active chat window; set via setWindow()
Definition vreChatManager.h:208
virtual bool updateChatChannelsFromConfigFile(const DtFilename &chatConfigFile)
Updates chat channels from a configuration file.
virtual DtVreMessageResult handlePlayerDestroyedMessage(DtVreMessage *msg)
Message handlers (moved from DtVreChatWindow)
DtPlayerStationApp * myApp
Owning application reference; set in initialize()
Definition vreChatManager.h:211
DtFilename myDefaultChatConfigUserFilenamePostfix
Configuration file paths (moved from DtVreChatWindow)
Definition vreChatManager.h:219
virtual void sendChatMessage(const std::string &message, const std::string &channel, int force)
Sends a chat message to a specific channel.
virtual bool isFullChatVisible() const
Returns true if the full chat panel is visible.
virtual void setWindow(DtChatWindowInterface *window)
Wires the concrete chat window to this manager.
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
DtVreUniqueBase()
Definition baseClass.h:358
Defines export macros for the VR-Engage Player Station library.
#define PLAYERSTATION_DLL
Definition export.h:24
!
Definition glsVreMessageUtil.h:50
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Declares the DtChatWindowInterface pure abstract interface.
Defines the base class for all VREngage messages.