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

@ -121,7 +121,7 @@ public partial class HordeMinionFamiliar : BaseFamiliar
if (Backpack?.Items.Count > 0)
{
from.SendGump(
new WarningGump(1060635, 30720, 1061672, 32512, 420, 280, okay => ConfirmRelease_Callback(from, okay))
new ReleaseFamiliarWarningGump(okay => ConfirmRelease_Callback(from, okay))
);
}
else
@ -185,4 +185,20 @@ public partial class HordeMinionFamiliar : BaseFamiliar
PackAnimal.GetContextMenuEntries(this, from, list);
}
private class ReleaseFamiliarWarningGump : StaticWarningGump<ReleaseFamiliarWarningGump>
{
/*
* If you release your familiar, everything in its backpack will be destroyed!
* Are you sure you want to release your familiar?
*/
public override int StaticLocalizedContent => 1061672;
public override int Width => 420;
public override int Height => 280;
public ReleaseFamiliarWarningGump(Action<bool> callback) : base(callback)
{
}
}
}

View file

@ -1246,7 +1246,7 @@ namespace Server.Mobiles
notice = "The server is currently under lockdown. You have sufficient access level to connect.";
}
from.SendGump(new NoticeGump(1060637, 30720, notice, 0xFFC000, 300, 140));
from.SendGump(new ServerLockdownNoticeGump(notice));
return;
}
@ -1257,6 +1257,15 @@ namespace Server.Mobiles
}
}
private class ServerLockdownNoticeGump : StaticNoticeGump<ServerLockdownNoticeGump>
{
public override int Width => 300;
public override int Height => 140;
public override string Content { get; }
public ServerLockdownNoticeGump(string content) => Content = content;
}
public void ValidateEquipment()
{
if (m_NoDeltaRecursion || Map == null || Map == Map.Internal)