Fixes string interpolation

This commit is contained in:
Kamron Batman 2018-09-14 13:07:43 -07:00
parent 42d0b6271f
commit 7d3a0ca265
233 changed files with 758 additions and 690 deletions

View file

@ -100,9 +100,10 @@ namespace Server.Items
string args;
if ( m_Commodity.Name == null )
args = String.Format( "#{0}\t{1}", ( m_Commodity is ICommodity commodity ) ? commodity.DescriptionNumber : m_Commodity.LabelNumber, m_Commodity.Amount );
args =
$"#{((m_Commodity is ICommodity commodity) ? commodity.DescriptionNumber : m_Commodity.LabelNumber)}\t{m_Commodity.Amount}";
else
args = String.Format( "{0}\t{1}", m_Commodity.Name, m_Commodity.Amount );
args = $"{m_Commodity.Name}\t{m_Commodity.Amount}";
list.Add( 1060658, args ); // ~1_val~: ~2_val~
}
@ -121,9 +122,10 @@ namespace Server.Items
string args;
if ( m_Commodity.Name == null )
args = String.Format( "#{0}\t{1}", ( m_Commodity is ICommodity commodity ) ? commodity.DescriptionNumber : m_Commodity.LabelNumber, m_Commodity.Amount );
args =
$"#{((m_Commodity is ICommodity commodity) ? commodity.DescriptionNumber : m_Commodity.LabelNumber)}\t{m_Commodity.Amount}";
else
args = String.Format( "{0}\t{1}", m_Commodity.Name, m_Commodity.Amount );
args = $"{m_Commodity.Name}\t{m_Commodity.Amount}";
LabelTo( from, 1060658, args ); // ~1_val~: ~2_val~
}

View file

@ -63,12 +63,12 @@ namespace Server.Items
public string Center( string text )
{
return String.Format( "<CENTER>{0}</CENTER>", text );
return $"<CENTER>{text}</CENTER>";
}
public string Color( string text, int color )
{
return String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text );
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
}
public void AddButtonLabeled( int x, int y, int buttonID, string text )
@ -117,7 +117,7 @@ namespace Server.Items
{
m.RawName = newName;
m.SendMessage( "Your name has been changed!" );
m.SendMessage( String.Format( "You are now known as {0}", newName ) );
m.SendMessage($"You are now known as {newName}");
m_Sender.Delete();
}
}