Namespace LlamaSoftware.Chat.UI
Classes
BlockedPlayer
UI Representation of a Block List Player
ChatChannelClickHandler
Basic handler for allowing changing chat channels by left clicking on the Chat Channel on a ChatMessage. Called by the ChatPanel.
ChatPanel
Primary workhorse for the UI. Handles dispatching Send/Received messages events.
ChatPanel.DirectChatPlayer
Representation of a Direct Message Chat Player
ChatPanel.UIChatChannel
UI Model for Chat Channels.
ChatPopup
Very similar to SocialUIPopup, but for the ChatPanel. We need different information like UIChatMessage instead of
Assign your own custom subclass of ChatPopupClickHandler to manage the actual clicking functionality.
Note: OnDeselect(BaseEventData) calls UnityEngine.Animator.SetTrigger(System.String) with FADE_OUT. To avoid warnings the UnityEngine.RuntimeAnimatorController should have a Trigger with that name.
ChatPopupClickHandler
Subclass this to get specific handlers for more commands other than Add Friend, Whisper, Block Player.
Same concept as SocialClickHandler but for the ChatPanel.
See
Command
Chat Commands are commands users can execute by typing /[command name]
In the examples, we have a Chat command /ping that tells a user their
Optionally you can set CallFunctionThenSendMessage to true, which will: remove the /command from the message, execute that command, then send the message over the network.
In the examples, we have a chat command /[channel] that changes the chat channel then sends the message. So a user can type /say hi all! and it will change the active channel to the "Say" channel then send the message "hi all!" over the network on that channel.
That setup is as follows:
Name = "say"
CallFunctionThenSendMessage = true
Function to call = A Unity Event that changes the chat channel
DynamicChatItem
Text items generated by Chat Popups. They bind animation controllers and click events. OnClickAction should handle a string argument being passed and make decisions on what to do based on the argument passed.
DynamicChatItemEvent
Class to make a serializable UnityEngine.Events.UnityEvent<T0> appear in the inspector. Used to propogate click events.
Friend
UI representation of a Friend
SocialClickHandler
Same concept as
Provides right click support to add friend, remove friend, remove blocked player. Left click to immediately whisper friends.
SocialUI
Social UI Panel. This manages Friends and Blocked Players. In the demo they are on the same Panel, though this is not a requirement This does not have a custom inspector since it's just references to other components and dispatching events as necessary.
SocialUIClickHandler
Subclass this to get specific handlers for more commands other than Add Friend, Whisper, Block Player. Same concept as ChatPopupClickHandler but for the SocialUI. See SocialClickHandler as an example.
SocialUIPopup
This is largely the same as ChatPopup. We need different references here like Player instead of UIChatMessage for example. A popup container for propagating clicks on Social UI elements.
Assign your own custom subclass of SocialUIClickHandler to manage the actual clicking functionality.
Note: OnDeselect(BaseEventData) calls UnityEngine.Animator.SetTrigger(System.String) with FADE_OUT. To avoid warnings the UnityEngine.RuntimeAnimatorController should have a Trigger with that name.
UIChatMessage
This is the control for messages displayed on the UI. Currently it supports Clicking, Hovering, and Unhovering as defined by IPointerClickHandler, IPointerEnterHandler, IPointerExitHandler If you would like to add more events, you can implement other I[some event]Handlers and do whatever logic you would like to do there, similar to how these 3 have been implemented.
WordFilter
Model for Word Filters. Input strings are matched against RegularExpressions to replace any blacklisted words with the ReplaceWith text. If IgnoreCase is provided then the regular expression can be more simple and match more aggressively to catch words where people may try to avoid the filter by writing "pOOp" instead of "poop". regex must be generated and applied outside of this class. See the System.Text.RegularExpressions.Regex documentation for how to build it correctly, or just use RebuildWordFilterDictionary().
Example setup: RegularExpression = "cats" ReplaceWith = "*" IgnoreCase = true User inputs: "I love CATS!" Message sent over network: "I love *!" All users receive "I love *!"
Enums
Friend.Status
Status of a friend. Can be extended to support any number of statuses. Just add cases to SetStatus(Friend.Status) to also support it on the UI
LinkType
Types of links