Clean up: Bugs, LINQ, constructors, default values, and null checks (#18)

This commit is contained in:
Kamron Batman 2019-03-11 14:29:59 -07:00 • committed by GitHub
parent e748af4430
commit 513e54f70e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
1094 changed files with 15913 additions and 21892 deletions

View file

@ -94,33 +94,31 @@ namespace Server.Engines.BulkOrders
AddImage(5, 424, 10460);
AddImage(585, 424, 10460);
AddHtmlLocalized(270, 32, 200, 32, 1062223, LabelColor, false, false); // Filter Preference
AddHtmlLocalized(270, 32, 200, 32, 1062223, LabelColor); // Filter Preference
AddHtmlLocalized(26, 64, 120, 32, 1062228, LabelColor, false, false); // Bulk Order Type
AddHtmlLocalized(26, 64, 120, 32, 1062228, LabelColor); // Bulk Order Type
AddFilterList(25, 96, m_XOffsets_Type, 40, m_TypeFilters, m_XWidths_Small, f.Type, 0);
AddHtmlLocalized(320, 64, 50, 32, 1062215, LabelColor, false, false); // Quality
AddHtmlLocalized(320, 64, 50, 32, 1062215, LabelColor); // Quality
AddFilterList(320, 96, m_XOffsets_Quality, 40, m_QualityFilters, m_XWidths_Small, f.Quality, 1);
AddHtmlLocalized(26, 160, 120, 32, 1062232, LabelColor, false, false); // Material Type
AddHtmlLocalized(26, 160, 120, 32, 1062232, LabelColor); // Material Type
AddFilterList(25, 192, m_XOffsets_Material, 40, m_MaterialFilters, m_XWidths_Large, f.Material, 2);
AddHtmlLocalized(26, 320, 120, 32, 1062217, LabelColor, false, false); // Amount
AddHtmlLocalized(26, 320, 120, 32, 1062217, LabelColor); // Amount
AddFilterList(25, 352, m_XOffsets_Amount, 40, m_AmountFilters, m_XWidths_Small, f.Quantity, 3);
AddHtmlLocalized(75, 416, 120, 32, 1062477, from.UseOwnFilter ? LabelColor : 16927, false,
false); // Set Book Filter
AddButton(40, 416, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(75, 416, 120, 32, 1062477, from.UseOwnFilter ? LabelColor : 16927); // Set Book Filter
AddButton(40, 416, 4005, 4007, 1);
AddHtmlLocalized(235, 416, 120, 32, 1062478, from.UseOwnFilter ? 16927 : LabelColor, false,
false); // Set Your Filter
AddButton(200, 416, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(235, 416, 120, 32, 1062478, from.UseOwnFilter ? 16927 : LabelColor); // Set Your Filter
AddButton(200, 416, 4005, 4007, 2);
AddHtmlLocalized(405, 416, 120, 32, 1062231, LabelColor, false, false); // Clear Filter
AddButton(370, 416, 4005, 4007, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(405, 416, 120, 32, 1062231, LabelColor); // Clear Filter
AddButton(370, 416, 4005, 4007, 3);
AddHtmlLocalized(540, 416, 50, 32, 1011046, LabelColor, false, false); // APPLY
AddButton(505, 416, 4017, 4018, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(540, 416, 50, 32, 1011046, LabelColor); // APPLY
AddButton(505, 416, 4017, 4018, 0);
}
private void AddFilterList(int x, int y, int[] xOffsets, int yOffset, int[,] filters, int[] xWidths, int filterValue,
@ -139,9 +137,9 @@ namespace Server.Engines.BulkOrders
isSelected = filterValue == 0;
AddHtmlLocalized(x + 35 + xOffsets[i % xOffsets.Length], y + i / xOffsets.Length * yOffset,
xWidths[i % xOffsets.Length], 32, number, isSelected ? 16927 : LabelColor, false, false);
xWidths[i % xOffsets.Length], 32, number, isSelected ? 16927 : LabelColor);
AddButton(x + xOffsets[i % xOffsets.Length], y + i / xOffsets.Length * yOffset, 4005, 4007,
4 + filterIndex + i * 4, GumpButtonType.Reply, 0);
4 + filterIndex + i * 4);
}
}
@ -221,4 +219,4 @@ namespace Server.Engines.BulkOrders
}
}
}
}
}

View file

