Updates some messages to text definitions (#144)

This commit is contained in:
Kamron Batman 2020-05-24 19:47:46 -07:00 • committed by GitHub
parent f957a1dd5b
commit eb0f960be6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 18 additions and 18 deletions

View file

@ -192,12 +192,12 @@ namespace Server.Engines.BulkOrders
else else
AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor); // normal AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor); // normal
object name = GetMaterialName(entry.Material, entry.DeedType, sub.ItemType); TextDefinition name = GetMaterialName(entry.Material, entry.DeedType, sub.ItemType);
if (name is int intName) if (name.Number > 0)
AddHtmlLocalized(316, y, 100, 20, intName, LabelColor); AddHtmlLocalized(316, y, 100, 20, name, LabelColor);
else else
AddLabel(316, y, 1152, name.ToString()); AddLabel(316, y, 1152, name);
AddLabel(421, y, 1152, $"{sub.AmountCur} / {entry.AmountMax}"); AddLabel(421, y, 1152, $"{sub.AmountCur} / {entry.AmountMax}");
@ -229,12 +229,12 @@ namespace Server.Engines.BulkOrders
else else
AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor); // normal AddHtmlLocalized(235, y, 80, 20, 1011542, LabelColor); // normal
object name = GetMaterialName(smallEntry.Material, smallEntry.DeedType, smallEntry.ItemType); TextDefinition name = GetMaterialName(smallEntry.Material, smallEntry.DeedType, smallEntry.ItemType);
if (name is int intName) if (name.Number > 0)
AddHtmlLocalized(316, y, 100, 20, intName, LabelColor); AddHtmlLocalized(316, y, 100, 20, name, LabelColor);
else else
AddLabel(316, y, 1152, name.ToString()); AddLabel(316, y, 1152, name);
AddLabel(421, y, 1152, $"{smallEntry.AmountCur} / {smallEntry.AmountMax}"); AddLabel(421, y, 1152, $"{smallEntry.AmountCur} / {smallEntry.AmountMax}");
} }
@ -391,7 +391,7 @@ namespace Server.Engines.BulkOrders
return page; return page;
} }
public object GetMaterialName(BulkMaterialType mat, BODType type, Type itemType) public TextDefinition GetMaterialName(BulkMaterialType mat, BODType type, Type itemType)
{ {
switch (type) switch (type)
{ {

View file

@ -81,12 +81,12 @@ namespace Server.Engines.Harvest
public Dictionary<Map, Dictionary<Point2D, HarvestBank>> Banks { get; } public Dictionary<Map, Dictionary<Point2D, HarvestBank>> Banks { get; }
= new Dictionary<Map, Dictionary<Point2D, HarvestBank>>(); = new Dictionary<Map, Dictionary<Point2D, HarvestBank>>();
public void SendMessageTo(Mobile from, object message) public void SendMessageTo(Mobile from, TextDefinition message)
{ {
if (message is int messageInt) if (message.Number > 0)
from.SendLocalizedMessage(messageInt); from.SendLocalizedMessage(message.Number);
else else
from.SendMessage(message.ToString()); from.SendMessage(message);
} }
public HarvestBank GetBank(Map map, int x, int y) public HarvestBank GetBank(Map map, int x, int y)

View file

@ -56,14 +56,14 @@ namespace Server.Gumps
AddButton(190, 17, 0x15E3, 0x15E7, 0, GumpButtonType.Page, page - 1); AddButton(190, 17, 0x15E3, 0x15E7, 0, GumpButtonType.Page, page - 1);
} }
object name = FindHouseName(list[i]); TextDefinition name = FindHouseName(list[i]);
AddHtml(15, 40 + i % 15 * 20, 20, 20, Color($"{i + 1}.", White)); AddHtml(15, 40 + i % 15 * 20, 20, 20, Color($"{i + 1}.", White));
if (name is int nameInt) if (name.Number > 0)
AddHtmlLocalized(35, 40 + i % 15 * 20, 160, 20, nameInt, White16); AddHtmlLocalized(35, 40 + i % 15 * 20, 160, 20, name, White16);
else else
AddHtml(35, 40 + i % 15 * 20, 160, 20, Color(name.ToString(), White)); AddHtml(35, 40 + i % 15 * 20, 160, 20, Color(name, White));
AddButton(198, 39 + i % 15 * 20, 4005, 4007, i + 1); AddButton(198, 39 + i % 15 * 20, 4005, 4007, i + 1);
} }
@ -230,7 +230,7 @@ namespace Server.Gumps
} }
} }
public object FindHouseName(BaseHouse house) public static TextDefinition FindHouseName(BaseHouse house)
{ {
int multiID = house.ItemID; int multiID = house.ItemID;
HousePlacementEntry[] entries = HousePlacementEntry.ClassicHouses; HousePlacementEntry[] entries = HousePlacementEntry.ClassicHouses;