| Class | CBAliasList |
| Header | CBAliasList.h |
Data Member Summary Member Details
Information:
| CBAliasList is a class used to support the /alias command. |
| /alias allows the user to create their own local Slash Commands. |
| Using the /alias Slash Command, Players can create their own local Slash Commands which map to existing Game supplied commands. |
| ChatBlade uses CBChatHandler::m_AliasList to keep track of the Aliases that a Player has created. |
| Aliases consist of a single word that starts with a '/' Character. This word should not be an existing Slash Command, and the new Alias shall be local only to the Player who created the Alias. |
| Each Alias created maps to an existing Slash Command and any optional Parameters. |
| When a Player enters in the Alias, ChatBlade shall expand that Alias to its related Slash Command before processing. |
| Some sample Aliases might be: |
| "/alias /bail, /exit" would create an Alias named /bail that would perform the same as the /exit Slash Command. |
| "/alias /backflip, /emote Backflips" would create an Alias named /Backflip which expands to "/emote Backflips". |
| "/alias /Mike, /tell Velorian Orcsmasher," would create an Alias name /Mike would might allow the Player to easily send a tell to his Real Life Friend. The Player could then type something like "/mike Whats Up?" which would expand to "/tell Velorian Orcsmasher, Whats Up?" |
| "/alias /p, /g" would create an Alias name /p which would expand to be /g before Chat processing. |
| Aliases are a secondary way that ChatBlade allows the Player to alter the Slash Command interface. |
| Game Developers should also take advantage of ChatBlades ability to allow Players to set the initial Slash Commands for a Game, either via XML, or an in-game Dialog. |
| An Alias that is created that matches an existing Slash Command may prohibit the existing Slash Command from functioning until the conflicting Alias is removed. |
| Players can remove an Alias with the /unalias Slash Command (if using the recommended Slash Commands). |
| Players can display their current Aliases with the /alias list or /aliaslist Slash Commands. |
| Game Developers should load up a Players current Aliases upon Game startup. |
Game Developer Implementation:
| Game Developers do not need to implement or instantiate CBAliasList. This class is used internally by ChatBlade. |
| When the Game Developer instantiates an instance of CBChatHandler, CBChatHandler contains an internal instance of CBAliasList for support of /alias and related Commands. |
| Upon Game startup the Alias List stored in CBChatHandler should be loaded with any existing Aliases the Player may have created in previous Game sessions. |
| Game Developers should persist any new Aliases created by the Character so that they may be loaded again next play session. |
Source File Comments:
| // Represents a map of user defined Slash Commands and their associated game defined equivalents // Used to support the /alias function which lets users define their own / commands |
| // Users may make their own commands and map them to an existing command // /alias aliasname without a value clears that aliasname // /alias list displays ones aliases // for example: // /alias /backflip, /emote backflips // would allow the user to now type in /backflips, thus creating their own / command // this class is designed to store the relation between "/backflip" and "/emote backflips" // other examples: // /alias /mike, /tell tiguron androculous, // /alias /gang, /guild // /alias /fel, /group // /alias /fel (clears this alias) // /alias list (lists our aliases) |
| // CBAliasList is implemented as a map of the user defined / command and its game defined equivalent // Commands are converted to Uppercase before storage
|
| // ChatBlade shall check each line the user enters and see if it starts with an alias // If so, ChatBlade shall replace that alias with its equivalent text
|
| // An alias can consist of just 1 word which starts with a slash (CB_SLASHCOMMAND_CHARACTER) // Its game equivalent can be more than 1 word but the first word must be a normal slash command
|
| // An alias cannot be used as an alias for another user defined alias, only for existing game defined commands |
|
||||
|
||||
|
||||
|
|
|||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
|
|||||||||||||||||||||||||||
| ChatBlade Copyright © Flex Dolphynn | |