@ -56,7 +56,7 @@ namespace Server.Engines.BulkOrders
{
VendorItem vi = pv.GetVendorItem(book);
canBuy = vi != null && !vi.IsForSale;
canBuy = vi?.IsForSale == false;
}
int width = 600;
@ -103,45 +103,45 @@ namespace Server.Engines.BulkOrders
AddImage(5, 424, 10460);
AddImage(width - 15, 424, 10460);
AddHtmlLocalized(canPrice ? 266 : 224, 32, 200, 32, 1062220, LabelColor, false, false); // Bulk Order Book
AddHtmlLocalized(63, 64, 200, 32, 1062213, LabelColor, false, false); // Type
AddHtmlLocalized(147, 64, 200, 32, 1062214, LabelColor, false, false); // Item
AddHtmlLocalized(246, 64, 200, 32, 1062215, LabelColor, false, false); // Quality
AddHtmlLocalized(336, 64, 200, 32, 1062216, LabelColor, false, false); // Material
AddHtmlLocalized(429, 64, 200, 32, 1062217, LabelColor, false, false); // Amount
AddHtmlLocalized(canPrice ? 266 : 224, 32, 200, 32, 1062220, LabelColor); // Bulk Order Book
AddHtmlLocalized(63, 64, 200, 32, 1062213, LabelColor); // Type
AddHtmlLocalized(147, 64, 200, 32, 1062214, LabelColor); // Item
AddHtmlLocalized(246, 64, 200, 32, 1062215, LabelColor); // Quality
AddHtmlLocalized(336, 64, 200, 32, 1062216, LabelColor); // Material
AddHtmlLocalized(429, 64, 200, 32, 1062217, LabelColor); // Amount
AddButton(35, 32, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(70, 32, 200, 32, 1062476, LabelColor, false, false); // Set Filter
AddButton(35, 32, 4005, 4007, 1);
AddHtmlLocalized(70, 32, 200, 32, 1062476, LabelColor); // Set Filter
BOBFilter f = from.UseOwnFilter ? from.BOBFilter : book.Filter;
if (f.IsDefault)
AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062475, 16927, false, false); // Using No Filter
AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062475, 16927); // Using No Filter
else if (from.UseOwnFilter)
AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062451, 16927, false, false); // Using Your Filter
AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062451, 16927); // Using Your Filter
else
AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062230, 16927, false, false); // Using Book Filter
AddHtmlLocalized(canPrice ? 470 : 386, 32, 120, 32, 1062230, 16927); // Using Book Filter
AddButton(375, 416, 4017, 4018, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(410, 416, 120, 20, 1011441, LabelColor, false, false); // EXIT
AddButton(375, 416, 4017, 4018, 0);
AddHtmlLocalized(410, 416, 120, 20, 1011441, LabelColor); // EXIT
if (canDrop)
AddHtmlLocalized(26, 64, 50, 32, 1062212, LabelColor, false, false); // Drop
AddHtmlLocalized(26, 64, 50, 32, 1062212, LabelColor); // Drop
if (canPrice)
{
AddHtmlLocalized(516, 64, 200, 32, 1062218, LabelColor, false, false); // Price
AddHtmlLocalized(516, 64, 200, 32, 1062218, LabelColor); // Price
if (canBuy)
{
AddHtmlLocalized(576, 64, 200, 32, 1062219, LabelColor, false, false); // Buy
AddHtmlLocalized(576, 64, 200, 32, 1062219, LabelColor); // Buy
}
else
{
AddHtmlLocalized(576, 64, 200, 32, 1062227, LabelColor, false, false); // Set
AddHtmlLocalized(576, 64, 200, 32, 1062227, LabelColor); // Set
AddButton(450, 416, 4005, 4007, 4, GumpButtonType.Reply, 0);
AddHtml(485, 416, 120, 20, "<BASEFONT COLOR=#FFFFFF>Price all</FONT>", false, false);
AddButton(450, 416, 4005, 4007, 4);
AddHtml(485, 416, 120, 20, "<BASEFONT COLOR=#FFFFFF>Price all</FONT>");
}
}
@ -149,14 +149,14 @@ namespace Server.Engines.BulkOrders
if (page > 0)
{
AddButton(75, 416, 4014, 4016, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(110, 416, 150, 20, 1011067, LabelColor, false, false); // Previous page
AddButton(75, 416, 4014, 4016, 2);
AddHtmlLocalized(110, 416, 150, 20, 1011067, LabelColor); // Previous page
}
if (GetIndexForPage(page + 1) < list.Count)
{
AddButton(225, 416, 4005, 4007, 3, GumpButtonType.Reply, 0);
AddHtmlLocalized(260, 416, 150, 20, 1011066, LabelColor, false, false); // Next page
AddButton(225, 416, 4005, 4007, 3);
AddHtmlLocalized(260, 416, 150, 20, 1011066, LabelColor); // Next page
}
for (int i = index; i < index + count && i >= 0 && i < list.Count; ++i)
@ -171,31 +171,31 @@ namespace Server.Engines.BulkOrders
int y = 96 + tableIndex * 32;
if (canDrop)
AddButton(35, y + 2, 5602, 5606, 5 + i * 2, GumpButtonType.Reply, 0);
AddButton(35, y + 2, 5602, 5606, 5 + i * 2);
if (canDrop || canBuy && entry.Price > 0)
{
AddButton(579, y + 2, 2117, 2118, 6 + i * 2, GumpButtonType.Reply, 0);
AddButton(579, y + 2, 2117, 2118, 6 + i * 2);
AddLabel(495, y, 1152, entry.Price.ToString());
}
AddHtmlLocalized(61, y, 50, 32, 1062225, LabelColor, false, false); // Large
AddHtmlLocalized(61, y, 50, 32, 1062225, LabelColor); // Large
for (int j = 0; j < largeEntry.Entries.Length; ++j)
{
BOBLargeSubEntry sub = largeEntry.Entries[j];
AddHtmlLocalized(103, y, 130, 32, sub.Number, LabelColor, false, false);
AddHtmlLocalized(103, y, 130, 32, sub.Number, LabelColor);
if (entry.RequireExceptional)
AddHtmlLocalized(235, y, 80, 20, 1060636, LabelColor, false, false); // exceptional
AddHtmlLocalized(235, y, 80, 20, 1060636, LabelColor); // exceptional
else
AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor, false, false); // normal
AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor); // normal
object name = GetMaterialName(entry.Material, entry.DeedType, sub.ItemType);
if (name is int intName)
AddHtmlLocalized(316, y, 100, 20, intName, LabelColor, false, false);
AddHtmlLocalized(316, y, 100, 20, intName, LabelColor);
else
AddLabel(316, y, 1152, name.ToString());
@ -212,27 +212,27 @@ namespace Server.Engines.BulkOrders
int y = 96 + tableIndex++ * 32;
if (canDrop)
AddButton(35, y + 2, 5602, 5606, 5 + i * 2, GumpButtonType.Reply, 0);
AddButton(35, y + 2, 5602, 5606, 5 + i * 2);
if (canDrop || canBuy && smallEntry.Price > 0)
{
AddButton(579, y + 2, 2117, 2118, 6 + i * 2, GumpButtonType.Reply, 0);
AddButton(579, y + 2, 2117, 2118, 6 + i * 2);
AddLabel(495, y, 1152, smallEntry.Price.ToString());
}
AddHtmlLocalized(61, y, 50, 32, 1062224, LabelColor, false, false); // Small
AddHtmlLocalized(61, y, 50, 32, 1062224, LabelColor); // Small
AddHtmlLocalized(103, y, 130, 32, smallEntry.Number, LabelColor, false, false);
AddHtmlLocalized(103, y, 130, 32, smallEntry.Number, LabelColor);
if (smallEntry.RequireExceptional)
AddHtmlLocalized(235, y, 80, 20, 1060636, LabelColor, false, false); // exceptional
AddHtmlLocalized(235, y, 80, 20, 1060636, LabelColor); // exceptional
else
AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor, false, false); // normal
AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor); // normal
object name = GetMaterialName(smallEntry.Material, smallEntry.DeedType, smallEntry.ItemType);
if (name is int intName)
AddHtmlLocalized(316, y, 100, 20, intName, LabelColor, false, false);
AddHtmlLocalized(316, y, 100, 20, intName, LabelColor);
else
AddLabel(316, y, 1152, name.ToString());
@ -242,11 +242,11 @@ namespace Server.Engines.BulkOrders
}
public bool CheckFilter(IBOBEntry entry)
{
{
if (entry is BOBLargeEntry largeEntry)
return CheckFilter(entry.Material, entry.AmountMax, true, entry.RequireExceptional, entry.DeedType,
largeEntry.Entries.Length > 0 ? largeEntry.Entries[0].ItemType : null);
if (entry is BOBSmallEntry smallEntry)
return CheckFilter(entry.Material, entry.AmountMax, false, entry.RequireExceptional,
entry.DeedType, smallEntry.ItemType);
@ -355,7 +355,7 @@ namespace Server.Engines.BulkOrders
int count = 0;
int page = 0;
int i;
List<IBOBEntry> list = m_List;
for (i = 0; i < index && i < list.Count; i++)
{
@ -510,8 +510,8 @@ namespace Server.Engines.BulkOrders
Item item = bobEntry.Reconstruct();
Container pack = m_From.Backpack;
if (pack == null || !pack.CheckHold(m_From, item, true, true, 0,
item.PileWeight + item.TotalWeight))
if (pack?.CheckHold(m_From, item, true, true, 0,
item.PileWeight + item.TotalWeight) != true)
{
m_From.SendLocalizedMessage(503204); // You do not have room in your backpack for this
m_From.SendGump(new BOBGump(m_From, m_Book, m_Page));
@ -558,26 +558,26 @@ namespace Server.Engines.BulkOrders
{
VendorItem vi = pv.GetVendorItem(m_Book);
if (vi != null && !vi.IsForSale)
{
int sizeOfDroppedBod = bobEntry is BOBLargeEntry largeEntry ? largeEntry.Entries.Length : 1;
int price = bobEntry.Price;
if (vi?.IsForSale != false)
return;
if (price == 0)
int sizeOfDroppedBod = bobEntry is BOBLargeEntry largeEntry ? largeEntry.Entries.Length : 1;
int price = bobEntry.Price;
if (price == 0)
{
m_From.SendLocalizedMessage(1062382); // The deed selected is not available.
}
else
{
if (m_Book.Entries.Count > 0)
{
m_From.SendLocalizedMessage(1062382); // The deed selected is not available.
m_Page = GetPageForIndex(index, sizeOfDroppedBod);
m_From.SendGump(new BODBuyGump(m_From, m_Book, bobEntry, m_Page, price));
}
else
{
if (m_Book.Entries.Count > 0)
{
m_Page = GetPageForIndex(index, sizeOfDroppedBod);
m_From.SendGump(new BODBuyGump(m_From, m_Book, bobEntry, m_Page, price));
}
else
{
m_From.SendLocalizedMessage(1062381); // The book is emptz
}
m_From.SendLocalizedMessage(1062381); // The book is emptz
}
}
}
@ -625,7 +625,7 @@ namespace Server.Engines.BulkOrders
if (!m_Book.Entries.Contains(entry))
continue;
entry.Price = price;
}
@ -644,4 +644,4 @@ namespace Server.Engines.BulkOrders
}
}
}
}
}

