ModernUO/Projects/UOContent/Mobiles/Townfolk
Kamron Batman 50599e0453
perf: Migrate NPC and Skill UI gumps to DynamicGump/StaticGump (#2414)
## Summary

Migrates five legacy `Gump`-derived UI dialogs in the NPC and Skill domains to the modern `DynamicGump` builder pipeline. All five gumps were chosen as `DynamicGump` rather than `StaticGump<T>` because their layout shape varies per instance, and several of them carry per-instance localization numbers (cliloc IDs) that the static cache cannot bake (see CLAUDE.md gump-system rule and `dev-docs/gump-system.md`).

Per-gump rationale:

- **`TownCrierGump` (`Mobiles/Townfolk/TownCrier.cs`)** - DynamicGump. Announcement count varies, expiration text is rebuilt per render via `ValueStringBuilder`, and one button per entry is emitted in a loop.
- **`ClaimListGump` (`Mobiles/Vendors/NPC/AnimalTrainer.cs`)** - DynamicGump. The pet list and resulting background/alpha-region heights vary per stabling player.
- **`AnimalLoreGump` (`Skills/AnimalLore.cs`)** - DynamicGump. Page count itself varies (3 pages pre-AOS, 5 pages on AOS) and several `AddHtmlLocalized` calls use cliloc IDs computed from per-creature data (loyalty rating `1049595 + c.Loyalty / 10`, food preference, pack instinct), which violates the StaticGump cliloc-bake rule.
- **`DisguiseGump` (`Items/Skill Items/Thief/DisguiseKit.cs`)** - DynamicGump. Page count and entry order shift on `from.Female`, `Body.IsFemale`, and `startAtHair`.
- **`CommentsGump` (`Gumps/CommentsGump.cs`)** - DynamicGump. Comment list and pagination depend on `Account.Comments` size; the title label encodes the variable account username string.

All five are now `Singleton => true`, have `private` constructors, and expose static `DisplayTo(...)` entry points that validate prerequisites before constructing - guaranteeing no empty gumps (CLAUDE.md Sec.13). All internal refresh paths (prompts, `OnDoubleClick`, command handlers, target callbacks) were updated to call `DisplayTo` rather than `new XGump(...)`. Legacy `m_`-prefixed fields renamed to `_camelCase` (CLAUDE.md Sec.12), and `DisguiseEntry`'s `m_`-prefixed public readonly fields converted to PascalCase auto-properties. `OnResponse` signatures updated to `in RelayInfo info`. No external callers needed updating - all `new XGump(...)` sites lived inside the same files.
2026-04-25 19:51:42 -07:00
..
Actor.cs chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
Artist.cs chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
Banker.cs fix: Fixes exploits with bank box deposits. Makes stacking more efficient (#2337) 2026-02-13 20:34:35 -08:00
BaseEscortable.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
BrideGroom.cs fix: Fixes ML Escortables and codegens (#1525) 2023-09-30 14:11:48 -07:00
EscortableMage.cs fix: Fixes ML Escortables and codegens (#1525) 2023-09-30 14:11:48 -07:00
Gypsy.cs chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
HarborMaster.cs chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
Merchant.cs fix: Fixes ML Escortables and codegens (#1525) 2023-09-30 14:11:48 -07:00
Messenger.cs fix: Fixes ML Escortables and codegens (#1525) 2023-09-30 14:11:48 -07:00
Minter.cs fix: Fixes ML Escortables and codegens (#1525) 2023-09-30 14:11:48 -07:00
Ninja.cs fix: Fixes ML Escortables and codegens (#1525) 2023-09-30 14:11:48 -07:00
Noble.cs fix: Fixes ML Escortables and codegens (#1525) 2023-09-30 14:11:48 -07:00
Peasant.cs fix: Fixes ML Escortables and codegens (#1525) 2023-09-30 14:11:48 -07:00
Prisoner.cs fix: Fixes ML Escortables and codegens (#1525) 2023-09-30 14:11:48 -07:00
Samurai.cs fix: Fixes ML Escortables and codegens (#1525) 2023-09-30 14:11:48 -07:00
Sculptor.cs chore: Fixes variable types for possible performance issues (#2172) 2025-05-01 21:54:41 -07:00
SeekerOfAdventure.cs fix: Fixes ML Escortables and codegens (#1525) 2023-09-30 14:11:48 -07:00
TownCrier.cs perf: Migrate NPC and Skill UI gumps to DynamicGump/StaticGump (#2414) 2026-04-25 19:51:42 -07:00