ModernUO/Projects/UOContent/Items/Special/Gifts/TapestryOfSosaria.cs
Kamron Batman 8282b00ca2
feat: Moves gumps out of the core (#1916)
> [!Important]
> **Developer Note**
> This code change will **completely move gumps out of the core**


### Summary

- Adds `GetGumps()` convenience which exposes methods to Find/Close/Send multiple gumps. This helper is a performance improvement by eliminating the Dictionary<Player, List> lookup for gumps.
2024-08-09 19:07:32 -07:00

60 lines
1.5 KiB
C#

using ModernUO.Serialization;
using Server.Collections;
using Server.ContextMenus;
using Server.Gumps;
using Server.Multis;
namespace Server.Items;
[Flippable(0x234E, 0x234F)]
[SerializationGenerator(1)]
public partial class TapestryOfSosaria : Item, ISecurable
{
[SerializedIgnoreDupe]
[SerializableField(0)]
[SerializedCommandProperty(AccessLevel.GameMaster)]
private SecureLevel _level;
[Constructible]
public TapestryOfSosaria() : base(0x234E)
{
Weight = 1.0;
LootType = LootType.Blessed;
}
public override int LabelNumber => 1062917; // The Tapestry of Sosaria
public override void GetContextMenuEntries(Mobile from, ref PooledRefList<ContextMenuEntry> list)
{
base.GetContextMenuEntries(from, ref list);
SetSecureLevelEntry.AddTo(from, this, ref list);
}
public override void OnDoubleClick(Mobile from)
{
if (from.InRange(GetWorldLocation(), 2))
{
from.SendGump(new InternalGump());
}
else
{
from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
}
}
private void Deserialize(IGenericReader reader, int version)
{
Level = (SecureLevel)reader.ReadEncodedInt();
}
private class InternalGump : Gump
{
public override bool Singleton => true;
public InternalGump() : base(50, 50)
{
AddImage(0, 0, 0x2C95);
}
}
}