Table of Contents

Class UITKFriendList

Namespace
FishMMO.Client
Assembly
FishMMO.Client.dll

Friend list panel. Renders each friend as a row carrying a presence dot, name, status and a remove button, and handles the add and remove actions. Rows are built at runtime rather than cloned from a per-entry control, and the shared dialog panels are reused for the prompts.

public class UITKFriendList : UITKCharacterControl
Inheritance
Object
Component
Behaviour
MonoBehaviour
UITKFriendList
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.GetEntityId()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Remarks

The list is split into a MODEL (FishMMO.Client.UITKFriendList.friends, plain data, owned by the character) and a VIEW (FishMMO.Client.UITKFriendList.rows, elements owned by one visual tree). UIDocument re-clones the UXML on every enable, so the view is destroyed on each hide/show; keeping only the view left the panel permanently empty after the first close, because the data that would have redrawn it was inside the discarded elements. See OnAfterStarting().

Methods

FriendController_OnAddFriend(long, bool)

Adds or updates a friend with the latest name and online status.

public void FriendController_OnAddFriend(long friendID, bool online)

Parameters

friendID long

The friend's character ID.

online bool

Whether the friend is online.

FriendController_OnRemoveFriend(long)

Removes a friend.

public void FriendController_OnRemoveFriend(long friendID)

Parameters

friendID long

The friend's character ID.

OnAfterStarting()

Re-applies the friend list after the visual tree was rebuilt.

protected override void OnAfterStarting()

Remarks

The base implementation re-runs the character pre/post pair, which is what re-subscribes this panel to the friend controller; the rebuild below then redraws whatever the model already holds.

OnButtonAddFriend()

Prompts for a name and broadcasts an add-friend request.

public void OnButtonAddFriend()

OnDestroying()

Clears all friend rows when the control is destroyed.

public override void OnDestroying()

OnPostSetCharacter()

Subscribes to friend controller events after the character is set.

public override void OnPostSetCharacter()

OnPostUnsetCharacter()

Drops the friend list once the character is gone.

public override void OnPostUnsetCharacter()

Remarks

The model outlives the visual tree on purpose, so nothing else would clear it — and a character with no friends generates no list traffic to overwrite it, which is what left the previous character's friends on screen after a character switch.

OnPreSetCharacter()

Unsubscribes from the outgoing character's friend controller.

public override void OnPreSetCharacter()

Remarks

UITKCharacterControl.OnAfterStarting calls Pre then Post on every tree rebuild so the pair cancels out. Leaving this un-overridden made the Pre call a no-op, so every reopen stacked another subscription onto the same controller.

OnPreUnsetCharacter()

Unsubscribes from friend controller events before the character is unset.

public override void OnPreUnsetCharacter()

OnStarting()

Queries the friend list and wires up the add-friend button.

public override void OnStarting()

Remarks

Runs against a fresh tree every time, so it drops the old view first — those elements belong to a tree that no longer exists.