Class UITKGuild
UI Toolkit guild panel. Two pages — a filterable member roster and an information page carrying the guild's notice, message of the day and leadership actions — plus a per-member context menu and hover card. The shared dialog and context-menu overlays are resolved by name through the UIManager rather than referenced directly.
public class UITKGuild : UITKCharacterControl
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourUITKGuild
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.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.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.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.nameObject.hideFlags
Remarks
The roster is held in two halves that must not be confused:
- FishMMO.Client.UITKGuild.roster is the MODEL — plain data, no
VisualElementanywhere in it. It is owned by the character, not by the visual tree, so it survives a tree rebuild and is cleared only when the character is unset. - FishMMO.Client.UITKGuild.rows is the VIEW — the elements currently rendering the model. Every entry in it belongs to one specific visual tree.
UIDocument re-clones the UXML every time the document is enabled, so the entire view
is thrown away on each hide/show. The previous version of this panel kept ONLY the view;
after one close the rows were orphaned in a dead tree and the roster could never come back,
because the data that would have rebuilt it had gone with the elements. That is why
OnStarting() drops the view and OnAfterStarting() rebuilds it from
the model — and why the guild text, the active tab and the filter state are all fields
rather than element reads.
Methods
GuildController_OnAddGuildMember(GuildAddBroadcast)
Adds a member row and refreshes the guild name label.
public void GuildController_OnAddGuildMember(GuildAddBroadcast msg)
Parameters
msgGuildAddBroadcastThe roster row as the server sent it.
GuildController_OnAddMember(GuildAddBroadcast)
Adds or updates a guild member.
public void GuildController_OnAddMember(GuildAddBroadcast msg)
Parameters
msgGuildAddBroadcastThe roster row as the server sent it.
GuildController_OnLeaveGuild()
Resets the guild label and clears all member rows when leaving the guild.
public void GuildController_OnLeaveGuild()
GuildController_OnReceiveGuildInfo(long, string, string, string)
Stores and displays the guild's descriptive text.
public void GuildController_OnReceiveGuildInfo(long guildID, string name, string notice, string messageOfTheDay)
Parameters
guildIDlongThe guild the text belongs to.
namestringThe guild's display name.
noticestringThe guild's notice text.
messageOfTheDaystringThe guild's message of the day.
Remarks
Held in fields, not read back out of the labels: the labels belong to the visual tree and this text arrives once on join and then only when somebody edits it, so a tree rebuild between edits would otherwise blank it until the next edit.
GuildController_OnReceiveGuildInvite(long)
Prompts the local player to accept or decline a received guild invite.
public void GuildController_OnReceiveGuildInvite(long inviterCharacterID)
Parameters
inviterCharacterIDlongThe inviter's character ID.
Remarks
The inviter's ID is carried back on the accept broadcast. The server used to resolve "whatever invite is pending for this character" from an empty struct, so a dialog left open past the invitation TTL joined whichever guild invited the player NEXT. Sending the identity the dialog was actually raised for lets the server refuse the mismatch.
GuildController_OnReceiveGuildLog(long, GuildLogEntry[])
Stores and renders the guild's activity log.
public void GuildController_OnReceiveGuildLog(long guildID, GuildLogEntry[] entries)
Parameters
guildIDlongThe guild the log belongs to.
entriesGuildLogEntry[]The entries, newest first.
GuildController_OnReceiveGuildRanks(GuildRankListBroadcast)
Stores the guild's rank ladder and re-renders everything that depends on it.
public void GuildController_OnReceiveGuildRanks(GuildRankListBroadcast msg)
Parameters
msgGuildRankListBroadcastThe ladder, and the viewer's own standing in it.
Remarks
The viewer's permissions are taken from the message rather than derived by looking the viewer's rank up in the ladder that arrived with it. The server computed them; deriving them again here would be a second implementation of the permission rules, and the one that drew the buttons would be the one that was wrong.
GuildController_OnReceiveGuildResult(GuildResultType)
Displays chat feedback for the result of a guild operation.
public void GuildController_OnReceiveGuildResult(GuildResultType result)
Parameters
resultGuildResultTypeThe guild operation result.
GuildController_OnRemoveMember(long)
Removes a guild member.
public void GuildController_OnRemoveMember(long characterID)
Parameters
characterIDlongThe member's character ID.
GuildController_OnValidateGuildMembers(HashSet<long>)
Removes member rows that are no longer in the validated member set.
public void GuildController_OnValidateGuildMembers(HashSet<long> newMembers)
Parameters
OnAfterStarting()
Re-applies the roster, guild text, tab and filters after the visual tree was rebuilt.
protected override void OnAfterStarting()
Remarks
This is the hook that closes CRIT-5. The base implementation re-runs the character pre/post pair, which is what re-subscribes this panel to the guild controller; the rebuild below then re-renders whatever the model already holds, so a guild that was on screen before the panel was closed is on screen again when it reopens — without waiting for the next server pump.
OnButtonCreateGuild()
Prompts for a guild name and broadcasts a create-guild request.
public void OnButtonCreateGuild()
OnButtonDisbandGuild()
Confirms by name, then broadcasts a disband request.
public void OnButtonDisbandGuild()
Remarks
Typing the guild's name is the confirmation. Disbanding cannot be undone and destroys something other people belong to, so a single Yes button is the wrong instrument — the name has to be produced deliberately. The server compares it against the guild the requester is actually in, so this is a real check rather than a client-side ritual.
OnButtonEditMessageOfTheDay()
Prompts for and submits a new guild message of the day.
public void OnButtonEditMessageOfTheDay()
OnButtonEditNotice()
Prompts for and submits a new guild notice.
public void OnButtonEditNotice()
OnButtonInviteToGuild()
Invites the current target, or prompts for a name, to the guild.
public void OnButtonInviteToGuild()
OnButtonLeaveGuild()
Confirms then broadcasts a leave-guild request.
public void OnButtonLeaveGuild()
OnDestroying()
Clears the guild member list when the control is destroyed.
public override void OnDestroying()
OnPostSetCharacter()
Subscribes to guild controller events after the character is set.
public override void OnPostSetCharacter()
OnPostUnsetCharacter()
Drops the roster once the character is gone.
public override void OnPostUnsetCharacter()
Remarks
The model outlives the visual tree on purpose, which means nothing else would ever clear it. Without this, quitting to login and coming back on a different character showed the PREVIOUS character's guild until the next server pump overwrote it — and showed it permanently if the new character has no guild at all, because a guildless character generates no roster traffic to correct it.
OnPreSetCharacter()
Unsubscribes from the outgoing character's guild controller.
public override void OnPreSetCharacter()
Remarks
UITKCharacterControl.OnAfterStarting calls Pre then Post on every tree rebuild
specifically so the pair cancels out. Leaving this un-overridden — as this panel used
to — made the Pre call a no-op, so every reopen stacked another subscription and each
roster update ran the handlers one more time than the last.
OnPreUnsetCharacter()
Unsubscribes from guild controller events before the character is unset.
public override void OnPreUnsetCharacter()
OnStarting()
Queries elements and wires up the action buttons.
public override void OnStarting()
Remarks
Runs against a FRESH tree every time, including after a rebuild, so the first thing it
does is drop the old view. The elements in it belong to a tree that no longer exists;
keeping them would leave the panel writing into orphaned elements forever.
The buttons are new objects too, so += here cannot accumulate handlers.
OnTick()
Applies any pending view rebuild, at most once per frame.
protected override void OnTick()