perf: Migrate Veteran Reward gumps to DynamicGump/StaticGump (#2415)
## Summary Migrates 16 player-facing legacy `Gump` subclasses in the Veteran Rewards system to `DynamicGump` or `StaticGump<T>`, renames every nested `InternalGump`/`ConfirmGump` to system-prefixed names, and updates external callers to use new static `DisplayTo` entry points. ### Reward chain (Engines/Veteran Rewards) | Gump | Base type | Reasoning | |---|---|---| | `RewardNoticeGump` | `StaticGump<T>` | Fixed layout | | `RewardChoiceGump` | `DynamicGump` | Layout shape varies (per-player categories, entries, pages) | | `RewardConfirmGump` | `DynamicGump` | `entry.Name` is a dynamic cliloc per reward (cliloc rule) | | `RewardOptionGump` | `DynamicGump` | Title cliloc and per-option clilocs are dynamic (cliloc rule) | | `RewardDemolitionGump` | `DynamicGump` | `question` cliloc is dynamic per caller (cliloc rule) | ### Statue (Engines/Veteran Rewards/Character Statue Maker) | Gump | Base type | Reasoning | |---|---|---| | `CharacterStatueGump` | `DynamicGump` | Pose/Direction/Material labels are dynamic clilocs (cliloc rule) | | `CharacterPlinthGump` | `DynamicGump` | `statue.Name`, sculpted-on date, and statue-type cliloc are dynamic (cliloc rule) | ### Decorations (Items/Special/Veteran Rewards) — every `InternalGump` renamed | Original | New name | Base type | Reasoning | |---|---|---|---| | `Banner.InternalGump` | `BannerGump` | `StaticGump<T>` | Fully fixed item-id picker over `Start..End` range | | `Brazier.InternalGump` | `BrazierGump` | `StaticGump<T>` | Fixed two-item picker | | `Cannon.InternalGump` | `CannonGump` | `DynamicGump` | `keg.Validate()` value passed as `~1_CHARGES~` arg (cliloc-arg rule) | | `DecorativeShield.InternalGump` | `DecorativeShieldGump` | `StaticGump<T>` | Fixed item picker over a constant range | | `DecorativeShield.FacingGump` | `DecorativeShieldFacingGump` | `DynamicGump` | Item ids depend on instance state | | `HangingSkeleton.InternalGump` | `HangingSkeletonGump` | `StaticGump<T>` | Fixed item picker (5 hard-coded ids) | | `PottedCactus.InternalGump` | `PottedCactusGump` | `StaticGump<T>` | Fixed 6-item picker | | `StoneAnkh.InternalGump` | `StoneAnkhGump` | `StaticGump<T>` | Fixed two-direction picker | | `WallBanner.InternalGump` | `WallBannerGump` | `StaticGump<T>` | Fixed 30-banner picker across 5 pages | | `WeaponEngravingTool.InternalGump` | `WeaponEngravingToolGump` | `StaticGump<T>` | Fixed text-entry dialog | | `WeaponEngravingTool.ConfirmGump` | `WeaponEngravingToolConfirmGump` | `DynamicGump` | Layout branches on `guildmaster != null` | ### External callers updated `RewardSystem`, `CharacterStatue`, `FireFliesDeed`, `FlamingHead`, `Banner`, `DecorativeShield`, `HangingSkeleton`, `StoneAnkh` (RewardDemolitionGump callers); `AnkhOfSacrifice`, `Cannon`, `MiningCart`, `MinotaurStatue`, `TreeStump` (RewardOptionGump callers); `TinkerGuildmaster` (engraver confirm gump). The pre-existing `FacingGump` inside `Banner.cs` (already `DynamicGump`) was left as-is — it is private, nested inside `InternalTarget`, and never referenced outside.
This commit is contained in:
parent
50599e0453
commit
ab5f615840
25 changed files with 1065 additions and 944 deletions
|
|
@ -214,7 +214,7 @@ public partial class AnkhOfSacrificeDeed : BaseAddonDeed, IRewardItem, IRewardOp
|
|||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
RewardOptionGump.DisplayTo(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ public partial class Banner : Item, IAddon, IDyable, IRewardItem
|
|||
|
||||
if (house?.IsOwner(from) == true)
|
||||
{
|
||||
from.SendGump(new RewardDemolitionGump(this, 1018318)); // Do you wish to re-deed this banner?
|
||||
RewardDemolitionGump.DisplayTo(from, this, 1018318); // Do you wish to re-deed this banner?
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -128,7 +128,7 @@ public partial class BannerDeed : Item, IRewardItem
|
|||
|
||||
if (house?.IsOwner(from) == true)
|
||||
{
|
||||
from.SendGump(new InternalGump(this));
|
||||
BannerGump.DisplayTo(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -141,7 +141,7 @@ public partial class BannerDeed : Item, IRewardItem
|
|||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
private class BannerGump : StaticGump<BannerGump>
|
||||
{
|
||||
public const int Start = 0x15AE;
|
||||
public const int End = 0x15F4;
|
||||
|
|
@ -150,41 +150,46 @@ public partial class BannerDeed : Item, IRewardItem
|
|||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public InternalGump(BannerDeed banner) : base(100, 200)
|
||||
private BannerGump(BannerDeed banner) : base(100, 200) => _banner = banner;
|
||||
|
||||
public static void DisplayTo(Mobile from, BannerDeed banner)
|
||||
{
|
||||
_banner = banner;
|
||||
if (from?.NetState == null || banner?.Deleted != false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Draggable = true;
|
||||
Resizable = false;
|
||||
from.SendGump(new BannerGump(banner));
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
protected override void BuildLayout(ref StaticGumpBuilder builder)
|
||||
{
|
||||
builder.AddPage();
|
||||
|
||||
AddBackground(25, 0, 520, 230, 0xA28);
|
||||
builder.AddBackground(25, 0, 520, 230, 0xA28);
|
||||
// TODO: Use 1152360 - <CENTER>Choose a banner:</CENTER>
|
||||
AddLabel(70, 12, 0x3E3, "Choose a Banner:");
|
||||
builder.AddLabel(70, 12, 0x3E3, "Choose a Banner:");
|
||||
|
||||
var itemID = Start;
|
||||
|
||||
for (var i = 1; i <= 4; i++)
|
||||
{
|
||||
AddPage(i);
|
||||
builder.AddPage(i);
|
||||
|
||||
for (var j = 0; j < 8; j++, itemID += 2)
|
||||
{
|
||||
AddItem(50 + 60 * j, 70, itemID);
|
||||
AddButton(50 + 60 * j, 50, 0x845, 0x846, itemID);
|
||||
builder.AddItem(50 + 60 * j, 70, itemID);
|
||||
builder.AddButton(50 + 60 * j, 50, 0x845, 0x846, itemID);
|
||||
}
|
||||
|
||||
if (i > 1)
|
||||
{
|
||||
AddButton(75, 198, 0x8AF, 0x8AF, 0, GumpButtonType.Page, i - 1);
|
||||
builder.AddButton(75, 198, 0x8AF, 0x8AF, 0, GumpButtonType.Page, i - 1);
|
||||
}
|
||||
|
||||
if (i < 4)
|
||||
{
|
||||
AddButton(475, 198, 0x8B0, 0x8B0, 0, GumpButtonType.Page, i + 1);
|
||||
builder.AddButton(475, 198, 0x8B0, 0x8B0, 0, GumpButtonType.Page, i + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ public partial class RewardBrazierDeed : Item, IRewardItem
|
|||
return;
|
||||
}
|
||||
|
||||
from.SendGump(new InternalGump(this));
|
||||
BrazierGump.DisplayTo(from, this);
|
||||
}
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
|
|
@ -145,32 +145,37 @@ public partial class RewardBrazierDeed : Item, IRewardItem
|
|||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
private class BrazierGump : StaticGump<BrazierGump>
|
||||
{
|
||||
private readonly RewardBrazierDeed _brazier;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public InternalGump(RewardBrazierDeed brazier) : base(100, 200)
|
||||
private BrazierGump(RewardBrazierDeed brazier) : base(100, 200) => _brazier = brazier;
|
||||
|
||||
public static void DisplayTo(Mobile from, RewardBrazierDeed brazier)
|
||||
{
|
||||
_brazier = brazier;
|
||||
if (from?.NetState == null || brazier?.Deleted != false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Draggable = true;
|
||||
Resizable = false;
|
||||
from.SendGump(new BrazierGump(brazier));
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
AddBackground(0, 0, 200, 200, 2600);
|
||||
protected override void BuildLayout(ref StaticGumpBuilder builder)
|
||||
{
|
||||
builder.AddPage();
|
||||
builder.AddBackground(0, 0, 200, 200, 2600);
|
||||
|
||||
AddPage(1);
|
||||
AddLabel(45, 15, 0, "Choose a Brazier:");
|
||||
builder.AddPage(1);
|
||||
builder.AddLabel(45, 15, 0, "Choose a Brazier:");
|
||||
|
||||
AddItem(40, 75, 0x19AA);
|
||||
AddButton(55, 50, 0x845, 0x846, 0x19AA);
|
||||
builder.AddItem(40, 75, 0x19AA);
|
||||
builder.AddButton(55, 50, 0x845, 0x846, 0x19AA);
|
||||
|
||||
AddItem(100, 75, 0x19BB);
|
||||
AddButton(115, 50, 0x845, 0x846, 0x19BB);
|
||||
builder.AddItem(100, 75, 0x19BB);
|
||||
builder.AddButton(115, 50, 0x845, 0x846, 0x19BB);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||
|
|
|
|||
|
|
@ -142,7 +142,7 @@ public partial class CannonAddon : BaseAddon
|
|||
|
||||
if (Validate(keg) > 0)
|
||||
{
|
||||
from.SendGump(new InternalGump(this, keg));
|
||||
CannonGump.DisplayTo(from, this, keg);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -309,34 +309,44 @@ public partial class CannonAddon : BaseAddon
|
|||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
private class CannonGump : DynamicGump
|
||||
{
|
||||
private readonly CannonAddon _cannon;
|
||||
private readonly PotionKeg _keg;
|
||||
|
||||
public InternalGump(CannonAddon cannon, PotionKeg keg) : base(50, 50)
|
||||
public override bool Singleton => true;
|
||||
|
||||
private CannonGump(CannonAddon cannon, PotionKeg keg) : base(50, 50)
|
||||
{
|
||||
_cannon = cannon;
|
||||
_keg = keg;
|
||||
}
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Draggable = true;
|
||||
Resizable = false;
|
||||
public static void DisplayTo(Mobile from, CannonAddon cannon, PotionKeg keg)
|
||||
{
|
||||
if (from?.NetState == null || cannon?.Deleted != false || keg?.Deleted != false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
from.SendGump(new CannonGump(cannon, keg));
|
||||
}
|
||||
|
||||
AddBackground(0, 0, 291, 133, 0x13BE);
|
||||
AddImageTiled(5, 5, 280, 100, 0xA40);
|
||||
protected override void BuildLayout(ref DynamicGumpBuilder builder)
|
||||
{
|
||||
builder.AddPage();
|
||||
|
||||
builder.AddBackground(0, 0, 291, 133, 0x13BE);
|
||||
builder.AddImageTiled(5, 5, 280, 100, 0xA40);
|
||||
|
||||
// You will need a full keg of explosion potions to recharge the cannon. Your keg will provide ~1_CHARGES~ charges.
|
||||
AddHtmlLocalized(9, 9, 272, 100, 1076196, cannon.Validate(keg).ToString(), 0x7FFF);
|
||||
builder.AddHtmlLocalized(9, 9, 272, 100, 1076196, $"{_cannon.Validate(_keg)}", 0x7FFF);
|
||||
|
||||
AddButton(5, 107, 0xFB1, 0xFB2, (int)Buttons.Cancel);
|
||||
AddHtmlLocalized(40, 109, 100, 20, 1060051, 0x7FFF); // CANCEL
|
||||
builder.AddButton(5, 107, 0xFB1, 0xFB2, (int)Buttons.Cancel);
|
||||
builder.AddHtmlLocalized(40, 109, 100, 20, 1060051, 0x7FFF); // CANCEL
|
||||
|
||||
AddButton(160, 107, 0xFB7, 0xFB8, (int)Buttons.Recharge);
|
||||
AddHtmlLocalized(195, 109, 120, 20, 1076197, 0x7FFF); // Recharge
|
||||
builder.AddButton(160, 107, 0xFB7, 0xFB8, (int)Buttons.Recharge);
|
||||
builder.AddHtmlLocalized(195, 109, 120, 20, 1076197, 0x7FFF); // Recharge
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, in RelayInfo info)
|
||||
|
|
@ -420,7 +430,7 @@ public partial class CannonDeed : BaseAddonDeed, IRewardItem, IRewardOption
|
|||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
RewardOptionGump.DisplayTo(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ public partial class DecorativeShield : Item, IAddon, IRewardItem
|
|||
|
||||
if (house?.IsOwner(from) == true)
|
||||
{
|
||||
from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration?
|
||||
RewardDemolitionGump.DisplayTo(from, this, 1049783); // Do you wish to re-deed this decoration?
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -108,7 +108,7 @@ public partial class DecorativeShieldDeed : Item, IRewardItem
|
|||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new InternalGump(this));
|
||||
DecorativeShieldGump.DisplayTo(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -128,7 +128,7 @@ public partial class DecorativeShieldDeed : Item, IRewardItem
|
|||
};
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
private class DecorativeShieldGump : StaticGump<DecorativeShieldGump>
|
||||
{
|
||||
public const int Start = 0x156C;
|
||||
public const int End = 0x1585;
|
||||
|
|
@ -137,29 +137,34 @@ public partial class DecorativeShieldDeed : Item, IRewardItem
|
|||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public InternalGump(DecorativeShieldDeed shield) : base(150, 50)
|
||||
private DecorativeShieldGump(DecorativeShieldDeed shield) : base(150, 50) => _shield = shield;
|
||||
|
||||
public static void DisplayTo(Mobile from, DecorativeShieldDeed shield)
|
||||
{
|
||||
_shield = shield;
|
||||
if (from?.NetState == null || shield?.Deleted != false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Draggable = true;
|
||||
Resizable = false;
|
||||
from.SendGump(new DecorativeShieldGump(shield));
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
protected override void BuildLayout(ref StaticGumpBuilder builder)
|
||||
{
|
||||
builder.AddPage();
|
||||
|
||||
AddBackground(25, 0, 500, 230, 0xA28);
|
||||
builder.AddBackground(25, 0, 500, 230, 0xA28);
|
||||
|
||||
var itemID = Start;
|
||||
|
||||
for (var i = 1; i <= 2; i++)
|
||||
{
|
||||
AddPage(i);
|
||||
builder.AddPage(i);
|
||||
|
||||
for (var j = 0; j < 9 - i; j++)
|
||||
{
|
||||
AddItem(40 + j * 60, 70, itemID);
|
||||
AddButton(60 + j * 60, 50, 0x845, 0x846, itemID);
|
||||
builder.AddItem(40 + j * 60, 70, itemID);
|
||||
builder.AddButton(60 + j * 60, 50, 0x845, 0x846, itemID);
|
||||
|
||||
if (itemID < 0x1582)
|
||||
{
|
||||
|
|
@ -175,12 +180,12 @@ public partial class DecorativeShieldDeed : Item, IRewardItem
|
|||
{
|
||||
case 1:
|
||||
{
|
||||
AddButton(455, 198, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 2);
|
||||
builder.AddButton(455, 198, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 2);
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
AddButton(70, 198, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 1);
|
||||
builder.AddButton(70, 198, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 1);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
@ -263,7 +268,7 @@ public partial class DecorativeShieldDeed : Item, IRewardItem
|
|||
|
||||
if (north && west)
|
||||
{
|
||||
from.SendGump(new FacingGump(_shield, _itemID, p3d, house));
|
||||
DecorativeShieldFacingGump.DisplayTo(from, _shield, _itemID, p3d, house);
|
||||
}
|
||||
else if (north || west)
|
||||
{
|
||||
|
|
@ -282,7 +287,7 @@ public partial class DecorativeShieldDeed : Item, IRewardItem
|
|||
}
|
||||
}
|
||||
|
||||
private class FacingGump : Gump
|
||||
private class DecorativeShieldFacingGump : DynamicGump
|
||||
{
|
||||
private readonly BaseHouse _house;
|
||||
private readonly int _itemID;
|
||||
|
|
@ -291,26 +296,34 @@ public partial class DecorativeShieldDeed : Item, IRewardItem
|
|||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public FacingGump(DecorativeShieldDeed shield, int itemID, Point3D location, BaseHouse house) : base(150, 50)
|
||||
private DecorativeShieldFacingGump(DecorativeShieldDeed shield, int itemID, Point3D location, BaseHouse house) : base(150, 50)
|
||||
{
|
||||
_shield = shield;
|
||||
_itemID = itemID;
|
||||
_location = location;
|
||||
_house = house;
|
||||
}
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Draggable = true;
|
||||
Resizable = false;
|
||||
public static void DisplayTo(Mobile from, DecorativeShieldDeed shield, int itemID, Point3D location, BaseHouse house)
|
||||
{
|
||||
if (from?.NetState == null || shield?.Deleted != false || house == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
AddBackground(0, 0, 300, 150, 0xA28);
|
||||
from.SendGump(new DecorativeShieldFacingGump(shield, itemID, location, house));
|
||||
}
|
||||
|
||||
AddItem(90, 30, GetWestItemID(itemID));
|
||||
AddItem(180, 30, itemID);
|
||||
protected override void BuildLayout(ref DynamicGumpBuilder builder)
|
||||
{
|
||||
builder.AddPage();
|
||||
builder.AddBackground(0, 0, 300, 150, 0xA28);
|
||||
|
||||
AddButton(50, 35, 0x867, 0x869, (int)Buttons.East);
|
||||
AddButton(145, 35, 0x867, 0x869, (int)Buttons.South);
|
||||
builder.AddItem(90, 30, GetWestItemID(_itemID));
|
||||
builder.AddItem(180, 30, _itemID);
|
||||
|
||||
builder.AddButton(50, 35, 0x867, 0x869, (int)Buttons.East);
|
||||
builder.AddButton(145, 35, 0x867, 0x869, (int)Buttons.South);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ public partial class FlamingHead : StoneFaceTrapNoDamage, IAddon, IRewardItem
|
|||
|
||||
if (house?.IsOwner(from) == true)
|
||||
{
|
||||
from.SendGump(new RewardDemolitionGump(this, 1018329)); // Do you wish to re-deed this skull?
|
||||
RewardDemolitionGump.DisplayTo(from, this, 1018329); // Do you wish to re-deed this skull?
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -69,7 +69,7 @@ public partial class HangingSkeleton : Item, IAddon, IRewardItem
|
|||
|
||||
if (house?.IsOwner(from) == true)
|
||||
{
|
||||
from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration?
|
||||
RewardDemolitionGump.DisplayTo(from, this, 1049783); // Do you wish to re-deed this decoration?
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -124,7 +124,7 @@ public partial class HangingSkeletonDeed : Item, IRewardItem
|
|||
return;
|
||||
}
|
||||
|
||||
from.SendGump(new InternalGump(this));
|
||||
HangingSkeletonGump.DisplayTo(from, this);
|
||||
}
|
||||
|
||||
public static int GetWestItemID(int south)
|
||||
|
|
@ -137,41 +137,46 @@ public partial class HangingSkeletonDeed : Item, IRewardItem
|
|||
};
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
private class HangingSkeletonGump : StaticGump<HangingSkeletonGump>
|
||||
{
|
||||
private readonly HangingSkeletonDeed _deed;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public InternalGump(HangingSkeletonDeed skeleton) : base(100, 200)
|
||||
private HangingSkeletonGump(HangingSkeletonDeed skeleton) : base(100, 200) => _deed = skeleton;
|
||||
|
||||
public static void DisplayTo(Mobile from, HangingSkeletonDeed deed)
|
||||
{
|
||||
_deed = skeleton;
|
||||
if (from?.NetState == null || deed?.Deleted != false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Draggable = true;
|
||||
Resizable = false;
|
||||
from.SendGump(new HangingSkeletonGump(deed));
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
protected override void BuildLayout(ref StaticGumpBuilder builder)
|
||||
{
|
||||
builder.AddPage();
|
||||
|
||||
AddBackground(25, 0, 500, 230, 0xA28);
|
||||
builder.AddBackground(25, 0, 500, 230, 0xA28);
|
||||
|
||||
AddPage(1);
|
||||
builder.AddPage(1);
|
||||
|
||||
AddItem(130, 70, 0x1A03);
|
||||
AddButton(150, 50, 0x845, 0x846, 0x1A03);
|
||||
builder.AddItem(130, 70, 0x1A03);
|
||||
builder.AddButton(150, 50, 0x845, 0x846, 0x1A03);
|
||||
|
||||
AddItem(190, 70, 0x1A05);
|
||||
AddButton(210, 50, 0x845, 0x846, 0x1A05);
|
||||
builder.AddItem(190, 70, 0x1A05);
|
||||
builder.AddButton(210, 50, 0x845, 0x846, 0x1A05);
|
||||
|
||||
AddItem(250, 70, 0x1A09);
|
||||
AddButton(270, 50, 0x845, 0x846, 0x1A09);
|
||||
builder.AddItem(250, 70, 0x1A09);
|
||||
builder.AddButton(270, 50, 0x845, 0x846, 0x1A09);
|
||||
|
||||
AddItem(310, 70, 0x1B1E);
|
||||
AddButton(330, 50, 0x845, 0x846, 0x1B1E);
|
||||
builder.AddItem(310, 70, 0x1B1E);
|
||||
builder.AddButton(330, 50, 0x845, 0x846, 0x1B1E);
|
||||
|
||||
AddItem(370, 70, 0x1B7F);
|
||||
AddButton(390, 50, 0x845, 0x846, 0x1B7F);
|
||||
builder.AddItem(370, 70, 0x1B7F);
|
||||
builder.AddButton(390, 50, 0x845, 0x846, 0x1B7F);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||
|
|
|
|||
|
|
@ -368,7 +368,7 @@ public partial class MiningCartDeed : BaseAddonDeed, IRewardItem, IRewardOption
|
|||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
RewardOptionGump.DisplayTo(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@ public partial class MinotaurStatueDeed : BaseAddonDeed, IRewardItem, IRewardOpt
|
|||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
RewardOptionGump.DisplayTo(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public partial class PottedCactusDeed : Item, IRewardItem
|
|||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new InternalGump(this));
|
||||
PottedCactusGump.DisplayTo(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -69,44 +69,49 @@ public partial class PottedCactusDeed : Item, IRewardItem
|
|||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
private class PottedCactusGump : StaticGump<PottedCactusGump>
|
||||
{
|
||||
private readonly PottedCactusDeed _deed;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public InternalGump(PottedCactusDeed cactus) : base(100, 200)
|
||||
private PottedCactusGump(PottedCactusDeed cactus) : base(100, 200) => _deed = cactus;
|
||||
|
||||
public static void DisplayTo(Mobile from, PottedCactusDeed deed)
|
||||
{
|
||||
_deed = cactus;
|
||||
if (from?.NetState == null || deed?.Deleted != false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Draggable = true;
|
||||
Resizable = false;
|
||||
from.SendGump(new PottedCactusGump(deed));
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
AddBackground(0, 0, 425, 250, 0xA28);
|
||||
protected override void BuildLayout(ref StaticGumpBuilder builder)
|
||||
{
|
||||
builder.AddPage();
|
||||
builder.AddBackground(0, 0, 425, 250, 0xA28);
|
||||
|
||||
AddPage(1);
|
||||
AddLabel(45, 15, 0, "Choose a Potted Cactus:");
|
||||
builder.AddPage(1);
|
||||
builder.AddLabel(45, 15, 0, "Choose a Potted Cactus:");
|
||||
|
||||
AddItem(45, 75, 0x1E0F);
|
||||
AddButton(55, 50, 0x845, 0x846, 0x1E0F);
|
||||
builder.AddItem(45, 75, 0x1E0F);
|
||||
builder.AddButton(55, 50, 0x845, 0x846, 0x1E0F);
|
||||
|
||||
AddItem(105, 75, 0x1E10);
|
||||
AddButton(115, 50, 0x845, 0x846, 0x1E10);
|
||||
builder.AddItem(105, 75, 0x1E10);
|
||||
builder.AddButton(115, 50, 0x845, 0x846, 0x1E10);
|
||||
|
||||
AddItem(160, 75, 0x1E14);
|
||||
AddButton(175, 50, 0x845, 0x846, 0x1E14);
|
||||
builder.AddItem(160, 75, 0x1E14);
|
||||
builder.AddButton(175, 50, 0x845, 0x846, 0x1E14);
|
||||
|
||||
AddItem(220, 75, 0x1E11);
|
||||
AddButton(235, 50, 0x845, 0x846, 0x1E11);
|
||||
builder.AddItem(220, 75, 0x1E11);
|
||||
builder.AddButton(235, 50, 0x845, 0x846, 0x1E11);
|
||||
|
||||
AddItem(280, 75, 0x1E12);
|
||||
AddButton(295, 50, 0x845, 0x846, 0x1E12);
|
||||
builder.AddItem(280, 75, 0x1E12);
|
||||
builder.AddButton(295, 50, 0x845, 0x846, 0x1E12);
|
||||
|
||||
AddItem(340, 75, 0x1E13);
|
||||
AddButton(355, 50, 0x845, 0x846, 0x1E13);
|
||||
builder.AddItem(340, 75, 0x1E13);
|
||||
builder.AddButton(355, 50, 0x845, 0x846, 0x1E13);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||
|
|
|
|||
|
|
@ -84,7 +84,7 @@ public partial class StoneAnkh : BaseAddon, IRewardItem
|
|||
|
||||
if (house?.IsOwner(from) == true)
|
||||
{
|
||||
from.SendGump(new RewardDemolitionGump(this, 1049783)); // Do you wish to re-deed this decoration?
|
||||
RewardDemolitionGump.DisplayTo(from, this, 1049783); // Do you wish to re-deed this decoration?
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -124,7 +124,7 @@ public partial class StoneAnkhDeed : BaseAddonDeed, IRewardItem
|
|||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new InternalGump(this));
|
||||
StoneAnkhGump.DisplayTo(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -147,32 +147,37 @@ public partial class StoneAnkhDeed : BaseAddonDeed, IRewardItem
|
|||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
private class StoneAnkhGump : StaticGump<StoneAnkhGump>
|
||||
{
|
||||
private readonly StoneAnkhDeed _deed;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public InternalGump(StoneAnkhDeed deed) : base(150, 50)
|
||||
private StoneAnkhGump(StoneAnkhDeed deed) : base(150, 50) => _deed = deed;
|
||||
|
||||
public static void DisplayTo(Mobile from, StoneAnkhDeed deed)
|
||||
{
|
||||
_deed = deed;
|
||||
if (from?.NetState == null || deed?.Deleted != false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Draggable = true;
|
||||
Resizable = false;
|
||||
from.SendGump(new StoneAnkhGump(deed));
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
protected override void BuildLayout(ref StaticGumpBuilder builder)
|
||||
{
|
||||
builder.AddPage();
|
||||
|
||||
AddBackground(0, 0, 300, 150, 0xA28);
|
||||
builder.AddBackground(0, 0, 300, 150, 0xA28);
|
||||
|
||||
AddItem(90, 30, 0x4);
|
||||
AddItem(112, 30, 0x5);
|
||||
AddButton(50, 35, 0x867, 0x869, (int)Buttons.South); // South
|
||||
builder.AddItem(90, 30, 0x4);
|
||||
builder.AddItem(112, 30, 0x5);
|
||||
builder.AddButton(50, 35, 0x867, 0x869, (int)Buttons.South); // South
|
||||
|
||||
AddItem(170, 30, 0x2);
|
||||
AddItem(192, 30, 0x3);
|
||||
AddButton(145, 35, 0x867, 0x869, (int)Buttons.East); // East
|
||||
builder.AddItem(170, 30, 0x2);
|
||||
builder.AddItem(192, 30, 0x3);
|
||||
builder.AddButton(145, 35, 0x867, 0x869, (int)Buttons.East); // East
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||
|
|
|
|||
|
|
@ -203,7 +203,7 @@ public partial class TreeStumpDeed : BaseAddonDeed, IRewardItem, IRewardOption
|
|||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new RewardOptionGump(this));
|
||||
RewardOptionGump.DisplayTo(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
|||
|
|
@ -304,7 +304,7 @@ public partial class WallBannerDeed : BaseAddonDeed, IRewardItem
|
|||
|
||||
if (IsChildOf(from.Backpack))
|
||||
{
|
||||
from.SendGump(new InternalGump(this));
|
||||
WallBannerGump.DisplayTo(from, this);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -319,152 +319,157 @@ public partial class WallBannerDeed : BaseAddonDeed, IRewardItem
|
|||
base.OnDoubleClick(m);
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
private class WallBannerGump : StaticGump<WallBannerGump>
|
||||
{
|
||||
private readonly WallBannerDeed _wallBanner;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public InternalGump(WallBannerDeed wallBanner) : base(150, 50)
|
||||
private WallBannerGump(WallBannerDeed wallBanner) : base(150, 50) => _wallBanner = wallBanner;
|
||||
|
||||
public static void DisplayTo(Mobile from, WallBannerDeed wallBanner)
|
||||
{
|
||||
_wallBanner = wallBanner;
|
||||
if (from?.NetState == null || wallBanner?.Deleted != false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Draggable = true;
|
||||
Resizable = false;
|
||||
from.SendGump(new WallBannerGump(wallBanner));
|
||||
}
|
||||
|
||||
AddBackground(25, 0, 500, 265, 0xA28);
|
||||
AddLabel(70, 12, 0x3E3, "Choose a Wall Banner:");
|
||||
protected override void BuildLayout(ref StaticGumpBuilder builder)
|
||||
{
|
||||
builder.AddBackground(25, 0, 500, 265, 0xA28);
|
||||
builder.AddLabel(70, 12, 0x3E3, "Choose a Wall Banner:");
|
||||
|
||||
AddPage(1);
|
||||
builder.AddPage(1);
|
||||
|
||||
AddItem(55, 110, 0x161D);
|
||||
AddItem(75, 90, 0x161E);
|
||||
AddItem(95, 70, 0x161F);
|
||||
AddButton(70, 50, 0x845, 0x846, 1);
|
||||
AddItem(105, 70, 0x1586);
|
||||
AddItem(125, 90, 0x1587);
|
||||
AddItem(145, 110, 0x1588);
|
||||
AddButton(145, 50, 0x845, 0x846, 2);
|
||||
AddItem(200, 110, 0x1620);
|
||||
AddItem(220, 90, 0x1621);
|
||||
AddItem(240, 70, 0x1622);
|
||||
AddButton(220, 50, 0x845, 0x846, 3);
|
||||
AddItem(250, 70, 0x1589);
|
||||
AddItem(270, 90, 0x158A);
|
||||
AddItem(290, 110, 0x158B);
|
||||
AddButton(300, 50, 0x845, 0x846, 4);
|
||||
AddItem(350, 110, 0x1623);
|
||||
AddItem(370, 90, 0x1624);
|
||||
AddItem(390, 70, 0x1625);
|
||||
AddButton(365, 50, 0x845, 0x846, 5);
|
||||
AddItem(400, 70, 0x158C);
|
||||
AddItem(420, 90, 0x158D);
|
||||
AddItem(440, 110, 0x158E);
|
||||
AddButton(445, 50, 0x845, 0x846, 6);
|
||||
AddButton(455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 2);
|
||||
builder.AddItem(55, 110, 0x161D);
|
||||
builder.AddItem(75, 90, 0x161E);
|
||||
builder.AddItem(95, 70, 0x161F);
|
||||
builder.AddButton(70, 50, 0x845, 0x846, 1);
|
||||
builder.AddItem(105, 70, 0x1586);
|
||||
builder.AddItem(125, 90, 0x1587);
|
||||
builder.AddItem(145, 110, 0x1588);
|
||||
builder.AddButton(145, 50, 0x845, 0x846, 2);
|
||||
builder.AddItem(200, 110, 0x1620);
|
||||
builder.AddItem(220, 90, 0x1621);
|
||||
builder.AddItem(240, 70, 0x1622);
|
||||
builder.AddButton(220, 50, 0x845, 0x846, 3);
|
||||
builder.AddItem(250, 70, 0x1589);
|
||||
builder.AddItem(270, 90, 0x158A);
|
||||
builder.AddItem(290, 110, 0x158B);
|
||||
builder.AddButton(300, 50, 0x845, 0x846, 4);
|
||||
builder.AddItem(350, 110, 0x1623);
|
||||
builder.AddItem(370, 90, 0x1624);
|
||||
builder.AddItem(390, 70, 0x1625);
|
||||
builder.AddButton(365, 50, 0x845, 0x846, 5);
|
||||
builder.AddItem(400, 70, 0x158C);
|
||||
builder.AddItem(420, 90, 0x158D);
|
||||
builder.AddItem(440, 110, 0x158E);
|
||||
builder.AddButton(445, 50, 0x845, 0x846, 6);
|
||||
builder.AddButton(455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 2);
|
||||
|
||||
AddPage(2);
|
||||
builder.AddPage(2);
|
||||
|
||||
AddItem(52, 110, 0x1626);
|
||||
AddItem(72, 90, 0x1627);
|
||||
AddItem(95, 70, 0x1628);
|
||||
AddButton(70, 50, 0x845, 0x846, 7);
|
||||
AddItem(105, 70, 0x1590);
|
||||
AddItem(125, 90, 0x1591);
|
||||
AddItem(145, 110, 0x158F);
|
||||
AddButton(145, 50, 0x845, 0x846, 8);
|
||||
AddItem(197, 110, 0x1626);
|
||||
AddItem(217, 90, 0x1629);
|
||||
AddItem(240, 70, 0x162A);
|
||||
AddButton(220, 50, 0x845, 0x846, 9);
|
||||
AddItem(250, 70, 0x1592);
|
||||
AddItem(270, 90, 0x1593);
|
||||
AddItem(290, 110, 0x158F);
|
||||
AddButton(300, 50, 0x845, 0x846, 10);
|
||||
AddItem(340, 110, 0x162B);
|
||||
AddItem(363, 90, 0x162C);
|
||||
AddItem(385, 70, 0x162D);
|
||||
AddButton(365, 50, 0x845, 0x846, 11);
|
||||
AddItem(395, 70, 0x1594);
|
||||
AddItem(417, 90, 0x1595);
|
||||
AddItem(439, 111, 0x1596);
|
||||
AddButton(445, 50, 0x845, 0x846, 12);
|
||||
AddButton(70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 1);
|
||||
AddButton(455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 3);
|
||||
builder.AddItem(52, 110, 0x1626);
|
||||
builder.AddItem(72, 90, 0x1627);
|
||||
builder.AddItem(95, 70, 0x1628);
|
||||
builder.AddButton(70, 50, 0x845, 0x846, 7);
|
||||
builder.AddItem(105, 70, 0x1590);
|
||||
builder.AddItem(125, 90, 0x1591);
|
||||
builder.AddItem(145, 110, 0x158F);
|
||||
builder.AddButton(145, 50, 0x845, 0x846, 8);
|
||||
builder.AddItem(197, 110, 0x1626);
|
||||
builder.AddItem(217, 90, 0x1629);
|
||||
builder.AddItem(240, 70, 0x162A);
|
||||
builder.AddButton(220, 50, 0x845, 0x846, 9);
|
||||
builder.AddItem(250, 70, 0x1592);
|
||||
builder.AddItem(270, 90, 0x1593);
|
||||
builder.AddItem(290, 110, 0x158F);
|
||||
builder.AddButton(300, 50, 0x845, 0x846, 10);
|
||||
builder.AddItem(340, 110, 0x162B);
|
||||
builder.AddItem(363, 90, 0x162C);
|
||||
builder.AddItem(385, 70, 0x162D);
|
||||
builder.AddButton(365, 50, 0x845, 0x846, 11);
|
||||
builder.AddItem(395, 70, 0x1594);
|
||||
builder.AddItem(417, 90, 0x1595);
|
||||
builder.AddItem(439, 111, 0x1596);
|
||||
builder.AddButton(445, 50, 0x845, 0x846, 12);
|
||||
builder.AddButton(70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 1);
|
||||
builder.AddButton(455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 3);
|
||||
|
||||
AddPage(3);
|
||||
builder.AddPage(3);
|
||||
|
||||
AddItem(55, 110, 0x162E);
|
||||
AddItem(75, 93, 0x1631);
|
||||
AddItem(95, 70, 0x1632);
|
||||
AddButton(70, 50, 0x845, 0x846, 13);
|
||||
AddItem(118, 70, 0x1598);
|
||||
AddItem(138, 94, 0x159B);
|
||||
AddItem(159, 113, 0x159C);
|
||||
AddButton(160, 50, 0x845, 0x846, 14);
|
||||
AddItem(219, 111, 0x162F);
|
||||
AddItem(238, 94, 0x1630);
|
||||
AddItem(258, 70, 0x1633);
|
||||
AddButton(240, 50, 0x845, 0x846, 15);
|
||||
AddItem(279, 70, 0x1599);
|
||||
AddItem(298, 93, 0x159A);
|
||||
AddItem(319, 113, 0x159D);
|
||||
AddButton(320, 50, 0x845, 0x846, 16);
|
||||
AddItem(380, 90, 0x160F);
|
||||
AddItem(400, 70, 0x1610);
|
||||
AddButton(390, 50, 0x845, 0x846, 17);
|
||||
AddItem(420, 70, 0x15A0);
|
||||
AddItem(440, 90, 0x15A1);
|
||||
AddButton(455, 50, 0x845, 0x846, 18);
|
||||
AddButton(70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 2);
|
||||
AddButton(455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 4);
|
||||
builder.AddItem(55, 110, 0x162E);
|
||||
builder.AddItem(75, 93, 0x1631);
|
||||
builder.AddItem(95, 70, 0x1632);
|
||||
builder.AddButton(70, 50, 0x845, 0x846, 13);
|
||||
builder.AddItem(118, 70, 0x1598);
|
||||
builder.AddItem(138, 94, 0x159B);
|
||||
builder.AddItem(159, 113, 0x159C);
|
||||
builder.AddButton(160, 50, 0x845, 0x846, 14);
|
||||
builder.AddItem(219, 111, 0x162F);
|
||||
builder.AddItem(238, 94, 0x1630);
|
||||
builder.AddItem(258, 70, 0x1633);
|
||||
builder.AddButton(240, 50, 0x845, 0x846, 15);
|
||||
builder.AddItem(279, 70, 0x1599);
|
||||
builder.AddItem(298, 93, 0x159A);
|
||||
builder.AddItem(319, 113, 0x159D);
|
||||
builder.AddButton(320, 50, 0x845, 0x846, 16);
|
||||
builder.AddItem(380, 90, 0x160F);
|
||||
builder.AddItem(400, 70, 0x1610);
|
||||
builder.AddButton(390, 50, 0x845, 0x846, 17);
|
||||
builder.AddItem(420, 70, 0x15A0);
|
||||
builder.AddItem(440, 90, 0x15A1);
|
||||
builder.AddButton(455, 50, 0x845, 0x846, 18);
|
||||
builder.AddButton(70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 2);
|
||||
builder.AddButton(455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 4);
|
||||
|
||||
AddPage(4);
|
||||
builder.AddPage(4);
|
||||
|
||||
AddItem(55, 90, 0x1611);
|
||||
AddItem(75, 70, 0x1612);
|
||||
AddButton(70, 50, 0x845, 0x846, 19);
|
||||
AddItem(105, 70, 0x15A2);
|
||||
AddItem(125, 90, 0x15A3);
|
||||
AddButton(145, 50, 0x845, 0x846, 20);
|
||||
AddItem(200, 84, 0x1613);
|
||||
AddItem(220, 70, 0x1614);
|
||||
AddButton(215, 50, 0x845, 0x846, 21);
|
||||
AddItem(250, 70, 0x15A4);
|
||||
AddItem(270, 84, 0x15A5);
|
||||
AddButton(290, 50, 0x845, 0x846, 22);
|
||||
AddItem(350, 90, 0x1615);
|
||||
AddItem(370, 70, 0x1616);
|
||||
AddButton(365, 50, 0x845, 0x846, 23);
|
||||
AddItem(400, 70, 0x15A6);
|
||||
AddItem(420, 90, 0x15A7);
|
||||
AddButton(445, 50, 0x845, 0x846, 24);
|
||||
AddButton(70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 3);
|
||||
AddButton(455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 5);
|
||||
builder.AddItem(55, 90, 0x1611);
|
||||
builder.AddItem(75, 70, 0x1612);
|
||||
builder.AddButton(70, 50, 0x845, 0x846, 19);
|
||||
builder.AddItem(105, 70, 0x15A2);
|
||||
builder.AddItem(125, 90, 0x15A3);
|
||||
builder.AddButton(145, 50, 0x845, 0x846, 20);
|
||||
builder.AddItem(200, 84, 0x1613);
|
||||
builder.AddItem(220, 70, 0x1614);
|
||||
builder.AddButton(215, 50, 0x845, 0x846, 21);
|
||||
builder.AddItem(250, 70, 0x15A4);
|
||||
builder.AddItem(270, 84, 0x15A5);
|
||||
builder.AddButton(290, 50, 0x845, 0x846, 22);
|
||||
builder.AddItem(350, 90, 0x1615);
|
||||
builder.AddItem(370, 70, 0x1616);
|
||||
builder.AddButton(365, 50, 0x845, 0x846, 23);
|
||||
builder.AddItem(400, 70, 0x15A6);
|
||||
builder.AddItem(420, 90, 0x15A7);
|
||||
builder.AddButton(445, 50, 0x845, 0x846, 24);
|
||||
builder.AddButton(70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 3);
|
||||
builder.AddButton(455, 205, 0x8B0, 0x8B0, 0, GumpButtonType.Page, 5);
|
||||
|
||||
AddPage(5);
|
||||
builder.AddPage(5);
|
||||
|
||||
AddItem(55, 90, 0x1617);
|
||||
AddItem(77, 70, 0x1618);
|
||||
AddButton(70, 50, 0x845, 0x846, 25);
|
||||
AddItem(105, 70, 0x15A8);
|
||||
AddItem(127, 90, 0x15A9);
|
||||
AddButton(145, 50, 0x845, 0x846, 26);
|
||||
AddItem(200, 90, 0x1619);
|
||||
AddItem(222, 70, 0x161A);
|
||||
AddButton(220, 50, 0x845, 0x846, 27);
|
||||
AddItem(250, 70, 0x15AA);
|
||||
AddItem(272, 90, 0x15AB);
|
||||
AddButton(300, 50, 0x845, 0x846, 28);
|
||||
AddItem(350, 90, 0x161B);
|
||||
AddItem(372, 70, 0x161C);
|
||||
AddButton(365, 50, 0x845, 0x846, 29);
|
||||
AddItem(400, 70, 0x15AC);
|
||||
AddItem(422, 90, 0x15AD);
|
||||
AddButton(445, 50, 0x845, 0x846, 30);
|
||||
AddButton(70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 4);
|
||||
builder.AddItem(55, 90, 0x1617);
|
||||
builder.AddItem(77, 70, 0x1618);
|
||||
builder.AddButton(70, 50, 0x845, 0x846, 25);
|
||||
builder.AddItem(105, 70, 0x15A8);
|
||||
builder.AddItem(127, 90, 0x15A9);
|
||||
builder.AddButton(145, 50, 0x845, 0x846, 26);
|
||||
builder.AddItem(200, 90, 0x1619);
|
||||
builder.AddItem(222, 70, 0x161A);
|
||||
builder.AddButton(220, 50, 0x845, 0x846, 27);
|
||||
builder.AddItem(250, 70, 0x15AA);
|
||||
builder.AddItem(272, 90, 0x15AB);
|
||||
builder.AddButton(300, 50, 0x845, 0x846, 28);
|
||||
builder.AddItem(350, 90, 0x161B);
|
||||
builder.AddItem(372, 70, 0x161C);
|
||||
builder.AddButton(365, 50, 0x845, 0x846, 29);
|
||||
builder.AddItem(400, 70, 0x15AC);
|
||||
builder.AddItem(422, 90, 0x15AD);
|
||||
builder.AddButton(445, 50, 0x845, 0x846, 30);
|
||||
builder.AddButton(70, 205, 0x8AF, 0x8AF, 0, GumpButtonType.Page, 4);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ public partial class WeaponEngravingTool : Item, IUsesRemaining, IRewardItem
|
|||
}
|
||||
|
||||
from.SendLocalizedMessage(1076163); // There are no charges left on this engraving tool.
|
||||
from.SendGump(new ConfirmGump(this, null));
|
||||
WeaponEngravingToolConfirmGump.DisplayTo(from, this, null);
|
||||
}
|
||||
|
||||
public override void GetProperties(IPropertyList list)
|
||||
|
|
@ -174,7 +174,7 @@ public partial class WeaponEngravingTool : Item, IUsesRemaining, IRewardItem
|
|||
|
||||
if (targeted is BaseWeapon item)
|
||||
{
|
||||
from.SendGump(new InternalGump(_tool, item));
|
||||
WeaponEngravingToolGump.DisplayTo(from, _tool, item);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -183,39 +183,47 @@ public partial class WeaponEngravingTool : Item, IUsesRemaining, IRewardItem
|
|||
}
|
||||
}
|
||||
|
||||
private class InternalGump : Gump
|
||||
private class WeaponEngravingToolGump : StaticGump<WeaponEngravingToolGump>
|
||||
{
|
||||
private readonly BaseWeapon _target;
|
||||
private readonly WeaponEngravingTool _tool;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public InternalGump(WeaponEngravingTool tool, BaseWeapon target) : base(0, 0)
|
||||
private WeaponEngravingToolGump(WeaponEngravingTool tool, BaseWeapon target) : base(0, 0)
|
||||
{
|
||||
_tool = tool;
|
||||
_target = target;
|
||||
}
|
||||
|
||||
Closable = true;
|
||||
Disposable = true;
|
||||
Draggable = true;
|
||||
Resizable = false;
|
||||
public static void DisplayTo(Mobile from, WeaponEngravingTool tool, BaseWeapon target)
|
||||
{
|
||||
if (from?.NetState == null || tool?.Deleted != false || target?.Deleted != false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AddBackground(50, 50, 400, 300, 0xA28);
|
||||
from.SendGump(new WeaponEngravingToolGump(tool, target));
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
protected override void BuildLayout(ref StaticGumpBuilder builder)
|
||||
{
|
||||
builder.AddPage();
|
||||
|
||||
AddHtmlLocalized(50, 70, 400, 20, 1072359, 0x0); // <CENTER>Engraving Tool</CENTER>
|
||||
builder.AddBackground(50, 50, 400, 300, 0xA28);
|
||||
|
||||
builder.AddHtmlLocalized(50, 70, 400, 20, 1072359, 0x0); // <CENTER>Engraving Tool</CENTER>
|
||||
// Please enter the text to add to the selected object. Leave the text area blank to remove any existing text. Removing text does not use a charge.
|
||||
AddHtmlLocalized(75, 95, 350, 145, 1076229, 0x0, true, true);
|
||||
AddButton(125, 300, 0x81A, 0x81B, (int)Buttons.Okay);
|
||||
AddButton(320, 300, 0x819, 0x818, (int)Buttons.Cancel);
|
||||
AddImageTiled(75, 245, 350, 40, 0xDB0);
|
||||
AddImageTiled(76, 245, 350, 2, 0x23C5);
|
||||
AddImageTiled(75, 245, 2, 40, 0x23C3);
|
||||
AddImageTiled(75, 285, 350, 2, 0x23C5);
|
||||
AddImageTiled(425, 245, 2, 42, 0x23C3);
|
||||
builder.AddHtmlLocalized(75, 95, 350, 145, 1076229, 0x0, true, true);
|
||||
builder.AddButton(125, 300, 0x81A, 0x81B, (int)Buttons.Okay);
|
||||
builder.AddButton(320, 300, 0x819, 0x818, (int)Buttons.Cancel);
|
||||
builder.AddImageTiled(75, 245, 350, 40, 0xDB0);
|
||||
builder.AddImageTiled(76, 245, 350, 2, 0x23C5);
|
||||
builder.AddImageTiled(75, 245, 2, 40, 0x23C3);
|
||||
builder.AddImageTiled(75, 285, 350, 2, 0x23C5);
|
||||
builder.AddImageTiled(425, 245, 2, 42, 0x23C3);
|
||||
|
||||
AddTextEntry(75, 245, 350, 40, 0x0, (int)Buttons.Text, "");
|
||||
builder.AddTextEntry(75, 245, 350, 40, 0x0, (int)Buttons.Text, "");
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, in RelayInfo info)
|
||||
|
|
@ -262,42 +270,54 @@ public partial class WeaponEngravingTool : Item, IUsesRemaining, IRewardItem
|
|||
}
|
||||
}
|
||||
|
||||
public class ConfirmGump : Gump
|
||||
public class WeaponEngravingToolConfirmGump : DynamicGump
|
||||
{
|
||||
private readonly WeaponEngravingTool _engraver;
|
||||
private readonly Mobile _guildmaster;
|
||||
|
||||
public ConfirmGump(WeaponEngravingTool engraver, Mobile guildmaster) : base(200, 200)
|
||||
public override bool Singleton => true;
|
||||
|
||||
private WeaponEngravingToolConfirmGump(WeaponEngravingTool engraver, Mobile guildmaster) : base(200, 200)
|
||||
{
|
||||
_engraver = engraver;
|
||||
_guildmaster = guildmaster;
|
||||
}
|
||||
|
||||
Closable = false;
|
||||
Disposable = true;
|
||||
Draggable = true;
|
||||
Resizable = false;
|
||||
public static void DisplayTo(Mobile from, WeaponEngravingTool engraver, Mobile guildmaster)
|
||||
{
|
||||
if (from?.NetState == null || engraver?.Deleted != false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
AddPage(0);
|
||||
from.SendGump(new WeaponEngravingToolConfirmGump(engraver, guildmaster));
|
||||
}
|
||||
|
||||
AddBackground(0, 0, 291, 133, 0x13BE);
|
||||
AddImageTiled(5, 5, 280, 100, 0xA40);
|
||||
protected override void BuildLayout(ref DynamicGumpBuilder builder)
|
||||
{
|
||||
builder.SetNoClose();
|
||||
|
||||
if (guildmaster != null)
|
||||
builder.AddPage();
|
||||
|
||||
builder.AddBackground(0, 0, 291, 133, 0x13BE);
|
||||
builder.AddImageTiled(5, 5, 280, 100, 0xA40);
|
||||
|
||||
if (_guildmaster != null)
|
||||
{
|
||||
// It will cost you 100,000 gold and a blue diamond to recharge your weapon engraver with 10 charges.
|
||||
AddHtmlLocalized(9, 9, 272, 100, 1076169, 0x7FFF);
|
||||
AddHtmlLocalized(195, 109, 120, 20, 1076172, 0x7FFF); // Recharge it
|
||||
builder.AddHtmlLocalized(9, 9, 272, 100, 1076169, 0x7FFF);
|
||||
builder.AddHtmlLocalized(195, 109, 120, 20, 1076172, 0x7FFF); // Recharge it
|
||||
}
|
||||
else
|
||||
{
|
||||
// You will need a blue diamond to repair the tip of the engraver. A successful repair will give the engraver 10 charges.
|
||||
AddHtmlLocalized(9, 9, 272, 100, 1076176, 0x7FFF);
|
||||
AddHtmlLocalized(195, 109, 120, 20, 1076177, 0x7FFF); // Replace the tip.
|
||||
builder.AddHtmlLocalized(9, 9, 272, 100, 1076176, 0x7FFF);
|
||||
builder.AddHtmlLocalized(195, 109, 120, 20, 1076177, 0x7FFF); // Replace the tip.
|
||||
}
|
||||
|
||||
AddButton(160, 107, 0xFB7, 0xFB8, (int)Buttons.Confirm);
|
||||
AddButton(5, 107, 0xFB1, 0xFB2, (int)Buttons.Cancel);
|
||||
AddHtmlLocalized(40, 109, 100, 20, 1060051, 0x7FFF); // CANCEL
|
||||
builder.AddButton(160, 107, 0xFB7, 0xFB8, (int)Buttons.Confirm);
|
||||
builder.AddButton(5, 107, 0xFB1, 0xFB2, (int)Buttons.Cancel);
|
||||
builder.AddHtmlLocalized(40, 109, 100, 20, 1060051, 0x7FFF); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState state, in RelayInfo info)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue