fix: Migrate BOD gumps to DynamicGump (#1926)
This commit is contained in:
parent
16d7961dc9
commit
b612c443df
7 changed files with 166 additions and 166 deletions
|
|
@ -78,7 +78,7 @@ namespace Server.Engines.BulkOrders
|
|||
{
|
||||
if (IsChildOf(from.Backpack) || InSecureTrade || RootParent is PlayerVendor)
|
||||
{
|
||||
from.SendGump(new LargeBODGump(from, this));
|
||||
from.SendGump(new LargeBODGump(this));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -143,7 +143,7 @@ namespace Server.Engines.BulkOrders
|
|||
small.Delete();
|
||||
|
||||
from.SendLocalizedMessage(1045165); // The orders have been combined.
|
||||
from.SendGump(new LargeBODGump(from, this));
|
||||
from.SendGump(new LargeBODGump(this));
|
||||
|
||||
if (!Complete)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,109 +3,109 @@ using Server.Network;
|
|||
|
||||
namespace Server.Engines.BulkOrders
|
||||
{
|
||||
public class LargeBODAcceptGump : Gump
|
||||
public class LargeBODAcceptGump : DynamicGump
|
||||
{
|
||||
private readonly LargeBOD m_Deed;
|
||||
private readonly Mobile m_From;
|
||||
private readonly LargeBOD _deed;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public LargeBODAcceptGump(Mobile from, LargeBOD deed) : base(50, 50)
|
||||
public LargeBODAcceptGump(LargeBOD deed) : base(50, 50) => _deed = deed;
|
||||
|
||||
protected override void BuildLayout(ref DynamicGumpBuilder builder)
|
||||
{
|
||||
m_From = from;
|
||||
m_Deed = deed;
|
||||
var entries = _deed.Entries;
|
||||
|
||||
var entries = deed.Entries;
|
||||
builder.AddPage();
|
||||
|
||||
AddPage(0);
|
||||
builder.AddBackground(25, 10, 430, 240 + entries.Length * 24, 5054);
|
||||
|
||||
AddBackground(25, 10, 430, 240 + entries.Length * 24, 5054);
|
||||
builder.AddImageTiled(33, 20, 413, 221 + entries.Length * 24, 2624);
|
||||
builder.AddAlphaRegion(33, 20, 413, 221 + entries.Length * 24);
|
||||
|
||||
AddImageTiled(33, 20, 413, 221 + entries.Length * 24, 2624);
|
||||
AddAlphaRegion(33, 20, 413, 221 + entries.Length * 24);
|
||||
builder.AddImage(20, 5, 10460);
|
||||
builder.AddImage(430, 5, 10460);
|
||||
builder.AddImage(20, 225 + entries.Length * 24, 10460);
|
||||
builder.AddImage(430, 225 + entries.Length * 24, 10460);
|
||||
|
||||
AddImage(20, 5, 10460);
|
||||
AddImage(430, 5, 10460);
|
||||
AddImage(20, 225 + entries.Length * 24, 10460);
|
||||
AddImage(430, 225 + entries.Length * 24, 10460);
|
||||
builder.AddHtmlLocalized(180, 25, 120, 20, 1045134, 0x7FFF); // A large bulk order
|
||||
|
||||
AddHtmlLocalized(180, 25, 120, 20, 1045134, 0x7FFF); // A large bulk order
|
||||
builder.AddHtmlLocalized(40, 48, 350, 20, 1045135, 0x7FFF); // Ah! Thanks for the goods! Would you help me out?
|
||||
|
||||
AddHtmlLocalized(40, 48, 350, 20, 1045135, 0x7FFF); // Ah! Thanks for the goods! Would you help me out?
|
||||
builder.AddHtmlLocalized(40, 72, 210, 20, 1045138, 0x7FFF); // Amount to make:
|
||||
builder.AddLabel(250, 72, 1152, _deed.AmountMax.ToString());
|
||||
|
||||
AddHtmlLocalized(40, 72, 210, 20, 1045138, 0x7FFF); // Amount to make:
|
||||
AddLabel(250, 72, 1152, deed.AmountMax.ToString());
|
||||
|
||||
AddHtmlLocalized(40, 96, 120, 20, 1045137, 0x7FFF); // Items requested:
|
||||
builder.AddHtmlLocalized(40, 96, 120, 20, 1045137, 0x7FFF); // Items requested:
|
||||
|
||||
var y = 120;
|
||||
|
||||
for (var i = 0; i < entries.Length; ++i, y += 24)
|
||||
{
|
||||
AddHtmlLocalized(40, y, 210, 20, entries[i].Details.Number, 0x7FFF);
|
||||
builder.AddHtmlLocalized(40, y, 210, 20, entries[i].Details.Number, 0x7FFF);
|
||||
}
|
||||
|
||||
if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
|
||||
if (_deed.RequireExceptional || _deed.Material != BulkMaterialType.None)
|
||||
{
|
||||
AddHtmlLocalized(40, y, 210, 20, 1045140, 0x7FFF); // Special requirements to meet:
|
||||
builder.AddHtmlLocalized(40, y, 210, 20, 1045140, 0x7FFF); // Special requirements to meet:
|
||||
y += 24;
|
||||
|
||||
if (deed.RequireExceptional)
|
||||
if (_deed.RequireExceptional)
|
||||
{
|
||||
AddHtmlLocalized(40, y, 350, 20, 1045141, 0x7FFF); // All items must be exceptional.
|
||||
builder.AddHtmlLocalized(40, y, 350, 20, 1045141, 0x7FFF); // All items must be exceptional.
|
||||
y += 24;
|
||||
}
|
||||
|
||||
if (deed.Material != BulkMaterialType.None)
|
||||
if (_deed.Material != BulkMaterialType.None)
|
||||
{
|
||||
AddHtmlLocalized(
|
||||
builder.AddHtmlLocalized(
|
||||
40,
|
||||
y,
|
||||
350,
|
||||
20,
|
||||
GetMaterialNumberFor(deed.Material), // All items must be made with x material.
|
||||
GetMaterialNumberFor(_deed.Material), // All items must be made with x material.
|
||||
0x7FFF
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// Do you want to accept this order?
|
||||
AddHtmlLocalized(40, 192 + entries.Length * 24, 350, 20, 1045139, 0x7FFF);
|
||||
builder.AddHtmlLocalized(40, 192 + entries.Length * 24, 350, 20, 1045139, 0x7FFF);
|
||||
|
||||
// Ok
|
||||
AddButton(100, 216 + entries.Length * 24, 4005, 4007, 1);
|
||||
AddHtmlLocalized(135, 216 + entries.Length * 24, 120, 20, 1006044, 0x7FFF);
|
||||
builder.AddButton(100, 216 + entries.Length * 24, 4005, 4007, 1);
|
||||
builder.AddHtmlLocalized(135, 216 + entries.Length * 24, 120, 20, 1006044, 0x7FFF);
|
||||
|
||||
// CANCEL
|
||||
AddButton(275, 216 + entries.Length * 24, 4005, 4007, 0);
|
||||
AddHtmlLocalized(310, 216 + entries.Length * 24, 120, 20, 1011012, 0x7FFF);
|
||||
builder.AddButton(275, 216 + entries.Length * 24, 4005, 4007, 0);
|
||||
builder.AddHtmlLocalized(310, 216 + entries.Length * 24, 120, 20, 1011012, 0x7FFF);
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (info.ButtonID == 1) // Ok
|
||||
{
|
||||
if (m_From.PlaceInBackpack(m_Deed))
|
||||
if (from.PlaceInBackpack(_deed))
|
||||
{
|
||||
m_From.SendLocalizedMessage(1045152); // The bulk order deed has been placed in your backpack.
|
||||
from.SendLocalizedMessage(1045152); // The bulk order deed has been placed in your backpack.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendLocalizedMessage(1045150); // There is not enough room in your backpack for the deed.
|
||||
m_Deed.Delete();
|
||||
from.SendLocalizedMessage(1045150); // There is not enough room in your backpack for the deed.
|
||||
_deed.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Deed.Delete();
|
||||
_deed.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnServerClose(NetState owner)
|
||||
{
|
||||
if (m_Deed?.Deleted == false)
|
||||
if (_deed?.Deleted == false)
|
||||
{
|
||||
m_Deed.Delete();
|
||||
_deed.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,39 +3,37 @@ using Server.Network;
|
|||
|
||||
namespace Server.Engines.BulkOrders
|
||||
{
|
||||
public class LargeBODGump : Gump
|
||||
public class LargeBODGump : DynamicGump
|
||||
{
|
||||
private readonly LargeBOD m_Deed;
|
||||
private readonly Mobile m_From;
|
||||
private readonly LargeBOD _deed;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public LargeBODGump(Mobile from, LargeBOD deed) : base(25, 25)
|
||||
public LargeBODGump(LargeBOD deed) : base(25, 25) => _deed = deed;
|
||||
|
||||
protected override void BuildLayout(ref DynamicGumpBuilder builder)
|
||||
{
|
||||
m_From = from;
|
||||
m_Deed = deed;
|
||||
var entries = _deed.Entries;
|
||||
|
||||
var entries = deed.Entries;
|
||||
builder.AddPage();
|
||||
|
||||
AddPage(0);
|
||||
builder.AddBackground(50, 10, 455, 236 + entries.Length * 24, 5054);
|
||||
|
||||
AddBackground(50, 10, 455, 236 + entries.Length * 24, 5054);
|
||||
builder.AddImageTiled(58, 20, 438, 217 + entries.Length * 24, 2624);
|
||||
builder.AddAlphaRegion(58, 20, 438, 217 + entries.Length * 24);
|
||||
|
||||
AddImageTiled(58, 20, 438, 217 + entries.Length * 24, 2624);
|
||||
AddAlphaRegion(58, 20, 438, 217 + entries.Length * 24);
|
||||
builder.AddImage(45, 5, 10460);
|
||||
builder.AddImage(480, 5, 10460);
|
||||
builder.AddImage(45, 221 + entries.Length * 24, 10460);
|
||||
builder.AddImage(480, 221 + entries.Length * 24, 10460);
|
||||
|
||||
AddImage(45, 5, 10460);
|
||||
AddImage(480, 5, 10460);
|
||||
AddImage(45, 221 + entries.Length * 24, 10460);
|
||||
AddImage(480, 221 + entries.Length * 24, 10460);
|
||||
builder.AddHtmlLocalized(225, 25, 120, 20, 1045134, 0x7FFF); // A large bulk order
|
||||
|
||||
AddHtmlLocalized(225, 25, 120, 20, 1045134, 0x7FFF); // A large bulk order
|
||||
builder.AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF); // Amount to make:
|
||||
builder.AddLabel(275, 48, 1152, _deed.AmountMax.ToString());
|
||||
|
||||
AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF); // Amount to make:
|
||||
AddLabel(275, 48, 1152, deed.AmountMax.ToString());
|
||||
|
||||
AddHtmlLocalized(75, 72, 120, 20, 1045137, 0x7FFF); // Items requested:
|
||||
AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF); // Amount finished:
|
||||
builder.AddHtmlLocalized(75, 72, 120, 20, 1045137, 0x7FFF); // Items requested:
|
||||
builder.AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF); // Amount finished:
|
||||
|
||||
var y = 96;
|
||||
|
||||
|
|
@ -44,39 +42,39 @@ namespace Server.Engines.BulkOrders
|
|||
var entry = entries[i];
|
||||
var details = entry.Details;
|
||||
|
||||
AddHtmlLocalized(75, y, 210, 20, details.Number, 0x7FFF);
|
||||
AddLabel(275, y, 0x480, entry.Amount.ToString());
|
||||
builder.AddHtmlLocalized(75, y, 210, 20, details.Number, 0x7FFF);
|
||||
builder.AddLabel(275, y, 0x480, entry.Amount.ToString());
|
||||
|
||||
y += 24;
|
||||
}
|
||||
|
||||
if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
|
||||
if (_deed.RequireExceptional || _deed.Material != BulkMaterialType.None)
|
||||
{
|
||||
AddHtmlLocalized(75, y, 200, 20, 1045140, 0x7FFF); // Special requirements to meet:
|
||||
builder.AddHtmlLocalized(75, y, 200, 20, 1045140, 0x7FFF); // Special requirements to meet:
|
||||
y += 24;
|
||||
}
|
||||
|
||||
if (deed.RequireExceptional)
|
||||
if (_deed.RequireExceptional)
|
||||
{
|
||||
AddHtmlLocalized(75, y, 300, 20, 1045141, 0x7FFF); // All items must be exceptional.
|
||||
builder.AddHtmlLocalized(75, y, 300, 20, 1045141, 0x7FFF); // All items must be exceptional.
|
||||
y += 24;
|
||||
}
|
||||
|
||||
if (deed.Material != BulkMaterialType.None)
|
||||
if (_deed.Material != BulkMaterialType.None)
|
||||
{
|
||||
AddHtmlLocalized(
|
||||
builder.AddHtmlLocalized(
|
||||
75,
|
||||
y,
|
||||
300,
|
||||
20,
|
||||
GetMaterialNumberFor(deed.Material), // All items must be made with x material.
|
||||
GetMaterialNumberFor(_deed.Material), // All items must be made with x material.
|
||||
0x7FFF
|
||||
);
|
||||
}
|
||||
|
||||
AddButton(125, 168 + entries.Length * 24, 4005, 4007, 2);
|
||||
builder.AddButton(125, 168 + entries.Length * 24, 4005, 4007, 2);
|
||||
|
||||
AddHtmlLocalized(
|
||||
builder.AddHtmlLocalized(
|
||||
160,
|
||||
168 + entries.Length * 24,
|
||||
300,
|
||||
|
|
@ -85,21 +83,23 @@ namespace Server.Engines.BulkOrders
|
|||
0x7FFF
|
||||
);
|
||||
|
||||
AddButton(125, 192 + entries.Length * 24, 4005, 4007, 1);
|
||||
AddHtmlLocalized(160, 192 + entries.Length * 24, 120, 20, 1011441, 0x7FFF); // EXIT
|
||||
builder.AddButton(125, 192 + entries.Length * 24, 4005, 4007, 1);
|
||||
builder.AddHtmlLocalized(160, 192 + entries.Length * 24, 120, 20, 1011441, 0x7FFF); // EXIT
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||
{
|
||||
if (m_Deed.Deleted || !m_Deed.IsChildOf(m_From.Backpack))
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (_deed.Deleted || !_deed.IsChildOf(from.Backpack))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.ButtonID == 2) // Combine
|
||||
{
|
||||
m_From.SendGump(new LargeBODGump(m_From, m_Deed));
|
||||
m_Deed.BeginCombine(m_From);
|
||||
sender.SendGump(new LargeBODGump(_deed));
|
||||
_deed.BeginCombine(from);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ namespace Server.Engines.BulkOrders
|
|||
{
|
||||
if (IsChildOf(from.Backpack) || InSecureTrade || RootParent is PlayerVendor)
|
||||
{
|
||||
from.SendGump(new SmallBODGump(from, this));
|
||||
from.SendGump(new SmallBODGump(this));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -181,7 +181,7 @@ namespace Server.Engines.BulkOrders
|
|||
++AmountCur;
|
||||
|
||||
from.SendLocalizedMessage(1045170); // The item has been combined with the deed.
|
||||
from.SendGump(new SmallBODGump(from, this));
|
||||
from.SendGump(new SmallBODGump(this));
|
||||
|
||||
if (m_AmountCur < AmountMax)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -3,96 +3,96 @@ using Server.Network;
|
|||
|
||||
namespace Server.Engines.BulkOrders
|
||||
{
|
||||
public class SmallBODAcceptGump : Gump
|
||||
public class SmallBODAcceptGump : DynamicGump
|
||||
{
|
||||
private readonly SmallBOD m_Deed;
|
||||
private readonly Mobile m_From;
|
||||
private readonly SmallBOD _deed;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public SmallBODAcceptGump(Mobile from, SmallBOD deed) : base(50, 50)
|
||||
public SmallBODAcceptGump(SmallBOD deed) : base(50, 50) => _deed = deed;
|
||||
|
||||
protected override void BuildLayout(ref DynamicGumpBuilder builder)
|
||||
{
|
||||
m_From = from;
|
||||
m_Deed = deed;
|
||||
builder.AddPage();
|
||||
|
||||
AddPage(0);
|
||||
builder.AddBackground(25, 10, 430, 264, 5054);
|
||||
|
||||
AddBackground(25, 10, 430, 264, 5054);
|
||||
builder.AddImageTiled(33, 20, 413, 245, 2624);
|
||||
builder.AddAlphaRegion(33, 20, 413, 245);
|
||||
|
||||
AddImageTiled(33, 20, 413, 245, 2624);
|
||||
AddAlphaRegion(33, 20, 413, 245);
|
||||
builder.AddImage(20, 5, 10460);
|
||||
builder.AddImage(430, 5, 10460);
|
||||
builder.AddImage(20, 249, 10460);
|
||||
builder.AddImage(430, 249, 10460);
|
||||
|
||||
AddImage(20, 5, 10460);
|
||||
AddImage(430, 5, 10460);
|
||||
AddImage(20, 249, 10460);
|
||||
AddImage(430, 249, 10460);
|
||||
builder.AddHtmlLocalized(190, 25, 120, 20, 1045133, 0x7FFF); // A bulk order
|
||||
builder.AddHtmlLocalized(40, 48, 350, 20, 1045135, 0x7FFF); // Ah! Thanks for the goods! Would you help me out?
|
||||
|
||||
AddHtmlLocalized(190, 25, 120, 20, 1045133, 0x7FFF); // A bulk order
|
||||
AddHtmlLocalized(40, 48, 350, 20, 1045135, 0x7FFF); // Ah! Thanks for the goods! Would you help me out?
|
||||
builder.AddHtmlLocalized(40, 72, 210, 20, 1045138, 0x7FFF); // Amount to make:
|
||||
builder.AddLabel(250, 72, 1152, _deed.AmountMax.ToString());
|
||||
|
||||
AddHtmlLocalized(40, 72, 210, 20, 1045138, 0x7FFF); // Amount to make:
|
||||
AddLabel(250, 72, 1152, deed.AmountMax.ToString());
|
||||
builder.AddHtmlLocalized(40, 96, 120, 20, 1045136, 0x7FFF); // Item requested:
|
||||
builder.AddItem(385, 96, _deed.Graphic);
|
||||
builder.AddHtmlLocalized(40, 120, 210, 20, _deed.Number, 0x7FFF);
|
||||
|
||||
AddHtmlLocalized(40, 96, 120, 20, 1045136, 0x7FFF); // Item requested:
|
||||
AddItem(385, 96, deed.Graphic);
|
||||
AddHtmlLocalized(40, 120, 210, 20, deed.Number, 0x7FFF);
|
||||
|
||||
if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
|
||||
if (_deed.RequireExceptional || _deed.Material != BulkMaterialType.None)
|
||||
{
|
||||
AddHtmlLocalized(40, 144, 210, 20, 1045140, 0x7FFF); // Special requirements to meet:
|
||||
builder.AddHtmlLocalized(40, 144, 210, 20, 1045140, 0x7FFF); // Special requirements to meet:
|
||||
|
||||
if (deed.RequireExceptional)
|
||||
if (_deed.RequireExceptional)
|
||||
{
|
||||
AddHtmlLocalized(40, 168, 350, 20, 1045141, 0x7FFF); // All items must be exceptional.
|
||||
builder.AddHtmlLocalized(40, 168, 350, 20, 1045141, 0x7FFF); // All items must be exceptional.
|
||||
}
|
||||
|
||||
if (deed.Material != BulkMaterialType.None)
|
||||
if (_deed.Material != BulkMaterialType.None)
|
||||
{
|
||||
AddHtmlLocalized(
|
||||
builder.AddHtmlLocalized(
|
||||
40,
|
||||
deed.RequireExceptional ? 192 : 168,
|
||||
_deed.RequireExceptional ? 192 : 168,
|
||||
350,
|
||||
20,
|
||||
GetMaterialNumberFor(deed.Material), // All items must be made with x material.
|
||||
GetMaterialNumberFor(_deed.Material), // All items must be made with x material.
|
||||
0x7FFF
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
AddHtmlLocalized(40, 216, 350, 20, 1045139, 0x7FFF); // Do you want to accept this order?
|
||||
builder.AddHtmlLocalized(40, 216, 350, 20, 1045139, 0x7FFF); // Do you want to accept this order?
|
||||
|
||||
AddButton(100, 240, 4005, 4007, 1);
|
||||
AddHtmlLocalized(135, 240, 120, 20, 1006044, 0x7FFF); // Ok
|
||||
builder.AddButton(100, 240, 4005, 4007, 1);
|
||||
builder.AddHtmlLocalized(135, 240, 120, 20, 1006044, 0x7FFF); // Ok
|
||||
|
||||
AddButton(275, 240, 4005, 4007, 0);
|
||||
AddHtmlLocalized(310, 240, 120, 20, 1011012, 0x7FFF); // CANCEL
|
||||
builder.AddButton(275, 240, 4005, 4007, 0);
|
||||
builder.AddHtmlLocalized(310, 240, 120, 20, 1011012, 0x7FFF); // CANCEL
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||
{
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (info.ButtonID == 1) // Ok
|
||||
{
|
||||
if (m_From.PlaceInBackpack(m_Deed))
|
||||
if (from.PlaceInBackpack(_deed))
|
||||
{
|
||||
m_From.SendLocalizedMessage(1045152); // The bulk order deed has been placed in your backpack.
|
||||
from.SendLocalizedMessage(1045152); // The bulk order deed has been placed in your backpack.
|
||||
}
|
||||
else
|
||||
{
|
||||
m_From.SendLocalizedMessage(1045150); // There is not enough room in your backpack for the deed.
|
||||
m_Deed.Delete();
|
||||
from.SendLocalizedMessage(1045150); // There is not enough room in your backpack for the deed.
|
||||
_deed.Delete();
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m_Deed.Delete();
|
||||
_deed.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnServerClose(NetState owner)
|
||||
{
|
||||
if (m_Deed?.Deleted == false)
|
||||
if (_deed?.Deleted == false)
|
||||
{
|
||||
m_Deed.Delete();
|
||||
_deed.Delete();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,82 +3,82 @@ using Server.Network;
|
|||
|
||||
namespace Server.Engines.BulkOrders
|
||||
{
|
||||
public class SmallBODGump : Gump
|
||||
public class SmallBODGump : DynamicGump
|
||||
{
|
||||
private readonly SmallBOD m_Deed;
|
||||
private readonly Mobile m_From;
|
||||
private readonly SmallBOD _deed;
|
||||
|
||||
public override bool Singleton => true;
|
||||
|
||||
public SmallBODGump(Mobile from, SmallBOD deed) : base(25, 25)
|
||||
public SmallBODGump(SmallBOD deed) : base(25, 25) => _deed = deed;
|
||||
|
||||
protected override void BuildLayout(ref DynamicGumpBuilder builder)
|
||||
{
|
||||
m_From = from;
|
||||
m_Deed = deed;
|
||||
builder.AddPage();
|
||||
|
||||
AddPage(0);
|
||||
builder.AddBackground(50, 10, 455, 260, 5054);
|
||||
builder.AddImageTiled(58, 20, 438, 241, 2624);
|
||||
builder.AddAlphaRegion(58, 20, 438, 241);
|
||||
|
||||
AddBackground(50, 10, 455, 260, 5054);
|
||||
AddImageTiled(58, 20, 438, 241, 2624);
|
||||
AddAlphaRegion(58, 20, 438, 241);
|
||||
builder.AddImage(45, 5, 10460);
|
||||
builder.AddImage(480, 5, 10460);
|
||||
builder.AddImage(45, 245, 10460);
|
||||
builder.AddImage(480, 245, 10460);
|
||||
|
||||
AddImage(45, 5, 10460);
|
||||
AddImage(480, 5, 10460);
|
||||
AddImage(45, 245, 10460);
|
||||
AddImage(480, 245, 10460);
|
||||
builder.AddHtmlLocalized(225, 25, 120, 20, 1045133, 0x7FFF); // A bulk order
|
||||
|
||||
AddHtmlLocalized(225, 25, 120, 20, 1045133, 0x7FFF); // A bulk order
|
||||
builder.AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF); // Amount to make:
|
||||
builder.AddLabel(275, 48, 1152, _deed.AmountMax.ToString());
|
||||
|
||||
AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF); // Amount to make:
|
||||
AddLabel(275, 48, 1152, deed.AmountMax.ToString());
|
||||
builder.AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF); // Amount finished:
|
||||
builder.AddHtmlLocalized(75, 72, 120, 20, 1045136, 0x7FFF); // Item requested:
|
||||
|
||||
AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF); // Amount finished:
|
||||
AddHtmlLocalized(75, 72, 120, 20, 1045136, 0x7FFF); // Item requested:
|
||||
builder.AddItem(410, 72, _deed.Graphic);
|
||||
|
||||
AddItem(410, 72, deed.Graphic);
|
||||
builder.AddHtmlLocalized(75, 96, 210, 20, _deed.Number, 0x7FFF);
|
||||
builder.AddLabel(275, 96, 0x480, _deed.AmountCur.ToString());
|
||||
|
||||
AddHtmlLocalized(75, 96, 210, 20, deed.Number, 0x7FFF);
|
||||
AddLabel(275, 96, 0x480, deed.AmountCur.ToString());
|
||||
|
||||
if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
|
||||
if (_deed.RequireExceptional || _deed.Material != BulkMaterialType.None)
|
||||
{
|
||||
AddHtmlLocalized(75, 120, 200, 20, 1045140, 0x7FFF); // Special requirements to meet:
|
||||
builder.AddHtmlLocalized(75, 120, 200, 20, 1045140, 0x7FFF); // Special requirements to meet:
|
||||
}
|
||||
|
||||
if (deed.RequireExceptional)
|
||||
if (_deed.RequireExceptional)
|
||||
{
|
||||
AddHtmlLocalized(75, 144, 300, 20, 1045141, 0x7FFF); // All items must be exceptional.
|
||||
builder.AddHtmlLocalized(75, 144, 300, 20, 1045141, 0x7FFF); // All items must be exceptional.
|
||||
}
|
||||
|
||||
if (deed.Material != BulkMaterialType.None)
|
||||
if (_deed.Material != BulkMaterialType.None)
|
||||
{
|
||||
AddHtmlLocalized(
|
||||
builder.AddHtmlLocalized(
|
||||
75,
|
||||
deed.RequireExceptional ? 168 : 144,
|
||||
_deed.RequireExceptional ? 168 : 144,
|
||||
300,
|
||||
20,
|
||||
GetMaterialNumberFor(deed.Material), // All items must be made with x material.
|
||||
GetMaterialNumberFor(_deed.Material), // All items must be made with x material.
|
||||
0x7FFF
|
||||
);
|
||||
}
|
||||
|
||||
AddButton(125, 192, 4005, 4007, 2);
|
||||
AddHtmlLocalized(160, 192, 300, 20, 1045154, 0x7FFF); // Combine this deed with the item requested.
|
||||
builder.AddButton(125, 192, 4005, 4007, 2);
|
||||
builder.AddHtmlLocalized(160, 192, 300, 20, 1045154, 0x7FFF); // Combine this deed with the item requested.
|
||||
|
||||
AddButton(125, 216, 4005, 4007, 1);
|
||||
AddHtmlLocalized(160, 216, 120, 20, 1011441, 0x7FFF); // EXIT
|
||||
builder.AddButton(125, 216, 4005, 4007, 1);
|
||||
builder.AddHtmlLocalized(160, 216, 120, 20, 1011441, 0x7FFF); // EXIT
|
||||
}
|
||||
|
||||
public override void OnResponse(NetState sender, in RelayInfo info)
|
||||
{
|
||||
if (m_Deed.Deleted || !m_Deed.IsChildOf(m_From.Backpack))
|
||||
Mobile from = sender.Mobile;
|
||||
|
||||
if (_deed.Deleted || !_deed.IsChildOf(from.Backpack))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (info.ButtonID == 2) // Combine
|
||||
{
|
||||
m_From.SendGump(new SmallBODGump(m_From, m_Deed));
|
||||
m_Deed.BeginCombine(m_From);
|
||||
from.SendGump(new SmallBODGump(_deed));
|
||||
_deed.BeginCombine(from);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -552,11 +552,11 @@ namespace Server.Mobiles
|
|||
|
||||
if (bulkOrder is LargeBOD largeBod)
|
||||
{
|
||||
seller.SendGump(new LargeBODAcceptGump(seller, largeBod));
|
||||
seller.SendGump(new LargeBODAcceptGump(largeBod));
|
||||
}
|
||||
else if (bulkOrder is SmallBOD smallBod)
|
||||
{
|
||||
seller.SendGump(new SmallBODAcceptGump(seller, smallBod));
|
||||
seller.SendGump(new SmallBODAcceptGump(smallBod));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1466,11 +1466,11 @@ namespace Server.Mobiles
|
|||
|
||||
if (bulkOrder is LargeBOD bod)
|
||||
{
|
||||
from.SendGump(new LargeBODAcceptGump(from, bod));
|
||||
from.SendGump(new LargeBODAcceptGump(bod));
|
||||
}
|
||||
else if (bulkOrder is SmallBOD smallBod)
|
||||
{
|
||||
from.SendGump(new SmallBODAcceptGump(from, smallBod));
|
||||
from.SendGump(new SmallBODAcceptGump(smallBod));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue