perf: Migrate PlayerVendor gumps to DynamicGump/StaticGump (#2430)
## Summary
Converts the five PlayerVendor-related gumps from legacy `Gump` to `DynamicGump` or `StaticGump<T>` using the static `DisplayTo` entry-point pattern.
| Gump | Target | Reason |
|---|---|---|
| `PlayerVendorBuyGump` | StaticGump | Fixed layout; per-instance `Description` and `Price` filled via `BuildStrings` placeholders. |
| `PlayerVendorOwnerGump` | StaticGump | Fixed layout; `HoldGold`, `BankAccount`, `perDay`, `days`, `earthDays` via placeholders. |
| `NewPlayerVendorOwnerGump` | DynamicGump | Layout varies by `goldHeld < perRealWorldDay` and `RentedVendor` branch. |
| `PlayerVendorCustomizeGump` | StaticGump | Categories-driven fixed layout. **Dropped unused `Mobile from` constructor arg** since it's only used in `OnResponse` (where `state.Mobile` is available). |
| `NewPlayerVendorCustomizeGump` | DynamicGump | BEARD section depends on `vendor.Female`. |
All builder slots and labels use `$"{value}"` interpolated-string-handler form for zero-allocation text. Inner `PVHuePicker` / `PVHairHuePicker` (HuePicker derivatives) are unchanged.
Updates callers in `PlayerVendor` and `PlayerBarkeeper`.
This commit is contained in:
parent
acae1c6ead
commit
14f9d682e8
3 changed files with 327 additions and 261 deletions
File diff suppressed because it is too large
Load diff
|
|
@ -473,7 +473,7 @@ public partial class PlayerBarkeeper : BaseVendor
|
|||
|
||||
public void BeginChangeAppearance(Mobile from)
|
||||
{
|
||||
from.SendGump(new PlayerVendorCustomizeGump(this, from));
|
||||
PlayerVendorCustomizeGump.DisplayTo(from, this);
|
||||
}
|
||||
|
||||
public void ChangeGender()
|
||||
|
|
|
|||
|
|
@ -704,13 +704,13 @@ public partial class PlayerVendor : Mobile
|
|||
{
|
||||
gumps.Close<NewPlayerVendorCustomizeGump>();
|
||||
gumps.Close<NewPlayerVendorOwnerGump>();
|
||||
gumps.Send(new NewPlayerVendorOwnerGump(this));
|
||||
NewPlayerVendorOwnerGump.DisplayTo(to, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
gumps.Close<PlayerVendorCustomizeGump>();
|
||||
gumps.Close<PlayerVendorOwnerGump>();
|
||||
gumps.Send(new PlayerVendorOwnerGump(this));
|
||||
PlayerVendorOwnerGump.DisplayTo(to, this);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -759,7 +759,7 @@ public partial class PlayerVendor : Mobile
|
|||
}
|
||||
else
|
||||
{
|
||||
from.SendGump(new PlayerVendorBuyGump(vendor, vi));
|
||||
PlayerVendorBuyGump.DisplayTo(from, vendor, vi);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1280,7 +1280,7 @@ public partial class PlayerVendor : Mobile
|
|||
|
||||
from.SendLocalizedMessage(1062496); // Your vendor has been renamed.
|
||||
|
||||
from.SendGump(new NewPlayerVendorOwnerGump(m_Vendor));
|
||||
NewPlayerVendorOwnerGump.DisplayTo(from, m_Vendor);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1307,7 +1307,7 @@ public partial class PlayerVendor : Mobile
|
|||
|
||||
m_Vendor.ShopName = name.FixHtml();
|
||||
|
||||
from.SendGump(new NewPlayerVendorOwnerGump(m_Vendor));
|
||||
NewPlayerVendorOwnerGump.DisplayTo(from, m_Vendor);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue