Class DynamicChatPopup
Note this is in LlamaSoftware.Chat.Demo namespace so it works in the demo but may require modification to work in your game. However if you only want to be able to Whisper, Add Friend, and Block players, no modifications should be necessary.
Used in conjunction with ChatPopup to allow clicking on ChatMessages.
Inheritance
Inherited Members
Namespace: LlamaSoftware.Chat.Demo
Assembly: LlamaSoftware.Chat.Demo.dll
Syntax
public class DynamicChatPopup : ChatPopupClickHandler
Fields
Popup
The Chat Popup this belongs to
Declaration
protected ChatPopup Popup
Field Value
Type | Description |
---|---|
ChatPopup |
Methods
HandleAddFriend(TMP_LinkInfo)
Handles the Add Friend event. Sends a AddRemoveFriendMessage to the server with the PlayerId on the UIChatMessage clicked.
Declaration
protected virtual void HandleAddFriend(TMP_LinkInfo ClickedLink)
Parameters
Type | Name | Description |
---|---|---|
TMPro.TMP_LinkInfo | ClickedLink | TextMeshPro link information. |
HandleBlockPlayer(TMP_LinkInfo)
Handles the Block Player event. Sends a BlockUnblockPlayerMessage message to the server with the PlayerId on the UIChatMessage clicked.
Declaration
protected virtual void HandleBlockPlayer(TMP_LinkInfo ClickedLink)
Parameters
Type | Name | Description |
---|---|---|
TMPro.TMP_LinkInfo | ClickedLink | TextMeshPro link information. |
HandleClick(ChatPopup, TMP_LinkInfo, PointerEventData)
Declaration
public override void HandleClick(ChatPopup Popup, TMP_LinkInfo ClickedLink, PointerEventData pointerEventData)
Parameters
Type | Name | Description |
---|---|---|
ChatPopup | Popup | |
TMPro.TMP_LinkInfo | ClickedLink | |
UnityEngine.EventSystems.PointerEventData | pointerEventData |
Overrides
HandleLeftClick(TMP_LinkInfo)
Handles left click events. Will DirectMessagePlayer(String, String) if the clicked player is not the current local player.
Declaration
protected virtual void HandleLeftClick(TMP_LinkInfo ClickedLink)
Parameters
Type | Name | Description |
---|---|---|
TMPro.TMP_LinkInfo | ClickedLink | Link info from TextMeshPro |
HandleRightClick(TMP_LinkInfo)
Handles right click events.
Positions the popup and calls UnityEngine.Animator.SetTrigger(System.String) with FADE_IN if the Popup is not visible. If it is visible and the same link is clicked again, then UnityEngine.Animator.SetTrigger(System.String) FADE_OUT is called.
Declaration
protected virtual void HandleRightClick(TMP_LinkInfo ClickedLink)
Parameters
Type | Name | Description |
---|---|---|
TMPro.TMP_LinkInfo | ClickedLink |
OnPointerClick(String)
Pointer click event from DynamicChatItem. Currently ClickId supports WHISPER, ADD_FRIEND, and BLOCK_PLAYER. Any additional cases can be added easily in the switch below or by subclassing this.
Calls UnityEngine.Animator.SetTrigger(System.String) with FADE_OUT.
Declaration
public virtual void OnPointerClick(string ClickId)
Parameters
Type | Name | Description |
---|---|---|
System.String | ClickId | ClickId of the event. Currently supports WHISPER, ADD_FRIEND, and BLOCK_PLAYER. |