fix: Adds static warning/notice gumps. (#1741)

### Summary
* Adds `StaticNoticeGump<T>` and `StaticWarningGump<T>`
* Converts NoticeGump/WarningGump to use `DynamicGump`
* Changes various uses of notice gump and warning gump to their static counterpart.
This commit is contained in:
Kamron Batman 2024-04-26 17:19:16 -07:00 • committed by GitHub
parent 65532ea887
commit bb7bc57e42
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 713 additions and 430 deletions

View file

@ -2240,22 +2240,8 @@ namespace Server.Multis
if (HasRentedVendors)
{
/* You are about to be traded a home that has active vendor contracts.
* While there are active vendor contracts in this house, you
* <strong>cannot</strong> demolish <strong>OR</strong> customize the home.
* When you accept this house, you also accept landlordship for every
* contract vendor in the house.
*/
to.SendGump(
new WarningGump(
1060635,
30720,
1062487,
32512,
420,
280,
okay => ConfirmTransfer_Callback(to, okay, from)
)
new TradeHouseWarningGump(okay => ConfirmTransfer_Callback(to, okay, from))
);
}
else
@ -2266,6 +2252,24 @@ namespace Server.Multis
}
}
private class TradeHouseWarningGump : StaticWarningGump<TradeHouseWarningGump>
{
/*
* You are about to be traded a home that has active vendor contracts.
* While there are active vendor contracts in this house, you
* <strong>cannot</strong> demolish <strong>OR</strong> customize the home.
* When you accept this house, you also accept landlordship for every contract vendor in the house.
*/
public override int StaticLocalizedContent => 1062487;
public override int Width => 420;
public override int Height => 280;
public TradeHouseWarningGump(Action<bool> callback) : base(callback)
{
}
}
private void ConfirmTransfer_Callback(Mobile to, bool ok, Mobile from)
{
if (!ok || Deleted || !from.CheckAlive() || !IsOwner(from))