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

@ -92,7 +92,8 @@ namespace Server.Engines.Help
string typeString = PageQueue.GetPageTypeName( e.Type );
string html = String.Format( "[{0}] {1} <basefont color=#{2:X6}>[<u>{3}</u>]</basefont>", typeString, e.Message, e.Handler == null ? 0xFF0000 : 0xFF, e.Handler == null ? "Unhandled" : "Handling" );
string html =
$"[{typeString}] {e.Message} <basefont color=#{(e.Handler == null ? 0xFF0000 : 0xFF):X6}>[<u>{(e.Handler == null ? "Unhandled" : "Handling")}</u>]</basefont>";
Add( new GumpHtml( 12, 44 + ((i % 5) * 80), 350, 70, html, true, true ) );
Add( new GumpButton( 370, 44 + ((i % 5) * 80) + 24, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0 ) );
@ -242,12 +243,12 @@ namespace Server.Engines.Help
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 AddTextInput( int x, int y, int w, int h, int id, string def )
@ -297,7 +298,7 @@ namespace Server.Engines.Help
PredefinedResponse resp = (PredefinedResponse)list[i];
string html = String.Format( "<u>{0}</u><br>{1}", resp.Title, resp.Message );
string html = $"<u>{resp.Title}</u><br>{resp.Message}";
AddHtml( 12, 44 + ((i % 5) * 80), 350, 70, html, true, true );
@ -501,7 +502,8 @@ namespace Server.Engines.Help
AddLabelCropped( 128, 18, 264, 20, 2100, entry.Sent.ToString() );
AddLabel( 18, 38, 2100, "Sender:" );
AddLabelCropped( 128, 38, 264, 20, 2100, String.Format( "{0} {1} [{2}]", entry.Sender.RawName, entry.Sender.Location, entry.Sender.Map ) );
AddLabelCropped( 128, 38, 264, 20, 2100,
$"{entry.Sender.RawName} {entry.Sender.Location} [{entry.Sender.Map}]");
AddButton( 18, bottom - (buttons * 22), 0xFAB, 0xFAD, 8, GumpButtonType.Reply, 0 );
AddImageTiled( 52, bottom - (buttons * 22) + 1, 340, 80, 0xA40/*0xBBC*//*0x2458*/ );
@ -549,7 +551,7 @@ namespace Server.Engines.Help
}
AddLabel( 18, 78, 2100, "Page Location:" );
AddLabelCropped( 128, 78, 264, 20, 2100, String.Format( "{0} [{1}]", entry.PageLocation, entry.PageMap ) );
AddLabelCropped( 128, 78, 264, 20, 2100, $"{entry.PageLocation} [{entry.PageMap}]");
AddButton( 18, bottom - (buttons * 22), 0xFA5, 0xFA7, 3, GumpButtonType.Reply, 0 );
AddLabel( 52, bottom - (buttons++ * 22), 2100, "Go to Page Location" );