View file

@ -67,7 +67,7 @@ namespace Server.Engines.BulkOrders
else if (DeedType == BODType.Tailor)
bod = new LargeTailorBOD(AmountMax, RequireExceptional, Material, ReconstructEntries());
for (int i = 0; bod != null && i < bod.Entries.Length; ++i)
for (int i = 0; bod?.Entries.Length >= i; ++i)
bod.Entries[i].Owner = bod;
return bod;
@ -103,4 +103,4 @@ namespace Server.Engines.BulkOrders
Entries[i].Serialize(writer);
}
}
}
}

View file

@ -25,17 +25,17 @@ namespace Server.Engines.BulkOrders
AddBackground(100, 10, 300, 150, 5054);
AddHtmlLocalized(125, 20, 250, 24, 1019070, false, false); // You have agreed to purchase:
AddHtmlLocalized(125, 45, 250, 24, 1045151, false, false); // a bulk order deed
AddHtmlLocalized(125, 20, 250, 24, 1019070); // You have agreed to purchase:
AddHtmlLocalized(125, 45, 250, 24, 1045151); // a bulk order deed
AddHtmlLocalized(125, 70, 250, 24, 1019071, false, false); // for the amount of:
AddHtmlLocalized(125, 70, 250, 24, 1019071); // for the amount of:
AddLabel(125, 95, 0, price.ToString());
AddButton(250, 130, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(282, 130, 100, 24, 1011012, false, false); // CANCEL
AddButton(250, 130, 4005, 4007, 1);
AddHtmlLocalized(282, 130, 100, 24, 1011012); // CANCEL
AddButton(120, 130, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(152, 130, 100, 24, 1011036, false, false); // OKAY
AddButton(120, 130, 4005, 4007, 2);
AddHtmlLocalized(152, 130, 100, 24, 1011036); // OKAY
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -57,12 +57,12 @@ namespace Server.Engines.BulkOrders
pv.SayTo(m_From, 1062382); // The deed selected is not available.
return;
}
int price = 0;
VendorItem vi = pv.GetVendorItem(m_Book);
if (vi != null && !vi.IsForSale)
if (vi?.IsForSale == false)
price = m_Entry.Price;
if (price != m_Price)
@ -79,13 +79,13 @@ namespace Server.Engines.BulkOrders
}
Item item = m_Entry.Reconstruct();
pv.Say(m_From.Name);
Container pack = m_From.Backpack;
if (pack == null || !pack.CheckHold(m_From, item, true, true, 0,
item.PileWeight + item.TotalWeight))
if (pack?.CheckHold(m_From, item, true, true, 0,
item.PileWeight + item.TotalWeight) != true)
{
pv.SayTo(m_From, 503204); // You do not have room in your backpack for this
m_From.SendGump(new BOBGump(m_From, m_Book, m_Page));
@ -120,4 +120,4 @@ namespace Server.Engines.BulkOrders
}
}
}
}
}

