perf: Migrates New Guild System gumps from legacy Gump. (#2422)
## 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.
This commit is contained in:
parent
598c3c125c
commit
9c2ac2b8ea
12 changed files with 642 additions and 689 deletions
|
|
@ -351,8 +351,6 @@ namespace Server.Guilds
|
|||
|
||||
public class AllianceRosterGump : GuildDiplomacyGump
|
||||
{
|
||||
private readonly AllianceInfo m_Alliance;
|
||||
|
||||
public AllianceRosterGump(PlayerMobile pm, Guild g, AllianceInfo alliance) : base(
|
||||
pm,
|
||||
g,
|
||||
|
|
@ -361,32 +359,12 @@ namespace Server.Guilds
|
|||
0,
|
||||
alliance.m_Members,
|
||||
alliance.Name
|
||||
) =>
|
||||
m_Alliance = alliance;
|
||||
|
||||
public AllianceRosterGump(
|
||||
PlayerMobile pm, Guild g, AllianceInfo alliance, IComparer<Guild> currentComparer,
|
||||
bool ascending, string filter, int startNumber
|
||||
) : base(
|
||||
pm,
|
||||
g,
|
||||
currentComparer,
|
||||
ascending,
|
||||
filter,
|
||||
startNumber,
|
||||
alliance.m_Members,
|
||||
alliance.Name
|
||||
) =>
|
||||
m_Alliance = alliance;
|
||||
)
|
||||
{
|
||||
}
|
||||
|
||||
protected override bool AllowAdvancedSearch => false;
|
||||
|
||||
public override Gump GetResentGump(
|
||||
PlayerMobile pm, Guild g, IComparer<Guild> comparer, bool ascending,
|
||||
string filter, int startNumber
|
||||
) =>
|
||||
new AllianceRosterGump(pm, g, m_Alliance, comparer, ascending, filter, startNumber);
|
||||
|
||||
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||
{
|
||||
if (info.ButtonID != 8) // So that they can't get to the AdvancedSearch button
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue