Skip to content

perf: Migrate New Guild System gumps to DynamicGump#2422

Open
kamronbatman wants to merge 1 commit intomainfrom
feat/migrate-new-guild-gumps
Open

perf: Migrate New Guild System gumps to DynamicGump#2422
kamronbatman wants to merge 1 commit intomainfrom
feat/migrate-new-guild-gumps

Conversation

@kamronbatman
Copy link
Copy Markdown
Contributor

Summary

Migrates the eight concrete New Guild System gumps (CreateGuild, GuildInfo,
GuildMemberInfo, GuildRoster, GuildDiplomacy, WarDeclaration,
GuildAdvancedSearch, GuildInvitationRequest) and three abstract bases
(BaseGuildGump, BaseGuildListGump, OtherGuildInfo) from the legacy Gump
class to DynamicGump. Layout work moves from constructor-side AddX(...)
calls into BuildLayout(ref DynamicGumpBuilder builder) — the abstract
BaseGuildGump now provides a BuildContent callout for shared
tab-strip chrome, and BaseGuildListGump<T> adds another
BuildListExtras hook so subclasses can paint highlighted titles after
the filter/sort/pagination chrome.

The headline win is the self-refresh pattern on the list gumps and
diplomacy advanced search. Previously each filter/sort/back/forward
click allocated a brand new gump via GetResentGump. After migration,
those handlers mutate _filter, _startNumber, _comparer, _ascending,
or _display on the existing gump and call from.SendGump(this),
letting the singleton path in NetStateGumps.Send swap in the same
instance with the new layout. The original list is preserved separately
from the per-render filtered/sorted _displayList, so refreshes pick up
the latest state without losing the source list.

All guild gumps deal with per-instance dynamic strings (guild names,
member names, war declarations, alliance names), which would defeat
StaticGump<T> caching per the cliloc rule, so every concrete subclass
migrates to DynamicGump. AllianceRosterGump (in Misc/Guild.cs)
is a GuildDiplomacyGump subclass and inherits the new behavior; its
unused override and stored alliance reference were dropped along with
the now-obsolete GetResentGump abstract.

Test plan

  • dotnet build Projects/UOContent/UOContent.csproj clean (0 warnings, 0 errors)
  • dotnet build of the full solution clean
  • In-game smoke: form a guild via CreateGuildGump, invite a player, accept the invitation
  • Open GuildRosterGump, verify name/rank/last-on/title sort toggles refresh in place
  • Open GuildRosterGump, type a filter and click the filter button, verify list updates without reopening
  • Page through roster with back/forward, verify pagination state advances and clamps correctly
  • Open GuildDiplomacyGump, swap among All/Awaiting Action/Relations tabs via Advanced Search, verify content refresh
  • Declare war via WarDeclarationGump, accept/dismiss/modify via OtherGuildInfo
  • Vote for, promote, demote, and kick members via GuildMemberInfoGump

🤖 Generated with Claude Code

Three abstract bases (BaseGuildGump, BaseGuildListGump, OtherGuildInfo)
extend DynamicGump with shared BuildContent chrome. Concrete roster,
diplomacy, member-info, and war gumps now self-refresh via
SendGump(this) after mutating _currentTab/_sortColumn/_pageIndex,
eliminating the per-click reallocation hot path on guild dialogs.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant