ModernUO/Projects/UOContent/Engines/Plants
Kamron Batman 2423950cca
perf: Migrate Plant gumps to DynamicGump/StaticGump (#2411)
## Summary

Second PR in the player-facing legacy gump migration. Converts the four Plants system gumps:

- `MainPlantGump`, `ReproductionGump`, `EmptyTheBowlGump` → `DynamicGump`. Layout varies by plant status, growth stage, health, and pollination/resource availability — cannot use cached `StaticGump<T>`.
- `SetToDecorativeGump` → `StaticGump<SetToDecorativeGump>`. Pure confirmation dialog with no per-instance variation.

All four:

- `Singleton => true` (auto-replace previous plant gump on re-open instead of stacking)
- Constructor `private`; entry is static `DisplayTo(Mobile, PlantItem)` per the empty-gump rule (CLAUDE.md §13)
- `OnResponse` self-refresh paths converted from `from.SendGump(new XGump(_plant))` to `from.SendGump(this)` — saves an allocation on every help/info button click and on every "gather resources/seeds/pollen" action
- Helper draw methods take `ref DynamicGumpBuilder builder` instead of mutating instance state
- Renamed legacy `m_Plant` to `_plant` per CLAUDE.md §12

Updated external callers to use the new entry points:

- `PlantItem.OnDoubleClick` → `MainPlantGump.DisplayTo(from, this)`
- `PlantPourTarget.OnTargetFinish` → `MainPlantGump.DisplayTo(from, m_Plant)` (also drops the now-redundant legacy `singleton: true` flag — `Singleton` property handles it)
- `PollinateTarget.OnTargetFinish` → `ReproductionGump.DisplayTo(from, m_Plant)`
2026-04-25 16:46:37 -07:00
..
MiscItems feat: Adds new decay system and SkipSerialization (#2311) 2026-01-08 11:43:51 -08:00
MiscMobiles fix: Codegens and fixes bugs with plant system (#1490) 2023-09-05 19:20:03 -07:00
EmptyTheBowlGump.cs perf: Migrate Plant gumps to DynamicGump/StaticGump (#2411) 2026-04-25 16:46:37 -07:00
MainPlantGump.cs perf: Migrate Plant gumps to DynamicGump/StaticGump (#2411) 2026-04-25 16:46:37 -07:00
PlantBowl.cs fix: Optimizes items to use default weights. (Part 1) (#2240) 2025-07-24 14:44:39 -07:00
PlantHue.cs chore: Cleans up pattern checks. (#892) 2021-12-24 15:53:59 -08:00
PlantItem.cs perf: Migrate Plant gumps to DynamicGump/StaticGump (#2411) 2026-04-25 16:46:37 -07:00
PlantPourTarget.cs perf: Migrate Plant gumps to DynamicGump/StaticGump (#2411) 2026-04-25 16:46:37 -07:00
PlantResources.cs fix: Consolidates Color/Center html (#1762) 2024-05-07 23:56:32 -07:00
PlantSystem.cs feat: Add spawn position caching and spiral scan optimization (#2295) 2025-12-28 02:40:21 -08:00
PlantType.cs C# 9 Cleanup (#325) 2020-11-27 00:29:21 -08:00
PollinateTarget.cs perf: Migrate Plant gumps to DynamicGump/StaticGump (#2411) 2026-04-25 16:46:37 -07:00
ReproductionGump.cs perf: Migrate Plant gumps to DynamicGump/StaticGump (#2411) 2026-04-25 16:46:37 -07:00
Seed.cs fix: Optimizes items to use default weights. (Part 1) (#2240) 2025-07-24 14:44:39 -07:00
SetToDecorativeGump.cs perf: Migrate Plant gumps to DynamicGump/StaticGump (#2411) 2026-04-25 16:46:37 -07:00