ModernUO/Projects/UOContent/Engines/Virtues
Kamron Batman 839e56da1a
perf: Migrates Virtue gumps from legacy Gump to DynamicGump/StaticGump. (#2410)
## Summary

First PR in a multi-PR migration of player-facing legacy `Gump` subclasses to the modern `DynamicGump` / `StaticGump<T>` system. Plan covers ~95 files across ~14 PRs by system; this PR is the foundation (smallest, isolated, no cross-refs).

- `VirtueGump` → `DynamicGump`: per-instance virtue hues from `GetHueFor()` and the conditional self/other button block prevent layout caching.
- `VirtueStatusGump` → `StaticGump<VirtueStatusGump>`: layout is identical for every player; only used as a navigation hub.
- `VirtueInfoGump` → `DynamicGump`: dynamic cliloc IDs (`1051000 + (int)virtue`, the description cliloc, and the conditional `1052055`/`1052052` footer) cannot be cached by `StaticGump<T>` — cliloc *numbers* are baked into layout bytes, only HTML/label *text* can be deferred to placeholders.

All three:

- `Singleton => true` (replaces previous instance instead of stacking)
- Constructors made `private`; entry points are static (`RequestVirtueGump`, `DisplayTo`) per the empty-gump rule (CLAUDE.md §13)
- `OnResponse` updated to `in RelayInfo info` modern signature
- `VirtueInfoGump` self-refresh button now uses `_beholder.SendGump(this)` instead of allocating a new instance
- Removed the unused `VirtueGumpItem : GumpImage` nested class — replaced with direct `builder.AddImage(...)` calls; preserves the legacy `class=VirtueGumpItem` attribute for packet parity

The special-cased TypeID for VirtueGump (`BaseGump.cs:86`) is preserved because the type's full name (`Server.Engines.Virtues.VirtueGump`) is unchanged.
2026-04-25 16:40:07 -07:00
..
Compassion.cs fix: Cleans up entity persistence. Generalizes Mobiles/Items/Guilds (#1528) 2023-10-01 22:10:47 -07:00
Honor.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
HonorContext.cs fix: Fixes honor check crash on target killed (#1987) 2024-10-30 16:33:43 -07:00
HonorSelfGump.cs fix: Cleans up HonorGump and Honor checks (#1853) 2024-07-04 11:23:42 -07:00
IHonorTarget.cs fix: Overhauls virtue system (#1376) 2023-07-19 21:43:47 -07:00
Justice.cs feat: Adds Mobile.Murderer virtual property, consolidates kill-threshold checks (#2355) 2026-03-06 08:36:41 -08:00
Sacrifice.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00
Valor.cs fix: Cleans up entity persistence. Generalizes Mobiles/Items/Guilds (#1528) 2023-10-01 22:10:47 -07:00
VirtueContext.cs fix: Overhauls virtue system (#1376) 2023-07-19 21:43:47 -07:00
VirtueGump.cs perf: Migrates Virtue gumps from legacy Gump to DynamicGump/StaticGump. (#2410) 2026-04-25 16:40:07 -07:00
VirtueInfoGump.cs perf: Migrates Virtue gumps from legacy Gump to DynamicGump/StaticGump. (#2410) 2026-04-25 16:40:07 -07:00
VirtueStatusGump.cs perf: Migrates Virtue gumps from legacy Gump to DynamicGump/StaticGump. (#2410) 2026-04-25 16:40:07 -07:00
VirtueSystem.cs chore: Use var everywhere (#2294) 2025-12-27 16:47:28 -08:00