| CBEditFieldData is a class that keeps track of previously
entered Chat and stores the default Slash Command for a UI Edit
Field. |
| It is designed to supply Chat History (repeat Chat) and Default Slash
Command functionality to a UI Edit Field. |
| |
| Each GUI Edit Field that is related to Chat should have 1
matching instance of CBEditFieldData in order to keep track of the data
for that GUI Edit Field. |
| Developers should create this instance by calling CBData::AddEditFieldData()
once per GUI Edit Field and passing to it the ID of each Edit
Field. |
| CBData::AddEditFieldData()
creates and adds an instance that is stored in CBData::mEditFieldDataMap.
This map is Keyed via the ID of the Edit Field. |
| |
| ChatBlade keeps track of any text a Player types into the
Edit Field, and stores that text in the appropriate instance of this
Class. When a Player wants to repeat a line of text they have
previously typed, ChatBlade can retrieve this text. This
functionality is known as Chat History, or Chat Repeat. |
| Typically if a Player hits the Up-Arrow, or Shift+Up-Arrow
when the Edit Field has focus the Game should replace the text in the
Edit Field with that retrieved from the Chat History. |
| CBEditFieldData::OnUpArrow()
returns a line that the Player had previously typed. Calling it
multiple times shall cycle backwards through the Chat History. CBEditFieldData::OnDownArrow()
cycles the opposite direction. |
| ChatBlade keeps track internally of where a Player is in
the Chat History. Once they actually enter a new line of Text this
internal counter is reset. |
| |
| If the line of text a Player enters in is the exact same
as the latest line of text in the Chat History, the new line is not
added into the Chat History. This prevents the Chat History from
filling up with the same line. |
| |
| In addition to keeping track of the Chat History,
CBEditFieldData also keeps track of the Default Slash Command for its
related UI Edit Field. |
| |
| ChatBlade allows each Edit Field to have a different
Default Slash Command. One UI Edit Field may default to
"/group", while another may default to "/say", and a
third can default to "/tell Irridia,". |
| If a Player enters in a line of text that does not start
with a Slash Command Character ('/'), ChatBlade shall prepend the
Default Slash Command to that line of text. |
| |
| Examples of when a Default Slash Command shall be
added: |
| If a UI Edit Field has a Default Slash
Command of "/group": |
| Player Types "Hello Guys" and
ChatBlade changes this to "/group Hello Guys" |
| Player Types "/auction Anyone
selling Enhanced Armor?" and ChatBlade leaves this the same since
it already starts with a Slash Command. |
| Player Types "/say I do" and
ChatBlade leaves this the same since it already starts with a Slash
Command. |
| |
| If multiple UI Chat Tabs share the same physical Edit
Field but it is desired that each Chat Tab have a different Default
Slash Command, then CBData::AddEditFieldData()
should get called once for each Chat Tab, using a unique ID for
each. |
| In this case each Chat Tab shall have a separate Chat
History, unless one CBEditFieldData is used and the Default Slash
Command is changed each time the Player selects a different Tab. |
| |
| This class provides 4 Static functions to enable the Game
Developers to easily access the Default Slash Command and the Chat
History, without having to go through the CBData Map of CBEditFieldData
instances. |
| These 4 static functions take the Edit Field ID as an
initial parameter. |
| |