View file

@ -70,9 +70,9 @@ namespace Server.Engines.BulkOrders
{
SecureTrade trade = cont.Trade;
if ( trade != null && trade.From.Mobile == from )
if (trade?.From.Mobile == from )
trade.To.Mobile.SendGump( new BOBGump( (PlayerMobile)trade.To.Mobile, this ) );
else if ( trade != null && trade.To.Mobile == from )
else if (trade?.To.Mobile == from )
trade.From.Mobile.SendGump( new BOBGump( (PlayerMobile)trade.From.Mobile, this ) );
}
}
@ -159,9 +159,9 @@ namespace Server.Engines.BulkOrders
{
base.Serialize( writer );
writer.Write( (int) 2 ); // version
writer.Write( 2 ); // version
writer.Write( (int) ItemCount );
writer.Write( ItemCount );
writer.Write( (int) Level );
@ -169,7 +169,7 @@ namespace Server.Engines.BulkOrders
Filter.Serialize( writer );
writer.WriteEncodedInt( (int) Entries.Count );
writer.WriteEncodedInt( Entries.Count );
for ( int i = 0; i < Entries.Count; ++i )
{

View file

@ -218,13 +218,13 @@ namespace Server.Engines.BulkOrders
{
base.Serialize( writer );
writer.Write( (int) 0 ); // version
writer.Write( 0 ); // version
writer.Write( m_AmountMax );
writer.Write( m_RequireExceptional );
writer.Write( (int) m_Material );
writer.Write( (int) m_Entries.Length );
writer.Write( m_Entries.Length );
for ( int i = 0; i < m_Entries.Length; ++i )
m_Entries[i].Serialize( writer );

View file

@ -30,48 +30,45 @@ namespace Server.Engines.BulkOrders
AddImage(20, 225 + entries.Length * 24, 10460);
AddImage(430, 225 + entries.Length * 24, 10460);
AddHtmlLocalized(180, 25, 120, 20, 1045134, 0x7FFF, false, false); // A large bulk order
AddHtmlLocalized(180, 25, 120, 20, 1045134, 0x7FFF); // A large bulk order
AddHtmlLocalized(40, 48, 350, 20, 1045135, 0x7FFF, false,
false); // 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?
AddHtmlLocalized(40, 72, 210, 20, 1045138, 0x7FFF, false, false); // Amount to make:
AddHtmlLocalized(40, 72, 210, 20, 1045138, 0x7FFF); // Amount to make:
AddLabel(250, 72, 1152, deed.AmountMax.ToString());
AddHtmlLocalized(40, 96, 120, 20, 1045137, 0x7FFF, false, false); // Items requested:
AddHtmlLocalized(40, 96, 120, 20, 1045137, 0x7FFF); // Items requested:
int y = 120;
for (int i = 0; i < entries.Length; ++i, y += 24)
AddHtmlLocalized(40, y, 210, 20, entries[i].Details.Number, 0x7FFF, false, false);
AddHtmlLocalized(40, y, 210, 20, entries[i].Details.Number, 0x7FFF);
if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
{
AddHtmlLocalized(40, y, 210, 20, 1045140, 0x7FFF, false, false); // Special requirements to meet:
AddHtmlLocalized(40, y, 210, 20, 1045140, 0x7FFF); // Special requirements to meet:
y += 24;
if (deed.RequireExceptional)
{
AddHtmlLocalized(40, y, 350, 20, 1045141, 0x7FFF, false, false); // All items must be exceptional.
AddHtmlLocalized(40, y, 350, 20, 1045141, 0x7FFF); // All items must be exceptional.
y += 24;
}
if (deed.Material != BulkMaterialType.None)
{
AddHtmlLocalized(40, y, 350, 20, GetMaterialNumberFor(deed.Material), 0x7FFF, false,
false); // All items must be made with x material.
AddHtmlLocalized(40, y, 350, 20, GetMaterialNumberFor(deed.Material), 0x7FFF); // All items must be made with x material.
y += 24;
}
}
AddHtmlLocalized(40, 192 + entries.Length * 24, 350, 20, 1045139, 0x7FFF, false,
false); // Do you want to accept this order?
AddHtmlLocalized(40, 192 + entries.Length * 24, 350, 20, 1045139, 0x7FFF); // Do you want to accept this order?
AddButton(100, 216 + entries.Length * 24, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(135, 216 + entries.Length * 24, 120, 20, 1006044, 0x7FFF, false, false); // Ok
AddButton(100, 216 + entries.Length * 24, 4005, 4007, 1);
AddHtmlLocalized(135, 216 + entries.Length * 24, 120, 20, 1006044, 0x7FFF); // Ok
AddButton(275, 216 + entries.Length * 24, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(310, 216 + entries.Length * 24, 120, 20, 1011012, 0x7FFF, false, false); // CANCEL
AddButton(275, 216 + entries.Length * 24, 4005, 4007, 0);
AddHtmlLocalized(310, 216 + entries.Length * 24, 120, 20, 1011012, 0x7FFF); // CANCEL
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -104,4 +101,4 @@ namespace Server.Engines.BulkOrders
return 0;
}
}
}
}

View file

@ -30,13 +30,13 @@ namespace Server.Engines.BulkOrders
AddImage(45, 221 + entries.Length * 24, 10460);
AddImage(480, 221 + entries.Length * 24, 10460);
AddHtmlLocalized(225, 25, 120, 20, 1045134, 0x7FFF, false, false); // A large bulk order
AddHtmlLocalized(225, 25, 120, 20, 1045134, 0x7FFF); // A large bulk order
AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF, false, false); // Amount to make:
AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF); // Amount to make:
AddLabel(275, 48, 1152, deed.AmountMax.ToString());
AddHtmlLocalized(75, 72, 120, 20, 1045137, 0x7FFF, false, false); // Items requested:
AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF, false, false); // Amount finished:
AddHtmlLocalized(75, 72, 120, 20, 1045137, 0x7FFF); // Items requested:
AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF); // Amount finished:
int y = 96;
@ -45,7 +45,7 @@ namespace Server.Engines.BulkOrders
LargeBulkEntry entry = entries[i];
SmallBulkEntry details = entry.Details;
AddHtmlLocalized(75, y, 210, 20, details.Number, 0x7FFF, false, false);
AddHtmlLocalized(75, y, 210, 20, details.Number, 0x7FFF);
AddLabel(275, y, 0x480, entry.Amount.ToString());
y += 24;
@ -53,26 +53,24 @@ namespace Server.Engines.BulkOrders
if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
{
AddHtmlLocalized(75, y, 200, 20, 1045140, 0x7FFF, false, false); // Special requirements to meet:
AddHtmlLocalized(75, y, 200, 20, 1045140, 0x7FFF); // Special requirements to meet:
y += 24;
}
if (deed.RequireExceptional)
{
AddHtmlLocalized(75, y, 300, 20, 1045141, 0x7FFF, false, false); // All items must be exceptional.
AddHtmlLocalized(75, y, 300, 20, 1045141, 0x7FFF); // All items must be exceptional.
y += 24;
}
if (deed.Material != BulkMaterialType.None)
AddHtmlLocalized(75, y, 300, 20, GetMaterialNumberFor(deed.Material), 0x7FFF, false,
false); // All items must be made with x material.
AddHtmlLocalized(75, y, 300, 20, GetMaterialNumberFor(deed.Material), 0x7FFF); // All items must be made with x material.
AddButton(125, 168 + entries.Length * 24, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(160, 168 + entries.Length * 24, 300, 20, 1045155, 0x7FFF, false,
false); // Combine this deed with another deed.
AddButton(125, 168 + entries.Length * 24, 4005, 4007, 2);
AddHtmlLocalized(160, 168 + entries.Length * 24, 300, 20, 1045155, 0x7FFF); // Combine this deed with another deed.
AddButton(125, 192 + entries.Length * 24, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(160, 192 + entries.Length * 24, 120, 20, 1011441, 0x7FFF, false, false); // EXIT
AddButton(125, 192 + entries.Length * 24, 4005, 4007, 1);
AddHtmlLocalized(160, 192 + entries.Length * 24, 120, 20, 1011441, 0x7FFF); // EXIT
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -97,4 +95,4 @@ namespace Server.Engines.BulkOrders
return 0;
}
}
}
}

