From 2e08eda8cbffb4c32e194f7aa82f3a2fd2df3e5f Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Fri, 14 Feb 2025 00:15:14 -0800 Subject: [PATCH] feat: Standardizes South/East selection gumps (#1839) --- .../UOContent/Engines/BuffIcons/BuffInfo.cs | 1 - Projects/UOContent/Gumps/PetResurrectGump.cs | 1 - .../Gumps/SelectAddonDirectionGump.cs | 49 +++++++++++++++ .../Holiday Stuff/Christmas/2004/Mistletoe.cs | 46 +++++++------- .../Christmas/2010/Addons/FireFliesDeed.cs | 37 +++++------ .../Items/Deeds/IDirectionAddonDeed.cs | 8 +++ .../Broken Furniture Collection/BrokenBed.cs | 47 +++----------- .../BrokenVanity.cs | 48 +++----------- .../Items/Special/Gifts/HearthOfHomeFire.cs | 22 ++++--- .../Items/Special/Heritage Items/Curtains.cs | 47 +++----------- .../Special/Heritage Items/HangingAxes.cs | 47 +++----------- .../Special/Heritage Items/HangingSwords.cs | 47 +++----------- .../Special/Heritage Items/HouseLadder.cs | 63 ++++++++++--------- .../Items/Special/Heritage Items/Statue.cs | 47 +++----------- .../Items/Special/Heritage Items/UnmadeBed.cs | 48 +++----------- .../Items/Special/Heritage Items/Vanity.cs | 47 +++----------- .../Special/Heritage Items/WoodenCoffin.cs | 47 +++----------- .../UOContent/Items/Special/Holiday/Wreath.cs | 44 +++++++------ .../Items/Special/Veteran Rewards/Banner.cs | 63 ++++++++----------- .../Veteran Rewards/HangingSkeleton.cs | 27 ++++---- .../Monsters/Summons/SummonedAirElemental.cs | 1 - 21 files changed, 265 insertions(+), 522 deletions(-) create mode 100644 Projects/UOContent/Gumps/SelectAddonDirectionGump.cs create mode 100644 Projects/UOContent/Items/Deeds/IDirectionAddonDeed.cs diff --git a/Projects/UOContent/Engines/BuffIcons/BuffInfo.cs b/Projects/UOContent/Engines/BuffIcons/BuffInfo.cs index d0c1ed6c5a..5a6fd5dd30 100644 --- a/Projects/UOContent/Engines/BuffIcons/BuffInfo.cs +++ b/Projects/UOContent/Engines/BuffIcons/BuffInfo.cs @@ -1,5 +1,4 @@ using System; -using ModernUO.CodeGeneratedEvents; using Server.Mobiles; namespace Server.Engines.BuffIcons; diff --git a/Projects/UOContent/Gumps/PetResurrectGump.cs b/Projects/UOContent/Gumps/PetResurrectGump.cs index 4ccb84518d..103ed82556 100644 --- a/Projects/UOContent/Gumps/PetResurrectGump.cs +++ b/Projects/UOContent/Gumps/PetResurrectGump.cs @@ -1,4 +1,3 @@ -using System; using Server.Mobiles; using Server.Network; diff --git a/Projects/UOContent/Gumps/SelectAddonDirectionGump.cs b/Projects/UOContent/Gumps/SelectAddonDirectionGump.cs new file mode 100644 index 0000000000..3ef6164f25 --- /dev/null +++ b/Projects/UOContent/Gumps/SelectAddonDirectionGump.cs @@ -0,0 +1,49 @@ +using Server.Items; +using Server.Network; + +namespace Server.Gumps; + +public abstract class SelectAddonDirectionGump : StaticGump where T : SelectAddonDirectionGump +{ + private readonly IDirectionAddonDeed _deed; + + public SelectAddonDirectionGump(IDirectionAddonDeed deed) : base(60, 63) => _deed = deed; + + public override bool Singleton => false; + + public abstract int SelectionNumber { get; } + + protected override void BuildLayout(ref StaticGumpBuilder builder) + { + builder.AddPage(); + + builder.AddBackground(0, 0, 273, 324, 0x13BE); + builder.AddImageTiled(10, 10, 253, 20, 0xA40); + builder.AddImageTiled(10, 40, 253, 244, 0xA40); + builder.AddImageTiled(10, 294, 253, 20, 0xA40); + builder.AddAlphaRegion(10, 10, 253, 304); + + builder.AddButton(10, 294, 0xFB1, 0xFB2, 0); + + builder.AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL + builder.AddHtmlLocalized(14, 12, 273, 20, SelectionNumber, 0x7FFF); + + builder.AddPage(1); + + builder.AddButton(19, 49, 0x845, 0x846, 1); + builder.AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South + builder.AddButton(19, 73, 0x845, 0x846, 2); + builder.AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East + } + + public override void OnResponse(NetState sender, in RelayInfo info) + { + if (_deed?.Deleted != false || info.ButtonID == 0) + { + return; + } + + _deed.East = info.ButtonID != 1; + _deed.SendTarget(sender.Mobile); + } +} diff --git a/Projects/UOContent/Holiday Stuff/Christmas/2004/Mistletoe.cs b/Projects/UOContent/Holiday Stuff/Christmas/2004/Mistletoe.cs index f52e49dd7f..0fd6f42170 100644 --- a/Projects/UOContent/Holiday Stuff/Christmas/2004/Mistletoe.cs +++ b/Projects/UOContent/Holiday Stuff/Christmas/2004/Mistletoe.cs @@ -226,7 +226,7 @@ public void Placement_OnTarget(Mobile from, object targeted) if (northWall && westWall) { - from.SendGump(new MistletoeDeedGump(from, loc, this)); + from.SendGump(new MistletoeDeedGump(loc, this)); } else { @@ -276,47 +276,47 @@ private void PlaceAddon(Mobile from, Point3D loc, bool northWall, bool westWall) } } - private class MistletoeDeedGump : Gump + private class MistletoeDeedGump : StaticGump { private readonly MistletoeDeed _deed; - private readonly Mobile _from; private readonly Point3D _loc; - public MistletoeDeedGump(Mobile from, Point3D loc, MistletoeDeed deed) : base(150, 50) + public override bool Singleton => false; + + public MistletoeDeedGump(Point3D loc, MistletoeDeed deed) : base(150, 50) { - _from = from; _loc = loc; _deed = deed; + } - AddBackground(0, 0, 300, 150, 0xA28); + protected override void BuildLayout(ref StaticGumpBuilder builder) + { + builder.AddBackground(0, 0, 300, 150, 0xA28); - AddPage(0); + builder.AddPage(); - AddItem(90, 30, 0x2375); - AddItem(180, 30, 0x2374); - AddButton(50, 35, 0x868, 0x869, 1); - AddButton(145, 35, 0x868, 0x869, 2); + builder.AddItem(90, 30, 0x2375); + builder.AddItem(180, 30, 0x2374); + builder.AddButton(50, 35, 0x868, 0x869, 1); + builder.AddButton(145, 35, 0x868, 0x869, 2); } public override void OnResponse(NetState sender, in RelayInfo info) { - if (_deed.Deleted) + if (_deed.Deleted || info.ButtonID == 0) { return; } - switch (info.ButtonID) + var from = sender.Mobile; + + if (info.ButtonID == 1) + { + _deed.PlaceAddon(from, _loc, false, true); + } + else { - case 1: - { - _deed.PlaceAddon(_from, _loc, false, true); - break; - } - case 2: - { - _deed.PlaceAddon(_from, _loc, true, false); - break; - } + _deed.PlaceAddon(from, _loc, true, false); } } } diff --git a/Projects/UOContent/Holiday Stuff/Christmas/2010/Addons/FireFliesDeed.cs b/Projects/UOContent/Holiday Stuff/Christmas/2010/Addons/FireFliesDeed.cs index 948e151966..c930a18cb2 100644 --- a/Projects/UOContent/Holiday Stuff/Christmas/2010/Addons/FireFliesDeed.cs +++ b/Projects/UOContent/Holiday Stuff/Christmas/2010/Addons/FireFliesDeed.cs @@ -85,35 +85,27 @@ public override void OnDoubleClick(Mobile from) return; } - from.SendGump(new FacingGump(this, from)); + from.SendGump(new FacingGump(this)); } - private class FacingGump : Gump + private class FacingGump : StaticGump { private readonly FirefliesDeed _deed; - private readonly Mobile _placer; public override bool Singleton => true; - public FacingGump(FirefliesDeed deed, Mobile player) : base(150, 50) - { - _deed = deed; - _placer = player; - - Closable = true; - Disposable = true; - Draggable = true; - Resizable = false; + public FacingGump(FirefliesDeed deed) : base(150, 50) => _deed = deed; - AddPage(0); - - AddBackground(0, 0, 300, 150, 0xA28); + protected override void BuildLayout(ref StaticGumpBuilder builder) + { + builder.AddBackground(0, 0, 300, 150, 0xA28); + builder.AddPage(); - AddItem(90, 30, 0x2332); - AddItem(180, 30, 0x2336); + builder.AddItem(90, 30, 0x2332); + builder.AddItem(180, 30, 0x2336); - AddButton(50, 35, 0x868, 0x869, (int)Buttons.East); - AddButton(145, 35, 0x868, 0x869, (int)Buttons.South); + builder.AddButton(50, 35, 0x868, 0x869, (int)Buttons.East); + builder.AddButton(145, 35, 0x868, 0x869, (int)Buttons.South); } public override void OnResponse(NetState sender, in RelayInfo info) @@ -130,7 +122,12 @@ public override void OnResponse(NetState sender, in RelayInfo info) _ => 0 }; - _placer.Target = new InternalTarget(_deed, itemId); + if (itemId == 0) + { + return; + } + + sender.Mobile.Target = new InternalTarget(_deed, itemId); } private enum Buttons diff --git a/Projects/UOContent/Items/Deeds/IDirectionAddonDeed.cs b/Projects/UOContent/Items/Deeds/IDirectionAddonDeed.cs new file mode 100644 index 0000000000..bdb4387716 --- /dev/null +++ b/Projects/UOContent/Items/Deeds/IDirectionAddonDeed.cs @@ -0,0 +1,8 @@ +namespace Server.Items; + +public interface IDirectionAddonDeed : IEntity +{ + public bool East { get; set; } + + public void SendTarget(Mobile m); +} diff --git a/Projects/UOContent/Items/Special/Broken Furniture Collection/BrokenBed.cs b/Projects/UOContent/Items/Special/Broken Furniture Collection/BrokenBed.cs index d1b002002b..921507f48d 100644 --- a/Projects/UOContent/Items/Special/Broken Furniture Collection/BrokenBed.cs +++ b/Projects/UOContent/Items/Special/Broken Furniture Collection/BrokenBed.cs @@ -1,6 +1,5 @@ using ModernUO.Serialization; using Server.Gumps; -using Server.Network; namespace Server.Items; @@ -30,14 +29,14 @@ public BrokenBedAddon(bool east) } [SerializationGenerator(0)] -public partial class BrokenBedDeed : BaseAddonDeed +public partial class BrokenBedDeed : BaseAddonDeed, IDirectionAddonDeed { - private bool _east; + public bool East { get; set; } [Constructible] public BrokenBedDeed() => LootType = LootType.Blessed; - public override BaseAddon Addon => new BrokenBedAddon(_east); + public override BaseAddon Addon => new BrokenBedAddon(East); public override int LabelNumber => 1076263; // Broken Bed @@ -53,49 +52,17 @@ public override void OnDoubleClick(Mobile from) } } - private void SendTarget(Mobile m) + public void SendTarget(Mobile m) { base.OnDoubleClick(m); } - private class InternalGump : Gump + private class InternalGump : SelectAddonDirectionGump { - private readonly BrokenBedDeed _deed; - - public override bool Singleton => true; - - public InternalGump(BrokenBedDeed deed) : base(60, 36) + public InternalGump(IDirectionAddonDeed deed) : base(deed) { - _deed = deed; - - AddPage(0); - - AddBackground(0, 0, 273, 324, 0x13BE); - AddImageTiled(10, 10, 253, 20, 0xA40); - AddImageTiled(10, 40, 253, 244, 0xA40); - AddImageTiled(10, 294, 253, 20, 0xA40); - AddAlphaRegion(10, 10, 253, 304); - AddButton(10, 294, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL - AddHtmlLocalized(14, 12, 273, 20, 1076749, 0x7FFF); // Please select your broken bed position - - AddPage(1); - - AddButton(19, 49, 0x845, 0x846, 1); - AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South - AddButton(19, 73, 0x845, 0x846, 2); - AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East } - public override void OnResponse(NetState sender, in RelayInfo info) - { - if (_deed?.Deleted != false || info.ButtonID == 0) - { - return; - } - - _deed._east = info.ButtonID != 1; - _deed.SendTarget(sender.Mobile); - } + public override int SelectionNumber => 1076749; // Please select your broken bed position } } diff --git a/Projects/UOContent/Items/Special/Broken Furniture Collection/BrokenVanity.cs b/Projects/UOContent/Items/Special/Broken Furniture Collection/BrokenVanity.cs index 06c0afa27e..fb8402a8fe 100644 --- a/Projects/UOContent/Items/Special/Broken Furniture Collection/BrokenVanity.cs +++ b/Projects/UOContent/Items/Special/Broken Furniture Collection/BrokenVanity.cs @@ -1,6 +1,5 @@ using ModernUO.Serialization; using Server.Gumps; -using Server.Network; namespace Server.Items; @@ -26,14 +25,15 @@ public BrokenVanityAddon(bool east) } [SerializationGenerator(0)] -public partial class BrokenVanityDeed : BaseAddonDeed +public partial class BrokenVanityDeed : BaseAddonDeed, IDirectionAddonDeed { - private bool _east; + public bool East { get; set; } [Constructible] public BrokenVanityDeed() => LootType = LootType.Blessed; - public override BaseAddon Addon => new BrokenVanityAddon(_east); + public override BaseAddon Addon => new BrokenVanityAddon(East); + public override int LabelNumber => 1076260; // Broken Vanity public override void OnDoubleClick(Mobile from) @@ -48,49 +48,17 @@ public override void OnDoubleClick(Mobile from) } } - private void SendTarget(Mobile m) + public void SendTarget(Mobile m) { base.OnDoubleClick(m); } - private class InternalGump : Gump + private class InternalGump : SelectAddonDirectionGump { - private readonly BrokenVanityDeed _deed; - - public override bool Singleton => true; - - public InternalGump(BrokenVanityDeed deed) : base(60, 63) + public InternalGump(IDirectionAddonDeed deed) : base(deed) { - _deed = deed; - - AddPage(0); - - AddBackground(0, 0, 273, 324, 0x13BE); - AddImageTiled(10, 10, 253, 20, 0xA40); - AddImageTiled(10, 40, 253, 244, 0xA40); - AddImageTiled(10, 294, 253, 20, 0xA40); - AddAlphaRegion(10, 10, 253, 304); - AddButton(10, 294, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL - AddHtmlLocalized(14, 12, 273, 20, 1076747, 0x7FFF); // Please select your broken vanity position - - AddPage(1); - - AddButton(19, 49, 0x845, 0x846, 1); - AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South - AddButton(19, 73, 0x845, 0x846, 2); - AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East } - public override void OnResponse(NetState sender, in RelayInfo info) - { - if (_deed?.Deleted != false || info.ButtonID == 0) - { - return; - } - - _deed._east = info.ButtonID != 1; - _deed.SendTarget(sender.Mobile); - } + public override int SelectionNumber => 1076747; // Please select your broken vanity position } } diff --git a/Projects/UOContent/Items/Special/Gifts/HearthOfHomeFire.cs b/Projects/UOContent/Items/Special/Gifts/HearthOfHomeFire.cs index a2c64d180b..6ba9938423 100644 --- a/Projects/UOContent/Items/Special/Gifts/HearthOfHomeFire.cs +++ b/Projects/UOContent/Items/Special/Gifts/HearthOfHomeFire.cs @@ -60,25 +60,27 @@ private void SendTarget(Mobile m) base.OnDoubleClick(m); } - private class InternalGump : Gump + private class InternalGump : StaticGump { private readonly HearthOfHomeFireDeed _deed; public override bool Singleton => true; - public InternalGump(HearthOfHomeFireDeed deed) : base(150, 50) + public InternalGump(HearthOfHomeFireDeed deed) : base(150, 50) => _deed = deed; + + protected override void BuildLayout(ref StaticGumpBuilder builder) { - _deed = deed; + builder.AddBackground(0, 0, 350, 250, 0xA28); - AddBackground(0, 0, 350, 250, 0xA28); + builder.AddPage(); - AddItem(90, 52, 0x2367); - AddItem(112, 35, 0x2360); - AddButton(70, 35, 0x868, 0x869, 1); // South + builder.AddItem(90, 52, 0x2367); + builder.AddItem(112, 35, 0x2360); + builder.AddButton(70, 35, 0x868, 0x869, 1); // South - AddItem(220, 35, 0x2352); - AddItem(242, 52, 0x2358); - AddButton(185, 35, 0x868, 0x869, 2); // East + builder.AddItem(220, 35, 0x2352); + builder.AddItem(242, 52, 0x2358); + builder.AddButton(185, 35, 0x868, 0x869, 2); // East } public override void OnResponse(NetState sender, in RelayInfo info) diff --git a/Projects/UOContent/Items/Special/Heritage Items/Curtains.cs b/Projects/UOContent/Items/Special/Heritage Items/Curtains.cs index 4f1b2347e2..d1621b4e29 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/Curtains.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/Curtains.cs @@ -1,6 +1,5 @@ using ModernUO.Serialization; using Server.Gumps; -using Server.Network; namespace Server.Items; @@ -77,14 +76,14 @@ public CurtainsAddon(bool east) } [SerializationGenerator(0)] -public partial class CurtainsDeed : BaseAddonDeed +public partial class CurtainsDeed : BaseAddonDeed, IDirectionAddonDeed { - private bool _east; + public bool East { get; set; } [Constructible] public CurtainsDeed() => LootType = LootType.Blessed; - public override BaseAddon Addon => new CurtainsAddon(_east); + public override BaseAddon Addon => new CurtainsAddon(East); public override int LabelNumber => 1076280; // Curtains public override void OnDoubleClick(Mobile from) @@ -99,49 +98,17 @@ public override void OnDoubleClick(Mobile from) } } - private void SendTarget(Mobile m) + public void SendTarget(Mobile m) { base.OnDoubleClick(m); } - private class InternalGump : Gump + private class InternalGump : SelectAddonDirectionGump { - private readonly CurtainsDeed _deed; - - public override bool Singleton => true; - - public InternalGump(CurtainsDeed deed) : base(60, 36) + public InternalGump(IDirectionAddonDeed deed) : base(deed) { - _deed = deed; - - AddPage(0); - - AddBackground(0, 0, 273, 324, 0x13BE); - AddImageTiled(10, 10, 253, 20, 0xA40); - AddImageTiled(10, 40, 253, 244, 0xA40); - AddImageTiled(10, 294, 253, 20, 0xA40); - AddAlphaRegion(10, 10, 253, 304); - AddButton(10, 294, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL - AddHtmlLocalized(14, 12, 273, 20, 1076581, 0x7FFF); // Please select your curtain position - - AddPage(1); - - AddButton(19, 49, 0x845, 0x846, 1); - AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South - AddButton(19, 73, 0x845, 0x846, 2); - AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East } - public override void OnResponse(NetState sender, in RelayInfo info) - { - if (_deed?.Deleted != false || info.ButtonID == 0) - { - return; - } - - _deed._east = info.ButtonID != 1; - _deed.SendTarget(sender.Mobile); - } + public override int SelectionNumber => 1076581; // Please select your curtain position } } diff --git a/Projects/UOContent/Items/Special/Heritage Items/HangingAxes.cs b/Projects/UOContent/Items/Special/Heritage Items/HangingAxes.cs index ce82e6ec2a..d51757a3e2 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/HangingAxes.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/HangingAxes.cs @@ -1,6 +1,5 @@ using ModernUO.Serialization; using Server.Gumps; -using Server.Network; namespace Server.Items; @@ -26,14 +25,14 @@ public HangingAxesAddon(bool east) } [SerializationGenerator(0)] -public partial class HangingAxesDeed : BaseAddonDeed +public partial class HangingAxesDeed : BaseAddonDeed, IDirectionAddonDeed { - private bool m_East; + public bool East { get; set; } [Constructible] public HangingAxesDeed() => LootType = LootType.Blessed; - public override BaseAddon Addon => new HangingAxesAddon(m_East); + public override BaseAddon Addon => new HangingAxesAddon(East); public override int LabelNumber => 1076271; // Hanging Axes public override void OnDoubleClick(Mobile from) @@ -48,49 +47,17 @@ public override void OnDoubleClick(Mobile from) } } - private void SendTarget(Mobile m) + public void SendTarget(Mobile m) { base.OnDoubleClick(m); } - private class InternalGump : Gump + private class InternalGump : SelectAddonDirectionGump { - private readonly HangingAxesDeed m_Deed; - - public override bool Singleton => true; - - public InternalGump(HangingAxesDeed deed) : base(60, 36) + public InternalGump(IDirectionAddonDeed deed) : base(deed) { - m_Deed = deed; - - AddPage(0); - - AddBackground(0, 0, 273, 324, 0x13BE); - AddImageTiled(10, 10, 253, 20, 0xA40); - AddImageTiled(10, 40, 253, 244, 0xA40); - AddImageTiled(10, 294, 253, 20, 0xA40); - AddAlphaRegion(10, 10, 253, 304); - AddButton(10, 294, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL - AddHtmlLocalized(14, 12, 273, 20, 1076745, 0x7FFF); // Please select your hanging axe position - - AddPage(1); - - AddButton(19, 49, 0x845, 0x846, 1); - AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South - AddButton(19, 73, 0x845, 0x846, 2); - AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East } - public override void OnResponse(NetState sender, in RelayInfo info) - { - if (m_Deed?.Deleted != false || info.ButtonID == 0) - { - return; - } - - m_Deed.m_East = info.ButtonID != 1; - m_Deed.SendTarget(sender.Mobile); - } + public override int SelectionNumber => 1076745; // Please select your hanging axe position } } diff --git a/Projects/UOContent/Items/Special/Heritage Items/HangingSwords.cs b/Projects/UOContent/Items/Special/Heritage Items/HangingSwords.cs index 3d23fc936b..1a251720ad 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/HangingSwords.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/HangingSwords.cs @@ -1,6 +1,5 @@ using ModernUO.Serialization; using Server.Gumps; -using Server.Network; namespace Server.Items; @@ -26,14 +25,14 @@ public HangingSwordsAddon(bool east) } [SerializationGenerator(0)] -public partial class HangingSwordsDeed : BaseAddonDeed +public partial class HangingSwordsDeed : BaseAddonDeed, IDirectionAddonDeed { - private bool _east; + public bool East { get; set; } [Constructible] public HangingSwordsDeed() => LootType = LootType.Blessed; - public override BaseAddon Addon => new HangingSwordsAddon(_east); + public override BaseAddon Addon => new HangingSwordsAddon(East); public override int LabelNumber => 1076272; // Hanging Swords public override void OnDoubleClick(Mobile from) @@ -48,49 +47,17 @@ public override void OnDoubleClick(Mobile from) } } - private void SendTarget(Mobile m) + public void SendTarget(Mobile m) { base.OnDoubleClick(m); } - private class InternalGump : Gump + private class InternalGump : SelectAddonDirectionGump { - private readonly HangingSwordsDeed m_Deed; - - public override bool Singleton => true; - - public InternalGump(HangingSwordsDeed deed) : base(60, 36) + public InternalGump(IDirectionAddonDeed deed) : base(deed) { - m_Deed = deed; - - AddPage(0); - - AddBackground(0, 0, 273, 324, 0x13BE); - AddImageTiled(10, 10, 253, 20, 0xA40); - AddImageTiled(10, 40, 253, 244, 0xA40); - AddImageTiled(10, 294, 253, 20, 0xA40); - AddAlphaRegion(10, 10, 253, 304); - AddButton(10, 294, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL - AddHtmlLocalized(14, 12, 273, 20, 1076746, 0x7FFF); // Please select your hanging sword position - - AddPage(1); - - AddButton(19, 49, 0x845, 0x846, 1); - AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South - AddButton(19, 73, 0x845, 0x846, 2); - AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East } - public override void OnResponse(NetState sender, in RelayInfo info) - { - if (m_Deed?.Deleted != false || info.ButtonID == 0) - { - return; - } - - m_Deed._east = info.ButtonID != 1; - m_Deed.SendTarget(sender.Mobile); - } + public override int SelectionNumber => 1076746; // Please select your hanging sword position } } diff --git a/Projects/UOContent/Items/Special/Heritage Items/HouseLadder.cs b/Projects/UOContent/Items/Special/Heritage Items/HouseLadder.cs index f1a36692e8..19cc0b6840 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/HouseLadder.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/HouseLadder.cs @@ -94,46 +94,47 @@ private void SendTarget(Mobile m) base.OnDoubleClick(m); } - private class InternalGump : Gump + private class InternalGump : StaticGump { private readonly HouseLadderDeed _deed; public override bool Singleton => true; - public InternalGump(HouseLadderDeed deed) : base(60, 36) + public InternalGump(HouseLadderDeed deed) : base(60, 36) => _deed = deed; + + protected override void BuildLayout(ref StaticGumpBuilder builder) { - _deed = deed; + builder.AddPage(); - AddPage(0); + builder.AddBackground(0, 0, 273, 324, 0x13BE); + builder.AddImageTiled(10, 10, 253, 20, 0xA40); + builder.AddImageTiled(10, 40, 253, 244, 0xA40); + builder.AddImageTiled(10, 294, 253, 20, 0xA40); + builder.AddAlphaRegion(10, 10, 253, 304); + builder.AddButton(10, 294, 0xFB1, 0xFB2, 0); + builder.AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL - AddBackground(0, 0, 273, 324, 0x13BE); - AddImageTiled(10, 10, 253, 20, 0xA40); - AddImageTiled(10, 40, 253, 244, 0xA40); - AddImageTiled(10, 294, 253, 20, 0xA40); - AddAlphaRegion(10, 10, 253, 304); - AddButton(10, 294, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL // Please select your ladder position.
Use the ladders marked (castle)
for accessing the tops of keeps
and castles. - AddHtmlLocalized(14, 12, 273, 20, 1076780, 0x7FFF); - - AddPage(1); - - AddButton(19, 49, 0x845, 0x846, 1); - AddHtmlLocalized(44, 47, 213, 20, 1076794, 0x7FFF); // South (Castle) - AddButton(19, 73, 0x845, 0x846, 2); - AddHtmlLocalized(44, 71, 213, 20, 1076795, 0x7FFF); // East (Castle) - AddButton(19, 97, 0x845, 0x846, 3); - AddHtmlLocalized(44, 95, 213, 20, 1076792, 0x7FFF); // North (Castle) - AddButton(19, 121, 0x845, 0x846, 4); - AddHtmlLocalized(44, 119, 213, 20, 1076793, 0x7FFF); // West (Castle) - AddButton(19, 145, 0x845, 0x846, 5); - AddHtmlLocalized(44, 143, 213, 20, 1075386, 0x7FFF); // South - AddButton(19, 169, 0x845, 0x846, 6); - AddHtmlLocalized(44, 167, 213, 20, 1075387, 0x7FFF); // East - AddButton(19, 193, 0x845, 0x846, 7); - AddHtmlLocalized(44, 191, 213, 20, 1075389, 0x7FFF); // North - AddButton(19, 217, 0x845, 0x846, 8); - AddHtmlLocalized(44, 215, 213, 20, 1075390, 0x7FFF); // West + builder.AddHtmlLocalized(14, 12, 273, 20, 1076780, 0x7FFF); + + builder.AddPage(1); + + builder.AddButton(19, 49, 0x845, 0x846, 1); + builder.AddHtmlLocalized(44, 47, 213, 20, 1076794, 0x7FFF); // South (Castle) + builder.AddButton(19, 73, 0x845, 0x846, 2); + builder.AddHtmlLocalized(44, 71, 213, 20, 1076795, 0x7FFF); // East (Castle) + builder.AddButton(19, 97, 0x845, 0x846, 3); + builder.AddHtmlLocalized(44, 95, 213, 20, 1076792, 0x7FFF); // North (Castle) + builder.AddButton(19, 121, 0x845, 0x846, 4); + builder.AddHtmlLocalized(44, 119, 213, 20, 1076793, 0x7FFF); // West (Castle) + builder.AddButton(19, 145, 0x845, 0x846, 5); + builder.AddHtmlLocalized(44, 143, 213, 20, 1075386, 0x7FFF); // South + builder.AddButton(19, 169, 0x845, 0x846, 6); + builder.AddHtmlLocalized(44, 167, 213, 20, 1075387, 0x7FFF); // East + builder.AddButton(19, 193, 0x845, 0x846, 7); + builder.AddHtmlLocalized(44, 191, 213, 20, 1075389, 0x7FFF); // North + builder.AddButton(19, 217, 0x845, 0x846, 8); + builder.AddHtmlLocalized(44, 215, 213, 20, 1075390, 0x7FFF); // West } public override void OnResponse(NetState sender, in RelayInfo info) diff --git a/Projects/UOContent/Items/Special/Heritage Items/Statue.cs b/Projects/UOContent/Items/Special/Heritage Items/Statue.cs index a07b7980f4..3ef76af949 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/Statue.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/Statue.cs @@ -1,6 +1,5 @@ using ModernUO.Serialization; using Server.Gumps; -using Server.Network; namespace Server.Items; @@ -28,14 +27,14 @@ public StoneStatueAddon(bool east) } [SerializationGenerator(0)] -public partial class StoneStatueDeed : BaseAddonDeed +public partial class StoneStatueDeed : BaseAddonDeed, IDirectionAddonDeed { - private bool _east; + public bool East { get; set; } [Constructible] public StoneStatueDeed() => LootType = LootType.Blessed; - public override BaseAddon Addon => new StoneStatueAddon(_east); + public override BaseAddon Addon => new StoneStatueAddon(East); public override int LabelNumber => 1076284; // Statue public override void OnDoubleClick(Mobile from) @@ -50,49 +49,17 @@ public override void OnDoubleClick(Mobile from) } } - private void SendTarget(Mobile m) + public void SendTarget(Mobile m) { base.OnDoubleClick(m); } - private class InternalGump : Gump + private class InternalGump : SelectAddonDirectionGump { - private readonly StoneStatueDeed _deed; - - public override bool Singleton => true; - - public InternalGump(StoneStatueDeed deed) : base(60, 36) + public InternalGump(IDirectionAddonDeed deed) : base(deed) { - _deed = deed; - - AddPage(0); - - AddBackground(0, 0, 273, 324, 0x13BE); - AddImageTiled(10, 10, 253, 20, 0xA40); - AddImageTiled(10, 40, 253, 244, 0xA40); - AddImageTiled(10, 294, 253, 20, 0xA40); - AddAlphaRegion(10, 10, 253, 304); - AddButton(10, 294, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL - AddHtmlLocalized(14, 12, 273, 20, 1076579, 0x7FFF); // Please select your statue position - - AddPage(1); - - AddButton(19, 49, 0x845, 0x846, 1); - AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South - AddButton(19, 73, 0x845, 0x846, 2); - AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East } - public override void OnResponse(NetState sender, in RelayInfo info) - { - if (_deed?.Deleted != false || info.ButtonID == 0) - { - return; - } - - _deed._east = info.ButtonID != 1; - _deed.SendTarget(sender.Mobile); - } + public override int SelectionNumber => 1076579; // Please select your statue position } } diff --git a/Projects/UOContent/Items/Special/Heritage Items/UnmadeBed.cs b/Projects/UOContent/Items/Special/Heritage Items/UnmadeBed.cs index ca28c4312f..2fa5b5b6f5 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/UnmadeBed.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/UnmadeBed.cs @@ -1,6 +1,5 @@ using ModernUO.Serialization; using Server.Gumps; -using Server.Network; namespace Server.Items; @@ -30,14 +29,14 @@ public UnmadeBedAddon(bool east) } [SerializationGenerator(0)] -public partial class UnmadeBedDeed : BaseAddonDeed +public partial class UnmadeBedDeed : BaseAddonDeed, IDirectionAddonDeed { - private bool _east; + public bool East { get; set; } [Constructible] public UnmadeBedDeed() => LootType = LootType.Blessed; - public override BaseAddon Addon => new UnmadeBedAddon(_east); + public override BaseAddon Addon => new UnmadeBedAddon(East); public override int LabelNumber => 1076279; // Unmade Bed public override void OnDoubleClick(Mobile from) @@ -52,49 +51,18 @@ public override void OnDoubleClick(Mobile from) } } - private void SendTarget(Mobile m) + public void SendTarget(Mobile m) { base.OnDoubleClick(m); } - private class InternalGump : Gump + private class InternalGump : SelectAddonDirectionGump { - private readonly UnmadeBedDeed _deed; - - public override bool Singleton => true; - - public InternalGump(UnmadeBedDeed deed) : base(60, 36) + public InternalGump(IDirectionAddonDeed deed) : base(deed) { - _deed = deed; - - AddPage(0); - - AddBackground(0, 0, 273, 324, 0x13BE); - AddImageTiled(10, 10, 253, 20, 0xA40); - AddImageTiled(10, 40, 253, 244, 0xA40); - AddImageTiled(10, 294, 253, 20, 0xA40); - AddAlphaRegion(10, 10, 253, 304); - AddButton(10, 294, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL - AddHtmlLocalized(14, 12, 273, 20, 1076580, 0x7FFF); // Please select your unmade bed position - - AddPage(1); - - AddButton(19, 49, 0x845, 0x846, 1); - AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South - AddButton(19, 73, 0x845, 0x846, 2); - AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East } - public override void OnResponse(NetState sender, in RelayInfo info) - { - if (_deed?.Deleted != false || info.ButtonID == 0) - { - return; - } - - _deed._east = info.ButtonID != 1; - _deed.SendTarget(sender.Mobile); - } + // Misspelled in cliloc + public override int SelectionNumber => 1076580; // Pleae select your unmade bed position } } diff --git a/Projects/UOContent/Items/Special/Heritage Items/Vanity.cs b/Projects/UOContent/Items/Special/Heritage Items/Vanity.cs index 6dfcc3fffe..e001ecd31a 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/Vanity.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/Vanity.cs @@ -1,6 +1,5 @@ using ModernUO.Serialization; using Server.Gumps; -using Server.Network; namespace Server.Items; @@ -27,14 +26,14 @@ public VanityAddon(bool east) : base(east ? 0xA44 : 0xA3C) } [SerializationGenerator(0)] -public partial class VanityDeed : BaseAddonContainerDeed +public partial class VanityDeed : BaseAddonContainerDeed, IDirectionAddonDeed { - private bool m_East; + public bool East { get; set; } [Constructible] public VanityDeed() => LootType = LootType.Blessed; - public override BaseAddonContainer Addon => new VanityAddon(m_East); + public override BaseAddonContainer Addon => new VanityAddon(East); public override int LabelNumber => 1074027; // Vanity public override void OnDoubleClick(Mobile from) @@ -49,49 +48,17 @@ public override void OnDoubleClick(Mobile from) } } - private void SendTarget(Mobile m) + public void SendTarget(Mobile m) { base.OnDoubleClick(m); } - private class InternalGump : Gump + private class InternalGump : SelectAddonDirectionGump { - private readonly VanityDeed _deed; - - public override bool Singleton => true; - - public InternalGump(VanityDeed deed) : base(60, 36) + public InternalGump(IDirectionAddonDeed deed) : base(deed) { - _deed = deed; - - AddPage(0); - - AddBackground(0, 0, 273, 324, 0x13BE); - AddImageTiled(10, 10, 253, 20, 0xA40); - AddImageTiled(10, 40, 253, 244, 0xA40); - AddImageTiled(10, 294, 253, 20, 0xA40); - AddAlphaRegion(10, 10, 253, 304); - AddButton(10, 294, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL - AddHtmlLocalized(14, 12, 273, 20, 1076744, 0x7FFF); // Please select your vanity position. - - AddPage(1); - - AddButton(19, 49, 0x845, 0x846, 1); - AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South - AddButton(19, 73, 0x845, 0x846, 2); - AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East } - public override void OnResponse(NetState sender, in RelayInfo info) - { - if (_deed?.Deleted != false || info.ButtonID == 0) - { - return; - } - - _deed.m_East = info.ButtonID != 1; - _deed.SendTarget(sender.Mobile); - } + public override int SelectionNumber => 1076744; // Please select your vanity position. } } diff --git a/Projects/UOContent/Items/Special/Heritage Items/WoodenCoffin.cs b/Projects/UOContent/Items/Special/Heritage Items/WoodenCoffin.cs index b6cf3be6b2..cfbf8129ec 100644 --- a/Projects/UOContent/Items/Special/Heritage Items/WoodenCoffin.cs +++ b/Projects/UOContent/Items/Special/Heritage Items/WoodenCoffin.cs @@ -1,6 +1,5 @@ using ModernUO.Serialization; using Server.Gumps; -using Server.Network; namespace Server.Items; @@ -38,14 +37,14 @@ public WoodenCoffinAddon(bool east) } [SerializationGenerator(0)] -public partial class WoodenCoffinDeed : BaseAddonDeed +public partial class WoodenCoffinDeed : BaseAddonDeed, IDirectionAddonDeed { - private bool m_East; + public bool East { get; set; } [Constructible] public WoodenCoffinDeed() => LootType = LootType.Blessed; - public override BaseAddon Addon => new WoodenCoffinAddon(m_East); + public override BaseAddon Addon => new WoodenCoffinAddon(East); public override int LabelNumber => 1076274; // Coffin public override void OnDoubleClick(Mobile from) @@ -60,49 +59,17 @@ public override void OnDoubleClick(Mobile from) } } - private void SendTarget(Mobile m) + public void SendTarget(Mobile m) { base.OnDoubleClick(m); } - private class InternalGump : Gump + private class InternalGump : SelectAddonDirectionGump { - private readonly WoodenCoffinDeed _deed; - - public override bool Singleton => true; - - public InternalGump(WoodenCoffinDeed deed) : base(60, 36) + public InternalGump(IDirectionAddonDeed deed) : base(deed) { - _deed = deed; - - AddPage(0); - - AddBackground(0, 0, 273, 324, 0x13BE); - AddImageTiled(10, 10, 253, 20, 0xA40); - AddImageTiled(10, 40, 253, 244, 0xA40); - AddImageTiled(10, 294, 253, 20, 0xA40); - AddAlphaRegion(10, 10, 253, 304); - AddButton(10, 294, 0xFB1, 0xFB2, 0); - AddHtmlLocalized(45, 296, 450, 20, 1060051, 0x7FFF); // CANCEL - AddHtmlLocalized(14, 12, 273, 20, 1076748, 0x7FFF); // Please select your coffin position - - AddPage(1); - - AddButton(19, 49, 0x845, 0x846, 1); - AddHtmlLocalized(44, 47, 213, 20, 1075386, 0x7FFF); // South - AddButton(19, 73, 0x845, 0x846, 2); - AddHtmlLocalized(44, 71, 213, 20, 1075387, 0x7FFF); // East } - public override void OnResponse(NetState sender, in RelayInfo info) - { - if (_deed?.Deleted != false || info.ButtonID == 0) - { - return; - } - - _deed.m_East = info.ButtonID != 1; - _deed.SendTarget(sender.Mobile); - } + public override int SelectionNumber => 1076748; // Please select your coffin position } } diff --git a/Projects/UOContent/Items/Special/Holiday/Wreath.cs b/Projects/UOContent/Items/Special/Holiday/Wreath.cs index 37d844bfc3..a715fd1dc4 100644 --- a/Projects/UOContent/Items/Special/Holiday/Wreath.cs +++ b/Projects/UOContent/Items/Special/Holiday/Wreath.cs @@ -212,7 +212,7 @@ public void Placement_OnTarget(Mobile from, object targeted) if (northWall && westWall) { - from.SendGump(new WreathDeedGump(from, loc, this)); + from.SendGump(new WreathDeedGump(loc, this)); } else { @@ -267,47 +267,45 @@ private void PlaceAddon(Mobile from, Point3D loc, bool northWall, bool westWall) } } - private class WreathDeedGump : Gump + private class WreathDeedGump : StaticGump { private readonly WreathDeed _deed; - private readonly Mobile _from; private readonly Point3D _loc; - public WreathDeedGump(Mobile from, Point3D loc, WreathDeed deed) : base(150, 50) + public WreathDeedGump(Point3D loc, WreathDeed deed) : base(150, 50) { - _from = from; _loc = loc; _deed = deed; + } - AddBackground(0, 0, 300, 150, 0xA28); + protected override void BuildLayout(ref StaticGumpBuilder builder) + { + builder.AddBackground(0, 0, 300, 150, 0xA28); - AddPage(0); + builder.AddPage(); - AddItem(90, 30, 0x232D); - AddItem(180, 30, 0x232C); - AddButton(50, 35, 0x868, 0x869, 1); - AddButton(145, 35, 0x868, 0x869, 2); + builder.AddItem(90, 30, 0x232D); + builder.AddItem(180, 30, 0x232C); + builder.AddButton(50, 35, 0x868, 0x869, 1); + builder.AddButton(145, 35, 0x868, 0x869, 2); } public override void OnResponse(NetState sender, in RelayInfo info) { - if (_deed.Deleted) + if (_deed.Deleted || info.ButtonID == 0) { return; } - switch (info.ButtonID) + var from = sender.Mobile; + + if (info.ButtonID == 1) + { + _deed.PlaceAddon(from, _loc, false, true); + } + else { - case 1: - { - _deed.PlaceAddon(_from, _loc, false, true); - break; - } - case 2: - { - _deed.PlaceAddon(_from, _loc, true, false); - break; - } + _deed.PlaceAddon(from, _loc, true, false); } } } diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs b/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs index bb610754df..09cca1a326 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/Banner.cs @@ -292,65 +292,52 @@ protected override void OnTarget(Mobile from, object targeted) } } - private class FacingGump : Gump + private class FacingGump : DynamicGump { - private readonly BannerDeed m_Banner; - private readonly BaseHouse m_House; - private readonly int m_ItemID; - private readonly Point3D m_Location; + private readonly BannerDeed _banner; + private readonly BaseHouse _house; + private readonly int _itemId; + private readonly Point3D _location; public override bool Singleton => true; public FacingGump(BannerDeed banner, int itemID, Point3D location, BaseHouse house) : base(150, 50) { - m_Banner = banner; - m_ItemID = itemID; - m_Location = location; - m_House = house; + _banner = banner; + _itemId = itemID; + _location = location; + _house = house; + } - Closable = true; - Disposable = true; - Draggable = true; - Resizable = false; + protected override void BuildLayout(ref DynamicGumpBuilder builder) + { + builder.SetNoResize(); - AddPage(0); + builder.AddPage(); - AddBackground(0, 0, 300, 150, 0xA28); + builder.AddBackground(0, 0, 300, 150, 0xA28); - AddItem(90, 30, itemID + 1); - AddItem(180, 30, itemID); + builder.AddItem(90, 30, _itemId + 1); + builder.AddItem(180, 30, _itemId); - AddButton(50, 35, 0x868, 0x869, (int)Buttons.East); - AddButton(145, 35, 0x868, 0x869, (int)Buttons.South); + builder.AddButton(50, 35, 0x868, 0x869, (int)Buttons.East); + builder.AddButton(145, 35, 0x868, 0x869, (int)Buttons.South); } public override void OnResponse(NetState sender, in RelayInfo info) { - if (m_Banner?.Deleted != false || m_House == null) + if (_banner?.Deleted != false || _house == null) { return; } - Banner banner = null; - - if (info.ButtonID == (int)Buttons.East) - { - banner = new Banner(m_ItemID + 1); - } - else if (info.ButtonID == (int)Buttons.South) - { - banner = new Banner(m_ItemID); - } - - if (banner != null) - { - m_House.Addons.Add(banner); + Banner banner = new Banner(_itemId + (info.ButtonID == (int)Buttons.East ? 1 : 0)); + _house.Addons.Add(banner); - banner.IsRewardItem = m_Banner.IsRewardItem; - banner.MoveToWorld(m_Location, sender.Mobile.Map); + banner.IsRewardItem = _banner.IsRewardItem; + banner.MoveToWorld(_location, sender.Mobile.Map); - m_Banner.Delete(); - } + _banner.Delete(); } private enum Buttons diff --git a/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs b/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs index a60dfe6422..29dca292e6 100644 --- a/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs +++ b/Projects/UOContent/Items/Special/Veteran Rewards/HangingSkeleton.cs @@ -271,7 +271,7 @@ protected override void OnTarget(Mobile from, object targeted) } } - private class FacingGump : Gump + private class FacingGump : DynamicGump { private readonly BaseHouse _house; private readonly int _itemID; @@ -286,26 +286,26 @@ public FacingGump(HangingSkeletonDeed banner, int itemID, Point3D location, Base _itemID = itemID; _location = location; _house = house; + } - Closable = true; - Disposable = true; - Draggable = true; - Resizable = false; + protected override void BuildLayout(ref DynamicGumpBuilder builder) + { + builder.SetNoResize(); - AddPage(0); + builder.AddPage(); - AddBackground(0, 0, 300, 150, 0xA28); + builder.AddBackground(0, 0, 300, 150, 0xA28); - AddItem(90, 30, GetWestItemID(itemID)); - AddItem(180, 30, itemID); + builder.AddItem(90, 30, GetWestItemID(_itemID)); + builder.AddItem(180, 30, _itemID); - AddButton(50, 35, 0x868, 0x869, (int)Buttons.East); - AddButton(145, 35, 0x868, 0x869, (int)Buttons.South); + builder.AddButton(50, 35, 0x868, 0x869, (int)Buttons.East); + builder.AddButton(145, 35, 0x868, 0x869, (int)Buttons.South); } public override void OnResponse(NetState sender, in RelayInfo info) { - if (_skeleton?.Deleted != false || _house == null) + if (_skeleton?.Deleted != false || _house == null || info.ButtonID == (int)Buttons.Cancel) { return; } @@ -316,8 +316,7 @@ public override void OnResponse(NetState sender, in RelayInfo info) { banner = new HangingSkeleton(GetWestItemID(_itemID)); } - - if (info.ButtonID == (int)Buttons.South) + else if (info.ButtonID == (int)Buttons.South) { banner = new HangingSkeleton(_itemID); } diff --git a/Projects/UOContent/Mobiles/Monsters/Summons/SummonedAirElemental.cs b/Projects/UOContent/Mobiles/Monsters/Summons/SummonedAirElemental.cs index 28a225e78a..e6cc901900 100644 --- a/Projects/UOContent/Mobiles/Monsters/Summons/SummonedAirElemental.cs +++ b/Projects/UOContent/Mobiles/Monsters/Summons/SummonedAirElemental.cs @@ -1,4 +1,3 @@ -using System; using ModernUO.Serialization; namespace Server.Mobiles