fix: Update LabelTo, SendMessage, etc to Interpolated Strings (#1283)

This commit is contained in:
Fabrizio 2022-11-29 04:58:12 +01:00 • committed by GitHub
parent 0facd73842
commit 537526a328
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
94 changed files with 514 additions and 769 deletions

View file

@ -672,7 +672,14 @@ public class Container : Item
if (CheckContentDisplay(from))
{
LabelTo(from, "({0} item{2}, {1} stones)", TotalItems, TotalWeight, TotalItems != 1 ? "s" : string.Empty);
if (TotalItems == 1)
{
LabelTo(from, $"({TotalItems} item, {TotalWeight} stones)");
}
else
{
LabelTo(from, $"({TotalItems} items, {TotalWeight} stones)");
}
}
// LabelTo( from, 1050044, String.Format( "{0}\t{1}", TotalItems.ToString(), TotalWeight.ToString() ) );

View file

@ -2235,11 +2235,6 @@ public class Item : IHued, IComparable<Item>, ISpawnable, IObjectPropertyListEnt
to.NetState.SendMessage(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, false, "ENU", "", text);
}
public void LabelTo(Mobile to, string format, params object[] args)
{
LabelTo(to, string.Format(format, args));
}
public void LabelToAffix(Mobile to, int number, AffixType type, string affix, string args = "")
{
to.NetState.SendMessageLocalizedAffix(Serial, m_ItemID, MessageType.Label, 0x3B2, 3, number, "", type, affix, args);

View file

@ -117,7 +117,7 @@ public sealed class VirtualCheck : Item
public override void OnSingleClick(Mobile from)
{
LabelTo(from, "Offer: {0:#,0} platinum, {1:#,0} gold", Plat, Gold);
LabelTo(from, $"Offer: {Plat:#,0} platinum, {Gold:#,0} gold");
}
public override void GetProperties(IPropertyList list)