View file

@ -29,11 +29,7 @@ namespace Server.Engines.BulkOrders
public sealed class RewardItem
{
public RewardItem(int weight, ConstructCallback constructor) : this(weight, constructor, 0)
{
}
public RewardItem(int weight, ConstructCallback constructor, int type)
public RewardItem(int weight, ConstructCallback constructor, int type = 0)
{
Weight = weight;
Constructor = constructor;
@ -583,7 +579,7 @@ namespace Server.Engines.BulkOrders
{
Groups = new[]
{
new RewardGroup(0, new RewardItem(1, Cloth, 0)),
new RewardGroup(0, new RewardItem(1, Cloth)),
new RewardGroup(50, new RewardItem(1, Cloth, 1)),
new RewardGroup(100, new RewardItem(1, Cloth, 2)),
new RewardGroup(150, new RewardItem(9, Cloth, 3), new RewardItem(1, Sandals)),
@ -745,4 +741,4 @@ namespace Server.Engines.BulkOrders
#endregion
}
}
}

View file

@ -28,36 +28,35 @@ namespace Server.Engines.BulkOrders
AddImage(20, 249, 10460);
AddImage(430, 249, 10460);
AddHtmlLocalized(190, 25, 120, 20, 1045133, 0x7FFF, false, false); // A bulk order
AddHtmlLocalized(40, 48, 350, 20, 1045135, 0x7FFF, false,
false); // 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?
AddHtmlLocalized(40, 72, 210, 20, 1045138, 0x7FFF, false, false); // Amount to make:
AddHtmlLocalized(40, 72, 210, 20, 1045138, 0x7FFF); // Amount to make:
AddLabel(250, 72, 1152, deed.AmountMax.ToString());
AddHtmlLocalized(40, 96, 120, 20, 1045136, 0x7FFF, false, false); // Item requested:
AddHtmlLocalized(40, 96, 120, 20, 1045136, 0x7FFF); // Item requested:
AddItem(385, 96, deed.Graphic);
AddHtmlLocalized(40, 120, 210, 20, deed.Number, 0xFFFFFF, false, false);
AddHtmlLocalized(40, 120, 210, 20, deed.Number, 0xFFFFFF);
if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
{
AddHtmlLocalized(40, 144, 210, 20, 1045140, 0x7FFF, false, false); // Special requirements to meet:
AddHtmlLocalized(40, 144, 210, 20, 1045140, 0x7FFF); // Special requirements to meet:
if (deed.RequireExceptional)
AddHtmlLocalized(40, 168, 350, 20, 1045141, 0x7FFF, false, false); // All items must be exceptional.
AddHtmlLocalized(40, 168, 350, 20, 1045141, 0x7FFF); // All items must be exceptional.
if (deed.Material != BulkMaterialType.None)
AddHtmlLocalized(40, deed.RequireExceptional ? 192 : 168, 350, 20, GetMaterialNumberFor(deed.Material),
0x7FFF, false, false); // All items must be made with x material.
0x7FFF); // All items must be made with x material.
}
AddHtmlLocalized(40, 216, 350, 20, 1045139, 0x7FFF, false, false); // Do you want to accept this order?
AddHtmlLocalized(40, 216, 350, 20, 1045139, 0x7FFF); // Do you want to accept this order?
AddButton(100, 240, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(135, 240, 120, 20, 1006044, 0x7FFF, false, false); // Ok
AddButton(100, 240, 4005, 4007, 1);
AddHtmlLocalized(135, 240, 120, 20, 1006044, 0x7FFF); // Ok
AddButton(275, 240, 4005, 4007, 0, GumpButtonType.Reply, 0);
AddHtmlLocalized(310, 240, 120, 20, 1011012, 0x7FFF, false, false); // CANCEL
AddButton(275, 240, 4005, 4007, 0);
AddHtmlLocalized(310, 240, 120, 20, 1011012, 0x7FFF); // CANCEL
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -90,4 +89,4 @@ namespace Server.Engines.BulkOrders
return 0;
}
}
}
}

