ChatBlade How To Documentation
How To Monitor various Chat Channels

Related ChatBlade Classes and functions:  
    CBTextWindowData
    CBData
    

 
Summary:  
  Jump to Link   Make sure each Text Window/Tab has an associated CBTextWindowData instance via CBData::AddTextWindowData(nTextWindowID).  
  Jump to Link Assign initial Chat Channels to Monitor to each GUI Text Window.  
  Jump to Link Create a GUI Mechanism to allow the Player to choose which Chat Channels each GUI Text Window is Monitoring.  
  Jump to Link Call CBTextWindowData::AddChannelID(nTextWindowID, nChannelType) for each Chat Channel selected.  
  Jump to Link Alternately one may add in groups of Chat Channels via the various helper functions in CBTextWindowData.  
ChatBlade mandates that each Text Window/Chat Tab have a unique ID.  

 
Details:  
 
Call CBData::AddTextWindowData(nTextWindowID) once for each Text Window or Chat Tab displayed in the Game.  
     Each GUI Text Window or Chat Tab needs to have a unique int ID.  
Each GUI Text Window has a related CBTextWindowData instance that keeps track of its Chat Messages and which Chat Channels the Text Window should Monitor.  
To create this instance in ChatBlade developers should call CBData::AddTextWindowData(nTextWindowID) once for each GUI Text Window or Chat Tab in the Game.  
The instance created by this call is stored in CBData::mTextWindowDataMap and is keyed via the Text Window ID.  
It can be accessed via CBData::mTextWindowDataMap[nTextWindowID].  
Sample Code:  
 
Assign initial Chat Channels to Monitor to each GUI Text Window.  
     Newly created Text Windows initially are not Monitoring any Chat Channels.  
After calling CBData::AddTextWindowData(nTextWindowID) Developers should add in the initial Chat Channels the Text Window should receive Chat Messages from.  
Call CBTextWindowData::AddChannelID(nTextWindowID, nChannelType) to add an initial Chat Channel to Monitor, or call CBData::mTextWindowDataMap[nTextWindowID].AddAllChannelIDs() or similar functions of CBTextWindowData to add in groups of Chat Channels.  
Sample Code:  
 
Create a GUI Mechanism to allow the Player to choose which Chat Channels each GUI Text Window is Monitoring.  
     Developers need to create a GUI Mechanism which allows Players to choose which Chat Channels a GUI Text Window should Monitor.  
This can be accomplished in a variety of ways.  A large list of check boxes for each Chat Channel may be displayed, or clusters of related Chat Channels might be selected.  Developers might choose to create a Dialog with a list of all the Chat Channels and allow Players to move the Chat Channels from Disabled over to Enabled.  Implementation of this mechanism is left to the Game Developer.  
The Game needs to be able to determine which Chat Channels the Player has selected to Monitor.  
No Sample Code provided:  
 
Call CBTextWindowData::AddChannelID( nTextWindowID, nChannelType) for each Chat Channel selected.  
     When a Player changes the Chat Channels a Text Window should Monitor, the Game should call ChatBlade functions in CBTextWindowData to add in the Chat Channels the Player specified.  
Typically a Game may wish to first clear out all the Chat Channels being Monitored via CBTextWindowData::ClearChannelIDs(int nTextWindowID).  
Then each Chat Channel selected can be added back in via CBTextWindowData::AddChannelID(nTextWindowID, nChannelType).  
If the GUI Mechanism allows for selecting groups of related Chat Channels, multiple Chat Channels can be added at once via the various helper functions of CBTextWindowData.  
Groups of Chat Channels might be added via 
CBData::mTextWindowDataMap[nTextWindowID].AddMandatoryChannelIDs(),
CBData::mTextWindowDataMap[nTextWindowID].AddAllCombatChannelIDs() , or 
CBData::mTextWindowDataMap[nTextWindowID].AddCombatHealingChannelIDs() for example.  
Sample Code:  
 

 

Code Samples:  

Creating a CBTextWindowData instance in Chat Blade to assist a GUI Text Window with an ID of 2
     CBData::AddTextWindowData(2);
 
Assigning all the Combat Chat Channels to a newly created Text Window with an ID of 2.  
     CBData::mTextWindowDataMap[2].AddAllCombatChannelIDs();
 
Adding Chat Channels to Monitor in response to a Player changing the Text Window settings.  
Assuming the Player has chosen to display Tells, Group, Guild, and Say Chat Channels.  
     //  Clear out any existing Chat Channels that had been Monitored
CBTextWindowData::ClearChannelIDs(2);
//  Add in our selected Chat Channels
CBTextWindowData::AddChannelID(2, CB_CHANNEL_TELL);
CBTextWindowData::AddChannelID(2, CB_CHANNEL_CUSTOMER_SERVICE_TELL);
CBTextWindowData::AddChannelID(2, CB_CHANNEL_NPC_TELL);
CBTextWindowData::AddChannelID(2, CB_CHANNEL_GROUP);
CBTextWindowData::AddChannelID(2, CB_CHANNEL_GROUP_PRIORITY);
CBTextWindowData::AddChannelID(2, CB_CHANNEL_GUILD);
CBTextWindowData::AddChannelID(2, CB_CHANNEL_GUILD_PRIORITY);
CBTextWindowData::AddChannelID(2, CB_CHANNEL_GUILD_OFFICER);
CBTextWindowData::AddChannelID(2, CB_CHANNEL_SAY);
CBTextWindowData::AddChannelID(2, CB_CHANNEL_RPSAY);
CBTextWindowData::AddChannelID(2, CB_CHANNEL_OOCSAY);
 
    
 
    

 

 

 

 

 

 
 
 
 
ChatBlade Copyright Flex Dolphynn