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.
This commit is contained in:
Kamron Batman 2024-08-09 19:07:32 -07:00 • committed by GitHub
parent 40d99f6d1c
commit 8282b00ca2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
246 changed files with 1722 additions and 1383 deletions

View file

@ -4,6 +4,7 @@ using System.Runtime.CompilerServices;
using ModernUO.Serialization;
using Server.Collections;
using Server.ContextMenus;
using Server.Gumps;
using Server.Multis;
using Server.Network;
@ -875,8 +876,7 @@ namespace Server.Items
return;
}
from.CloseGump<AquariumGump>();
from.SendGump(new AquariumGump(this, HasAccess(from)));
from.SendGump(new AquariumGump(this, HasAccess(from)), true);
from.PlaySound(0x5A4);
}

View file

@ -40,7 +40,6 @@ namespace Server.Items
}
else if (m.Map?.CanFit(m.Location, 16, false, false) == true)
{
m.CloseGump<ResurrectGump>();
m.SendGump(new ResurrectGump(m, ResurrectMessage.VirtueShrine));
}
else

View file

@ -433,7 +433,6 @@ public partial class TreasureMapChest : LockableContainer
return;
}
from.CloseGump<RemoveGump>();
from.SendGump(new RemoveGump(from, this));
}
@ -453,6 +452,8 @@ public partial class TreasureMapChest : LockableContainer
private readonly TreasureMapChest _chest;
private readonly Mobile _from;
public override bool Singleton => true;
public RemoveGump(Mobile from, TreasureMapChest chest) : base(15, 15)
{
_from = from;

View file

@ -84,13 +84,13 @@ public partial class HairRestylingDeed : Item
private readonly HairRestylingDeed m_Deed;
private readonly Mobile m_From;
public override bool Singleton => true;
public InternalGump(Mobile from, HairRestylingDeed deed) : base(50, 50)
{
m_From = from;
m_Deed = deed;
from.CloseGump<InternalGump>();
AddBackground(100, 10, 400, 385, 0xA28);
AddHtmlLocalized(100, 25, 400, 35, 1013008);

View file

@ -103,7 +103,6 @@ public partial class HolidayTreeDeed : Item
public override void OnDoubleClick(Mobile from)
{
from.CloseGump<HolidayTreeChoiceGump>();
from.SendGump(new HolidayTreeChoiceGump(from, this));
}
}
@ -113,6 +112,8 @@ public class HolidayTreeChoiceGump : Gump
private readonly HolidayTreeDeed m_Deed;
private readonly Mobile m_From;
public override bool Singleton => true;
public HolidayTreeChoiceGump(Mobile from, HolidayTreeDeed deed) : base(200, 200)
{
m_From = from;

View file

@ -17,7 +17,6 @@ public partial class NameChangeDeed : Item
{
if (RootParent == from)
{
from.CloseGump<NameChangeDeedGump>();
from.SendGump(new NameChangeDeedGump(this));
}
else
@ -31,6 +30,8 @@ public class NameChangeDeedGump : Gump
{
private readonly Item m_Sender;
public override bool Singleton => true;
public NameChangeDeedGump(Item sender) : base(50, 50)
{
m_Sender = sender;

View file

@ -195,8 +195,7 @@ public partial class VendorRentalContract : Item
{
if (from.InRange(this, 5))
{
from.CloseGump<VendorRentalContractGump>();
from.SendGump(new VendorRentalContractGump(this, from));
from.SendGump(new VendorRentalContractGump(this, from), true);
}
else
{
@ -232,8 +231,7 @@ public partial class VendorRentalContract : Item
{
if (target is VendorRentalContract contract && contract.IsUsableBy(from, true, true, true, true))
{
from.CloseGump<VendorRentalContractGump>();
from.SendGump(new VendorRentalContractGump(contract, from));
from.SendGump(new VendorRentalContractGump(contract, from), true);
}
}
}

View file

@ -17,7 +17,6 @@ public partial class HairDye : Item
{
if (from.InRange(GetWorldLocation(), 1))
{
from.CloseGump<HairDyeGump>();
from.SendGump(new HairDyeGump(this));
}
else
@ -47,6 +46,8 @@ public class HairDyeGump : Gump
private HairDye _hairDye;
public override bool Singleton => true;
public HairDyeGump(HairDye dye) : base(50, 50)
{
_hairDye = dye;

View file

@ -290,10 +290,10 @@ public class PlayerBBGump : Gump
private BaseHouse _house;
private int _page;
public override bool Singleton => true;
public PlayerBBGump(Mobile from, BaseHouse house, BasePlayerBB board, int page) : base(50, 10)
{
from.CloseGump<PlayerBBGump>();
_page = page;
_from = from;
_house = house;

View file

@ -46,7 +46,6 @@ public abstract partial class PromotionalToken : Item
}
else
{
from.CloseGump<PromotionalTokenGump>();
from.SendGump(new PromotionalTokenGump(this));
}
}
@ -71,6 +70,8 @@ public abstract partial class PromotionalToken : Item
{
private readonly PromotionalToken m_Token;
public override bool Singleton => true;
public PromotionalTokenGump(PromotionalToken token) : base(10, 10)
{
m_Token = token;

View file

@ -84,7 +84,6 @@ public partial class PublicMoongate : Item
return false;
}
m.CloseGump<MoongateGump>();
m.SendGump(new MoongateGump(m, this));
if (!m.Hidden || m.AccessLevel == AccessLevel.Player)
@ -323,6 +322,8 @@ public class MoongateGump : Gump
private Mobile _mobile;
private Item _moongate;
public override bool Singleton => true;
public MoongateGump(Mobile mobile, Item moongate) : base(100, 100)
{
_mobile = mobile;

View file

@ -21,7 +21,6 @@ public partial class SpecialBeardDye : Item
{
if (from.InRange(GetWorldLocation(), 1))
{
from.CloseGump<SpecialBeardDyeGump>();
from.SendGump(new SpecialBeardDyeGump(this));
}
else
@ -47,6 +46,8 @@ public class SpecialBeardDyeGump : Gump
private SpecialBeardDye _specialBeardDye;
public override bool Singleton => true;
public SpecialBeardDyeGump(SpecialBeardDye dye) : base(0, 0)
{
_specialBeardDye = dye;

View file

@ -21,7 +21,6 @@ public partial class SpecialHairDye : Item
{
if (from.InRange(GetWorldLocation(), 1))
{
from.CloseGump<SpecialHairDyeGump>();
from.SendGump(new SpecialHairDyeGump(this));
}
else
@ -47,6 +46,8 @@ public class SpecialHairDyeGump : Gump
private SpecialHairDye _specialHairDye;
public override bool Singleton => true;
public SpecialHairDyeGump(SpecialHairDye dye) : base(0, 0)
{
_specialHairDye = dye;

View file

@ -1,4 +1,5 @@
using ModernUO.Serialization;
using Server.Gumps;
using Server.Multis;
namespace Server.Items;

View file

@ -157,7 +157,6 @@ public partial class Moongate : Item
from.SendSound(0x20E, from);
}
from.CloseGump<MoongateConfirmGump>();
from.SendGump(new MoongateConfirmGump(from, this));
}
else
@ -265,7 +264,6 @@ public partial class ConfirmationMoongate : Moongate
{
if (GumpWidth > 0 && GumpHeight > 0 && TitleNumber > 0 && Message?.IsEmpty == false)
{
from.CloseGump<WarningGump>();
from.SendGump(
new WarningGump(
TitleNumber,
@ -275,7 +273,8 @@ public partial class ConfirmationMoongate : Moongate
GumpWidth,
GumpHeight,
okay => Warning_Callback(from, okay)
)
),
true
);
}
else
@ -307,6 +306,8 @@ public class MoongateConfirmGump : Gump
private Mobile _from;
private Moongate _gate;
public override bool Singleton => true;
public MoongateConfirmGump(Mobile from, Moongate gate) : base(Core.AOS ? 110 : 20, Core.AOS ? 100 : 30)
{
_from = from;

View file

@ -170,25 +170,7 @@ public partial class Runebook : Item, ISecurable, ICraftable
from.SendLocalizedMessage(502421); // You have removed the rune.
}
public bool IsOpen(Mobile toCheck)
{
var ns = toCheck.NetState;
if (ns == null)
{
return false;
}
foreach (var gump in ns.Gumps)
{
if ((gump as RunebookGump)?.Book == this)
{
return true;
}
}
return false;
}
public bool IsOpen(Mobile toCheck) => toCheck.FindGump<RunebookGump>()?.Book == this;
public override void GetProperties(IPropertyList list)
{
@ -268,9 +250,7 @@ public partial class Runebook : Item, ISecurable, ICraftable
public void SendGumpTo(Mobile from)
{
from.CloseGump<RunebookGump>();
from.SendGump(new RunebookGump(this));
from.SendGump(new RunebookGump(this), true);
Openers.Add(from);
}

View file

@ -277,7 +277,6 @@ public class BandageContext : Timer
{
healerNumber = 503255; // You are able to resurrect the creature.
master.CloseGump<PetResurrectGump>();
master.SendGump(new PetResurrectGump(Healer, petPatient));
}
else
@ -294,7 +293,6 @@ public class BandageContext : Timer
{
healerNumber = 503255; // You are able to resurrect the creature.
friend.CloseGump<PetResurrectGump>();
friend.SendGump(new PetResurrectGump(Healer, petPatient));
found = true;
@ -310,7 +308,6 @@ public class BandageContext : Timer
}
else
{
Patient.CloseGump<ResurrectGump>();
Patient.SendGump(new ResurrectGump(Healer));
}
}

View file

@ -1,4 +1,5 @@
using ModernUO.Serialization;
using Server.Gumps;
using Server.HuePickers;
using Server.Targeting;

View file

@ -102,14 +102,14 @@ public class DisguiseGump : Gump
private readonly DisguiseKit m_Kit;
private readonly bool m_Used;
public override bool Singleton => true;
public DisguiseGump(Mobile from, DisguiseKit kit, bool startAtHair, bool used) : base(50, 50)
{
m_From = from;
m_Kit = kit;
m_Used = used;
from.CloseGump<DisguiseGump>();
AddPage(0);
AddBackground(100, 10, 400, 385, 2600);

View file

@ -1,6 +1,7 @@
using System;
using ModernUO.Serialization;
using Server.Engines.Craft;
using Server.Gumps;
using Server.Network;
namespace Server.Items;

View file

@ -212,7 +212,6 @@ public partial class DawnsMusicBox : Item, ISecurable
}
else
{
from.CloseGump<DawnsMusicBoxGump>();
from.SendGump(new DawnsMusicBoxGump(this));
}
}

View file

@ -1,4 +1,4 @@
using Server.Items;
using Server.Items;
using Server.Network;
namespace Server.Gumps;
@ -7,6 +7,8 @@ public class DawnsMusicBoxGump : Gump
{
private readonly DawnsMusicBox m_Box;
public override bool Singleton => true;
public DawnsMusicBoxGump(DawnsMusicBox box) : base(60, 36)
{
m_Box = box;

View file

@ -45,7 +45,6 @@ public partial class BrokenBedDeed : BaseAddonDeed
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -63,6 +62,8 @@ public partial class BrokenBedDeed : BaseAddonDeed
{
private readonly BrokenBedDeed _deed;
public override bool Singleton => true;
public InternalGump(BrokenBedDeed deed) : base(60, 36)
{
_deed = deed;

View file

@ -40,7 +40,6 @@ public partial class BrokenVanityDeed : BaseAddonDeed
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -58,6 +57,8 @@ public partial class BrokenVanityDeed : BaseAddonDeed
{
private readonly BrokenVanityDeed _deed;
public override bool Singleton => true;
public InternalGump(BrokenVanityDeed deed) : base(60, 63)
{
_deed = deed;

View file

@ -47,7 +47,6 @@ public partial class HearthOfHomeFireDeed : BaseAddonDeed
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -65,6 +64,8 @@ public partial class HearthOfHomeFireDeed : BaseAddonDeed
{
private readonly HearthOfHomeFireDeed _deed;
public override bool Singleton => true;
public InternalGump(HearthOfHomeFireDeed deed) : base(150, 50)
{
_deed = deed;

View file

@ -35,7 +35,6 @@ public partial class TapestryOfSosaria : Item, ISecurable
{
if (from.InRange(GetWorldLocation(), 2))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump());
}
else
@ -51,6 +50,8 @@ public partial class TapestryOfSosaria : Item, ISecurable
private class InternalGump : Gump
{
public override bool Singleton => true;
public InternalGump() : base(50, 50)
{
AddImage(0, 0, 0x2C95);

View file

@ -92,7 +92,6 @@ public partial class CurtainsDeed : BaseAddonDeed
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -110,6 +109,8 @@ public partial class CurtainsDeed : BaseAddonDeed
{
private readonly CurtainsDeed _deed;
public override bool Singleton => true;
public InternalGump(CurtainsDeed deed) : base(60, 36)
{
_deed = deed;

View file

@ -40,7 +40,6 @@ public partial class HangingAxesDeed : BaseAddonDeed
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -58,6 +57,8 @@ public partial class HangingAxesDeed : BaseAddonDeed
{
private readonly HangingAxesDeed m_Deed;
public override bool Singleton => true;
public InternalGump(HangingAxesDeed deed) : base(60, 36)
{
m_Deed = deed;

View file

@ -40,7 +40,6 @@ public partial class HangingSwordsDeed : BaseAddonDeed
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -58,6 +57,8 @@ public partial class HangingSwordsDeed : BaseAddonDeed
{
private readonly HangingSwordsDeed m_Deed;
public override bool Singleton => true;
public InternalGump(HangingSwordsDeed deed) : base(60, 36)
{
m_Deed = deed;

View file

@ -81,7 +81,6 @@ public partial class HouseLadderDeed : BaseAddonDeed
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -99,6 +98,8 @@ public partial class HouseLadderDeed : BaseAddonDeed
{
private readonly HouseLadderDeed _deed;
public override bool Singleton => true;
public InternalGump(HouseLadderDeed deed) : base(60, 36)
{
_deed = deed;

View file

@ -42,7 +42,6 @@ public partial class StoneStatueDeed : BaseAddonDeed
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -60,6 +59,8 @@ public partial class StoneStatueDeed : BaseAddonDeed
{
private readonly StoneStatueDeed _deed;
public override bool Singleton => true;
public InternalGump(StoneStatueDeed deed) : base(60, 36)
{
_deed = deed;

View file

@ -44,7 +44,6 @@ public partial class UnmadeBedDeed : BaseAddonDeed
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -62,6 +61,8 @@ public partial class UnmadeBedDeed : BaseAddonDeed
{
private readonly UnmadeBedDeed _deed;
public override bool Singleton => true;
public InternalGump(UnmadeBedDeed deed) : base(60, 36)
{
_deed = deed;

View file

@ -41,7 +41,6 @@ public partial class VanityDeed : BaseAddonContainerDeed
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -59,6 +58,8 @@ public partial class VanityDeed : BaseAddonContainerDeed
{
private readonly VanityDeed _deed;
public override bool Singleton => true;
public InternalGump(VanityDeed deed) : base(60, 36)
{
_deed = deed;

View file

@ -52,7 +52,6 @@ public partial class WoodenCoffinDeed : BaseAddonDeed
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -70,6 +69,8 @@ public partial class WoodenCoffinDeed : BaseAddonDeed
{
private readonly WoodenCoffinDeed _deed;
public override bool Singleton => true;
public InternalGump(WoodenCoffinDeed deed) : base(60, 36)
{
_deed = deed;

View file

@ -1,4 +1,4 @@
using ModernUO.Serialization;
using ModernUO.Serialization;
using Server.Gumps;
namespace Server.Items;
@ -19,8 +19,7 @@ public partial class HeritageToken : Item
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<HeritageTokenGump>();
from.SendGump(new HeritageTokenGump(this));
from.SendGump(new HeritageTokenGump(this), true);
}
else
{

View file

@ -33,7 +33,6 @@ public partial class PottedPlantDeed : Item
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -46,6 +45,8 @@ public partial class PottedPlantDeed : Item
{
private readonly PottedPlantDeed _deed;
public override bool Singleton => true;
public InternalGump(PottedPlantDeed deed) : base(100, 200)
{
_deed = deed;

View file

@ -65,7 +65,6 @@ public partial class SnowStatueDeed : Item
{
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(from, this));
}
else
@ -78,6 +77,8 @@ public partial class SnowStatueDeed : Item
{
private readonly SnowStatueDeed _deed;
public override bool Singleton => true;
public InternalGump(Mobile from, SnowStatueDeed deed) : base(100, 200)
{
_deed = deed;

View file

@ -96,7 +96,6 @@ public partial class WreathAddon : Item, IDyable, IAddon
{
if (from.InRange(GetWorldLocation(), 3))
{
from.CloseGump<WreathAddonGump>();
from.SendGump(new WreathAddonGump(from, this));
}
else
@ -111,6 +110,8 @@ public partial class WreathAddon : Item, IDyable, IAddon
private readonly WreathAddon _addon;
private readonly Mobile _from;
public override bool Singleton => true;
public WreathAddonGump(Mobile from, WreathAddon addon) : base(150, 50)
{
_from = from;

View file

@ -84,7 +84,6 @@ public partial class HouseRaffleDeed : Item
if (IsChildOf(from.Backpack))
{
from.CloseGump<WritOfLeaseGump>();
from.SendGump(new WritOfLeaseGump(this));
}
else
@ -95,6 +94,8 @@ public partial class HouseRaffleDeed : Item
private class WritOfLeaseGump : Gump
{
public override bool Singleton => true;
public WritOfLeaseGump(HouseRaffleDeed deed) : base(150, 50)
{
AddPage(0);

View file

@ -1,5 +1,6 @@
using ModernUO.Serialization;
using Server.Engines.VeteranRewards;
using Server.Gumps;
using Server.Multis;
namespace Server.Items;

View file

@ -226,19 +226,21 @@ public partial class SoulStone : Item, ISecurable
return;
}
from.CloseGump<SelectSkillGump>();
from.CloseGump<ConfirmSkillGump>();
from.CloseGump<ConfirmTransferGump>();
from.CloseGump<ConfirmRemovalGump>();
from.CloseGump<ErrorGump>();
var gumps = from.GetGumps();
gumps.Close<SelectSkillGump>();
gumps.Close<ConfirmSkillGump>();
gumps.Close<ConfirmTransferGump>();
gumps.Close<ConfirmRemovalGump>();
gumps.Close<ErrorGump>();
if (IsEmpty)
{
from.SendGump(new SelectSkillGump(this, from));
gumps.Send(new SelectSkillGump(this, from));
}
else
{
from.SendGump(new ConfirmTransferGump(this, from));
gumps.Send(new ConfirmTransferGump(this, from));
}
}

View file

@ -72,7 +72,6 @@ public abstract partial class SpecialScroll : Item
return;
}
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(from, this));
}
@ -81,6 +80,8 @@ public abstract partial class SpecialScroll : Item
private readonly Mobile _mobile;
private readonly SpecialScroll _scroll;
public override bool Singleton => true;
public InternalGump(Mobile mobile, SpecialScroll scroll) : base(25, 50)
{
_mobile = mobile;

View file

@ -61,7 +61,6 @@ public partial class AnkhOfSacrificeComponent : AddonComponent
}
else
{
m.CloseGump<AnkhResurrectGump>();
m.SendGump(new AnkhResurrectGump(m, ResurrectMessage.VirtueShrine));
}
}
@ -215,7 +214,6 @@ public partial class AnkhOfSacrificeDeed : BaseAddonDeed, IRewardItem, IRewardOp
if (IsChildOf(from.Backpack))
{
from.CloseGump<RewardOptionGump>();
from.SendGump(new RewardOptionGump(this));
}
else

View file

@ -77,7 +77,6 @@ public partial class Banner : Item, IAddon, IDyable, IRewardItem
if (house?.IsOwner(from) == true)
{
from.CloseGump<RewardDemolitionGump>();
from.SendGump(new RewardDemolitionGump(this, 1018318)); // Do you wish to re-deed this banner?
}
else
@ -133,7 +132,6 @@ public partial class BannerDeed : Item, IRewardItem
if (house?.IsOwner(from) == true)
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -154,6 +152,8 @@ public partial class BannerDeed : Item, IRewardItem
private readonly BannerDeed _banner;
public override bool Singleton => true;
public InternalGump(BannerDeed banner) : base(100, 200)
{
_banner = banner;
@ -274,7 +274,6 @@ public partial class BannerDeed : Item, IRewardItem
if (north && west)
{
from.CloseGump<FacingGump>();
from.SendGump(new FacingGump(_banner, _itemID, p3d, house));
}
else if (north || west)
@ -301,6 +300,8 @@ public partial class BannerDeed : Item, IRewardItem
private readonly int m_ItemID;
private readonly Point3D m_Location;
public override bool Singleton => true;
public FacingGump(BannerDeed banner, int itemID, Point3D location, BaseHouse house) : base(150, 50)
{
m_Banner = banner;

View file

@ -136,7 +136,6 @@ public partial class RewardBrazierDeed : Item, IRewardItem
return;
}
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
@ -154,6 +153,8 @@ public partial class RewardBrazierDeed : Item, IRewardItem
{
private readonly RewardBrazierDeed _brazier;
public override bool Singleton => true;
public InternalGump(RewardBrazierDeed brazier) : base(100, 200)
{
_brazier = brazier;

View file

@ -420,7 +420,6 @@ public partial class CannonDeed : BaseAddonDeed, IRewardItem, IRewardOption
if (IsChildOf(from.Backpack))
{
from.CloseGump<RewardOptionGump>();
from.SendGump(new RewardOptionGump(this));
}
else

View file

@ -61,7 +61,6 @@ public partial class DecorativeShield : Item, IAddon, IRewardItem
if (house?.IsOwner(from) == true)
{
from.CloseGump<RewardDemolitionGump>();
from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration?
}
else
@ -113,7 +112,6 @@ public partial class DecorativeShieldDeed : Item, IRewardItem
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -141,6 +139,8 @@ public partial class DecorativeShieldDeed : Item, IRewardItem
private readonly DecorativeShieldDeed _shield;
public override bool Singleton => true;
public InternalGump(DecorativeShieldDeed shield) : base(150, 50)
{
_shield = shield;
@ -267,7 +267,6 @@ public partial class DecorativeShieldDeed : Item, IRewardItem
if (north && west)
{
from.CloseGump<FacingGump>();
from.SendGump(new FacingGump(_shield, _itemID, p3d, house));
}
else if (north || west)
@ -294,6 +293,8 @@ public partial class DecorativeShieldDeed : Item, IRewardItem
private readonly Point3D _location;
private readonly DecorativeShieldDeed _shield;
public override bool Singleton => true;
public FacingGump(DecorativeShieldDeed shield, int itemID, Point3D location, BaseHouse house) : base(150, 50)
{
_shield = shield;

View file

@ -75,7 +75,6 @@ public partial class FlamingHead : StoneFaceTrapNoDamage, IAddon, IRewardItem
if (house?.IsOwner(from) == true)
{
from.CloseGump<RewardDemolitionGump>();
from.SendGump(new RewardDemolitionGump(this, 1018329)); // Do you wish to re-deed this skull?
}
else

View file

@ -65,7 +65,6 @@ public partial class HangingSkeleton : Item, IAddon, IRewardItem
if (house?.IsOwner(from) == true)
{
from.CloseGump<RewardDemolitionGump>();
from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration?
}
else
@ -129,7 +128,6 @@ public partial class HangingSkeletonDeed : Item, IRewardItem
return;
}
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
@ -147,6 +145,8 @@ public partial class HangingSkeletonDeed : Item, IRewardItem
{
private readonly HangingSkeletonDeed _deed;
public override bool Singleton => true;
public InternalGump(HangingSkeletonDeed skeleton) : base(100, 200)
{
_deed = skeleton;
@ -253,7 +253,6 @@ public partial class HangingSkeletonDeed : Item, IRewardItem
if (north && west)
{
from.CloseGump<FacingGump>();
from.SendGump(new FacingGump(_deed, _itemID, p3d, house));
}
else if (north || west)
@ -280,6 +279,8 @@ public partial class HangingSkeletonDeed : Item, IRewardItem
private readonly Point3D _location;
private readonly HangingSkeletonDeed _skeleton;
public override bool Singleton => true;
public FacingGump(HangingSkeletonDeed banner, int itemID, Point3D location, BaseHouse house) : base(150, 50)
{
_skeleton = banner;

View file

@ -368,7 +368,6 @@ public partial class MiningCartDeed : BaseAddonDeed, IRewardItem, IRewardOption
if (IsChildOf(from.Backpack))
{
from.CloseGump<RewardOptionGump>();
from.SendGump(new RewardOptionGump(this));
}
else

View file

@ -110,7 +110,6 @@ public partial class MinotaurStatueDeed : BaseAddonDeed, IRewardItem, IRewardOpt
if (IsChildOf(from.Backpack))
{
from.CloseGump<RewardOptionGump>();
from.SendGump(new RewardOptionGump(this));
}
else

View file

@ -50,7 +50,6 @@ public partial class PottedCactusDeed : Item, IRewardItem
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -73,6 +72,8 @@ public partial class PottedCactusDeed : Item, IRewardItem
{
private readonly PottedCactusDeed _deed;
public override bool Singleton => true;
public InternalGump(PottedCactusDeed cactus) : base(100, 200)
{
_deed = cactus;

View file

@ -76,7 +76,6 @@ public partial class StoneAnkh : BaseAddon, IRewardItem
if (house?.IsOwner(from) == true)
{
from.CloseGump<RewardDemolitionGump>();
from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration?
}
else
@ -122,7 +121,6 @@ public partial class StoneAnkhDeed : BaseAddonDeed, IRewardItem
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -150,6 +148,8 @@ public partial class StoneAnkhDeed : BaseAddonDeed, IRewardItem
{
private readonly StoneAnkhDeed _deed;
public override bool Singleton => true;
public InternalGump(StoneAnkhDeed deed) : base(150, 50)
{
_deed = deed;

View file

@ -203,7 +203,6 @@ public partial class TreeStumpDeed : BaseAddonDeed, IRewardItem, IRewardOption
if (IsChildOf(from.Backpack))
{
from.CloseGump<RewardOptionGump>();
from.SendGump(new RewardOptionGump(this));
}
else

View file

@ -304,7 +304,6 @@ public partial class WallBannerDeed : BaseAddonDeed, IRewardItem
if (IsChildOf(from.Backpack))
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(this));
}
else
@ -324,6 +323,8 @@ public partial class WallBannerDeed : BaseAddonDeed, IRewardItem
{
private readonly WallBannerDeed _wallBanner;
public override bool Singleton => true;
public InternalGump(WallBannerDeed wallBanner) : base(150, 50)
{
_wallBanner = wallBanner;

View file

@ -174,7 +174,6 @@ public partial class WeaponEngravingTool : Item, IUsesRemaining, IRewardItem
if (targeted is BaseWeapon item)
{
from.CloseGump<InternalGump>();
from.SendGump(new InternalGump(_tool, item));
}
else
@ -189,6 +188,8 @@ public partial class WeaponEngravingTool : Item, IUsesRemaining, IRewardItem
private readonly BaseWeapon _target;
private readonly WeaponEngravingTool _tool;
public override bool Singleton => true;
public InternalGump(WeaponEngravingTool tool, BaseWeapon target) : base(0, 0)
{
_tool = tool;