View file

@ -27,34 +27,34 @@ namespace Server.Engines.BulkOrders
AddImage(45, 245, 10460);
AddImage(480, 245, 10460);
AddHtmlLocalized(225, 25, 120, 20, 1045133, 0x7FFF, false, false); // A bulk order
AddHtmlLocalized(225, 25, 120, 20, 1045133, 0x7FFF); // A bulk order
AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF, false, false); // Amount to make:
AddHtmlLocalized(75, 48, 250, 20, 1045138, 0x7FFF); // Amount to make:
AddLabel(275, 48, 1152, deed.AmountMax.ToString());
AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF, false, false); // Amount finished:
AddHtmlLocalized(75, 72, 120, 20, 1045136, 0x7FFF, false, false); // Item requested:
AddHtmlLocalized(275, 76, 200, 20, 1045153, 0x7FFF); // Amount finished:
AddHtmlLocalized(75, 72, 120, 20, 1045136, 0x7FFF); // Item requested:
AddItem(410, 72, deed.Graphic);
AddHtmlLocalized(75, 96, 210, 20, deed.Number, 0x7FFF, false, false);
AddHtmlLocalized(75, 96, 210, 20, deed.Number, 0x7FFF);
AddLabel(275, 96, 0x480, deed.AmountCur.ToString());
if (deed.RequireExceptional || deed.Material != BulkMaterialType.None)
AddHtmlLocalized(75, 120, 200, 20, 1045140, 0x7FFF, false, false); // Special requirements to meet:
AddHtmlLocalized(75, 120, 200, 20, 1045140, 0x7FFF); // Special requirements to meet:
if (deed.RequireExceptional)
AddHtmlLocalized(75, 144, 300, 20, 1045141, 0x7FFF, false, false); // All items must be exceptional.
AddHtmlLocalized(75, 144, 300, 20, 1045141, 0x7FFF); // All items must be exceptional.
if (deed.Material != BulkMaterialType.None)
AddHtmlLocalized(75, deed.RequireExceptional ? 168 : 144, 300, 20, GetMaterialNumberFor(deed.Material),
0x7FFF, false, false); // All items must be made with x material.
0x7FFF); // All items must be made with x material.
AddButton(125, 192, 4005, 4007, 2, GumpButtonType.Reply, 0);
AddHtmlLocalized(160, 192, 300, 20, 1045154, 0x7FFF, false, false); // Combine this deed with the item requested.
AddButton(125, 192, 4005, 4007, 2);
AddHtmlLocalized(160, 192, 300, 20, 1045154, 0x7FFF); // Combine this deed with the item requested.
AddButton(125, 216, 4005, 4007, 1, GumpButtonType.Reply, 0);
AddHtmlLocalized(160, 216, 120, 20, 1011441, 0x7FFF, false, false); // EXIT
AddButton(125, 216, 4005, 4007, 1);
AddHtmlLocalized(160, 216, 120, 20, 1011441, 0x7FFF); // EXIT
}
public override void OnResponse(NetState sender, RelayInfo info)
@ -79,4 +79,4 @@ namespace Server.Engines.BulkOrders
return 0;
}
}
}
}

View file

@ -78,10 +78,11 @@ namespace Server.Engines.BulkOrders
list.Add( new SmallBulkEntry( type, graphic < 0x4000 ? 1020000 + graphic : 1078872 + graphic, graphic ) );
}
}
catch
{
}
}
catch
{
// ignored
}
}
}
}