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

@ -74,12 +74,13 @@ namespace Server.Gumps
if ( button >= 0 && button < 8 )
{
from.SendGump( new AddDoorGump( m_Type ) );
CommandSystem.Handle( from, String.Format( "{0}Add {1} {2}", CommandSystem.Prefix, m_Types[m_Type].m_Type.Name, (DoorFacing) button ) );
CommandSystem.Handle( from,
$"{CommandSystem.Prefix}Add {m_Types[m_Type].m_Type.Name} {(DoorFacing) button}");
}
else if ( button == 8 )
{
from.SendGump( new AddDoorGump( m_Type ) );
CommandSystem.Handle( from, String.Format( "{0}Link", CommandSystem.Prefix ) );
CommandSystem.Handle( from, $"{CommandSystem.Prefix}Link");
}
else
{

View file

@ -85,12 +85,12 @@ namespace Server.Gumps
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 AddBlackAlpha( int x, int y, int width, int height )
@ -106,21 +106,21 @@ namespace Server.Gumps
public static string FormatTimeSpan( TimeSpan ts )
{
return String.Format( "{0:D2}:{1:D2}:{2:D2}:{3:D2}", ts.Days, ts.Hours % 24, ts.Minutes % 60, ts.Seconds % 60 );
return $"{ts.Days:D2}:{ts.Hours % 24:D2}:{ts.Minutes % 60:D2}:{ts.Seconds % 60:D2}";
}
public static string FormatByteAmount( long totalBytes )
{
if ( totalBytes > 1000000000 )
return String.Format( "{0:F1} GB", (double)totalBytes / 1073741824 );
return $"{(double) totalBytes / 1073741824:F1} GB";
if ( totalBytes > 1000000 )
return String.Format( "{0:F1} MB", (double)totalBytes / 1048576 );
return $"{(double) totalBytes / 1048576:F1} MB";
if ( totalBytes > 1000 )
return String.Format( "{0:F1} KB", (double)totalBytes / 1024 );
return $"{(double) totalBytes / 1024:F1} KB";
return String.Format( "{0} Bytes", totalBytes );
return $"{totalBytes} Bytes";
}
public static void Initialize()
@ -600,7 +600,7 @@ namespace Server.Gumps
y += 20;
AddLabel( 20, y, LabelHue, "Location:" );
AddLabel( 200, y, LabelHue, String.Format( "{0} [{1}]", m.Location, m.Map ) );
AddLabel( 200, y, LabelHue, $"{m.Location} [{m.Map}]");
y += 44;
}
else
@ -616,7 +616,7 @@ namespace Server.Gumps
y += 20;
AddLabel( 20, y, LabelHue, "Location:" );
AddLabel( 200, y, LabelHue, String.Format( "{0} [{1}]", m.Location, m.Map ) );
AddLabel( 200, y, LabelHue, $"{m.Location} [{m.Map}]");
y += 24;
}
@ -899,7 +899,7 @@ namespace Server.Gumps
double perc = remMinutes / totMinutes;
AddLabel( 250, 190, LabelHue, String.Format( "{0} [{1:F0}%]", FormatTimeSpan( banDuration ), perc*100 ) );
AddLabel( 250, 190, LabelHue, $"{FormatTimeSpan(banDuration)} [{perc * 100:F0}%]");
}
}
else if ( a.Banned )
@ -1443,7 +1443,8 @@ namespace Server.Gumps
CommandLogging.WriteLine( from, "{0} {1} deleting account {2}", from.AccessLevel, CommandLogging.Format( from ), a.Username );
a.Delete();
from.SendGump( new AdminGump( from, AdminGumpPage.Accounts, 0, null, String.Format( "{0} : The account has been deleted.", a.Username ), null ) );
from.SendGump( new AdminGump( from, AdminGumpPage.Accounts, 0, null,
$"{a.Username} : The account has been deleted.", null ) );
}
else
{
@ -1502,14 +1503,16 @@ namespace Server.Gumps
if ( !ban )
NetState.Resume();
from.SendGump( new NoticeGump( 1060637, 30720, String.Format( "You have {0} the account{1}.", ban ? "banned" : "deleted", rads.Count == 1 ? "" : "s" ), 0xFFC000, 420, 280, new NoticeGumpCallback( ResendGump_Callback ), new object[]{ list, rads, ban ? page : 0 } ) );
from.SendGump( new NoticeGump( 1060637, 30720,
$"You have {(ban ? "banned" : "deleted")} the account{(rads.Count == 1 ? "" : "s")}.", 0xFFC000, 420, 280, new NoticeGumpCallback( ResendGump_Callback ), new object[]{ list, rads, ban ? page : 0 } ) );
if ( ban )
from.SendGump( new BanDurationGump( rads ) );
}
else
{
from.SendGump( new NoticeGump( 1060637, 30720, String.Format( "You have chosen not to {0} the account{1}.", ban ? "ban" : "delete", rads.Count == 1 ? "" : "s" ), 0xFFC000, 420, 280, new NoticeGumpCallback( ResendGump_Callback ), new object[]{ list, rads, page } ) );
from.SendGump( new NoticeGump( 1060637, 30720,
$"You have chosen not to {(ban ? "ban" : "delete")} the account{(rads.Count == 1 ? "" : "s")}.", 0xFFC000, 420, 280, new NoticeGumpCallback( ResendGump_Callback ), new object[]{ list, rads, page } ) );
}
}
@ -1553,7 +1556,7 @@ namespace Server.Gumps
{
Firewall.Add( toFirewall );
notice = String.Format( "{0} : Added to firewall.", toFirewall );
notice = $"{toFirewall} : Added to firewall.";
}
else
{
@ -1586,7 +1589,7 @@ namespace Server.Gumps
newList.Remove( ip );
a.LoginIPs = newList.ToArray();
notice = String.Format( "{0} : Removed address.", ip );
notice = $"{ip} : Removed address.";
}
else
{
@ -1756,7 +1759,7 @@ namespace Server.Gumps
else
{
notice = "Your message has been broadcasted.";
InvokeCommand( String.Format( "{0} {1}", index == 210 ? "BC" : "SM", text ) );
InvokeCommand($"{(index == 210 ? "BC" : "SM")} {text}");
}
break;
@ -1887,7 +1890,7 @@ namespace Server.Gumps
if ( count == 0 )
notice = "Nobody without access was found to disconnect.";
else
notice = String.Format( "Number of players disconnected: {0}", count );
notice = $"Number of players disconnected: {count}";
}
else
{
@ -1927,7 +1930,7 @@ namespace Server.Gumps
if ( string.IsNullOrEmpty(match) )
{
notice = String.Format( "You must enter {0} to search.", forName ? "a name" : "an ip address" );
notice = $"You must enter {(forName ? "a name" : "an ip address")} to search.";
}
else
{
@ -2045,7 +2048,7 @@ namespace Server.Gumps
else
{
dispAccount = new Account( un, pw );
notice = String.Format( "{0} : Account added.", un );
notice = $"{un} : Account added.";
CommandLogging.WriteLine( from, "{0} {1} adding new account: {2}", from.AccessLevel, CommandLogging.Format( from ), un );
}
}
@ -2096,7 +2099,8 @@ namespace Server.Gumps
a.SetUnspecifiedBan( from );
a.Banned = ( index == 10 );
CommandLogging.WriteLine( from, "{0} {1} {3} account {2}", from.AccessLevel, CommandLogging.Format( from ), a.Username, a.Banned ? "banning" : "unbanning" );
from.SendGump( new AdminGump( from, m_PageType, m_ListPage, m_List, String.Format( "The account has been {0}.", a.Banned ? "banned" : "unbanned" ), m_State ) );
from.SendGump( new AdminGump( from, m_PageType, m_ListPage, m_List,
$"The account has been {(a.Banned ? "banned" : "unbanned")}.", m_State ) );
if ( index == 10 )
from.SendGump( new BanDurationGump( a ) );
@ -2195,7 +2199,8 @@ namespace Server.Gumps
if ( a.LoginIPs.Length > 0 )
{
from.SendGump( new WarningGump( 1060635, 30720, String.Format( "You are about to firewall {0} address{1}. Do you wish to continue?", a.LoginIPs.Length, a.LoginIPs.Length != 1 ? "s" : "" ), 0xFFC000, 420, 400, new WarningGumpCallback( FirewallShared_Callback ), a ) );
from.SendGump( new WarningGump( 1060635, 30720,
$"You are about to firewall {a.LoginIPs.Length} address{(a.LoginIPs.Length != 1 ? "s" : "")}. Do you wish to continue?", 0xFFC000, 420, 400, new WarningGumpCallback( FirewallShared_Callback ), a ) );
}
else
{
@ -2241,7 +2246,7 @@ namespace Server.Gumps
a.IPRestrictions = newList;
notice = String.Format( "{0} : Added to restriction list.", ip );
notice = $"{ip} : Added to restriction list.";
}
}
@ -2287,7 +2292,8 @@ namespace Server.Gumps
if ( !(m_State is Account a) )
break;
from.SendGump( new WarningGump( 1060635, 30720, String.Format( "<center>Account of {0}</center><br>You are about to <em><basefont color=red>permanently delete</basefont></em> the account. Likewise, all characters on the account will be deleted, including equipped, inventory, and banked items. Any houses tied to the account will be demolished.<br><br>Do you wish to continue?", a.Username ), 0xFFC000, 420, 280, new WarningGumpCallback( AccountDelete_Callback ), m_State ) );
from.SendGump( new WarningGump( 1060635, 30720,
$"<center>Account of {a.Username}</center><br>You are about to <em><basefont color=red>permanently delete</basefont></em> the account. Likewise, all characters on the account will be deleted, including equipped, inventory, and banked items. Any houses tied to the account will be demolished.<br><br>Do you wish to continue?", 0xFFC000, 420, 280, new WarningGumpCallback( AccountDelete_Callback ), m_State ) );
break;
}
case 26: // View all shared accounts
@ -2303,7 +2309,8 @@ namespace Server.Gumps
break;
if ( rads.Count > 0 )
from.SendGump( new WarningGump( 1060635, 30720, String.Format( "You are about to ban {0} marked account{1}. Be cautioned, the only way to reverse this is by hand--manually unbanning each account.<br><br>Do you wish to continue?", rads.Count, rads.Count == 1 ? "" : "s" ), 0xFFC000, 420, 280, new WarningGumpCallback( Marked_Callback ), new object[]{ true, list, rads, m_ListPage } ) );
from.SendGump( new WarningGump( 1060635, 30720,
$"You are about to ban {rads.Count} marked account{(rads.Count == 1 ? "" : "s")}. Be cautioned, the only way to reverse this is by hand--manually unbanning each account.<br><br>Do you wish to continue?", 0xFFC000, 420, 280, new WarningGumpCallback( Marked_Callback ), new object[]{ true, list, rads, m_ListPage } ) );
else
from.SendGump( new NoticeGump( 1060637, 30720, "You have not yet marked any accounts. Place a check mark next to the accounts you wish to ban and then try again.", 0xFFC000, 420, 280, new NoticeGumpCallback( ResendGump_Callback ), new object[]{ list, rads, m_ListPage } ) );
@ -2433,7 +2440,8 @@ namespace Server.Gumps
if ( ips.Length == 0 )
from.SendGump( new AdminGump( from, AdminGumpPage.AccountDetails_Access_ClientIPs, 0, null, "This account has not yet been accessed.", m_State ) );
else
from.SendGump( new WarningGump( 1060635, 30720, String.Format( "You are about to clear the address list for account {0} containing {1} {2}. Do you wish to continue?", a, ips.Length, ( ips.Length == 1 ) ? "entry" : "entries" ), 0xFFC000, 420, 280, new WarningGumpCallback( RemoveLoginIPs_Callback ), a ) );
from.SendGump( new WarningGump( 1060635, 30720,
$"You are about to clear the address list for account {a} containing {ips.Length} {((ips.Length == 1) ? "entry" : "entries")}. Do you wish to continue?", 0xFFC000, 420, 280, new WarningGumpCallback( RemoveLoginIPs_Callback ), a ) );
break;
}
@ -2497,7 +2505,8 @@ namespace Server.Gumps
if ( results.Count == 1 )
from.SendGump( new AdminGump( from, AdminGumpPage.FirewallInfo, 0, null, "One match found.", results[0] ) );
else if ( results.Count > 1 )
from.SendGump( new AdminGump( from, AdminGumpPage.Firewall, 0, results, String.Format( "Search results for : {0}", match ), m_State ) );
from.SendGump( new AdminGump( from, AdminGumpPage.Firewall, 0, results,
$"Search results for : {match}", m_State ) );
else
from.SendGump( new AdminGump( from, m_PageType, m_ListPage, m_List, notice == null ? "Nothing matched your search terms." : notice, m_State ) );
@ -2523,7 +2532,8 @@ namespace Server.Gumps
CommandLogging.WriteLine( from, "{0} {1} firewalling {2}", from.AccessLevel, CommandLogging.Format( from ), toAdd );
Firewall.Add( toAdd );
from.SendGump( new AdminGump( from, AdminGumpPage.FirewallInfo, 0, null, String.Format( "{0} : Added to firewall.", toAdd ), toAdd ) );
from.SendGump( new AdminGump( from, AdminGumpPage.FirewallInfo, 0, null,
$"{toAdd} : Added to firewall.", toAdd ) );
}
break;
@ -2541,7 +2551,8 @@ namespace Server.Gumps
CommandLogging.WriteLine( from, "{0} {1} removing {2} from firewall list", from.AccessLevel, CommandLogging.Format( from ), m_State );
Firewall.Remove( m_State );
from.SendGump( new AdminGump( from, AdminGumpPage.Firewall, 0, null, String.Format( "{0} : Removed from firewall.", m_State ), null ) );
from.SendGump( new AdminGump( from, AdminGumpPage.Firewall, 0, null,
$"{m_State} : Removed from firewall.", null ) );
}
break;
@ -2724,7 +2735,8 @@ namespace Server.Gumps
if ( m_PageType == AdminGumpPage.AccountDetails_Access_ClientIPs )
{
from.SendGump( new WarningGump( 1060635, 30720, String.Format( "You are about to firewall {0}. All connection attempts from a matching IP will be refused. Are you sure?", m_List[index] ), 0xFFC000, 420, 280, new WarningGumpCallback( Firewall_Callback ), new[]{ a, m_List[index] } ) );
from.SendGump( new WarningGump( 1060635, 30720,
$"You are about to firewall {m_List[index]}. All connection attempts from a matching IP will be refused. Are you sure?", 0xFFC000, 420, 280, new WarningGumpCallback( Firewall_Callback ), new[]{ a, m_List[index] } ) );
}
else if ( m_PageType == AdminGumpPage.AccountDetails_Access_Restrictions )
{
@ -2734,7 +2746,8 @@ namespace Server.Gumps
a.IPRestrictions = (string[])list.ToArray( typeof( string ) );
from.SendGump( new AdminGump( from, AdminGumpPage.AccountDetails_Access_Restrictions, 0, null, String.Format( "{0} : Removed from list.", m_List[index] ), a ) );
from.SendGump( new AdminGump( from, AdminGumpPage.AccountDetails_Access_Restrictions, 0, null,
$"{m_List[index]} : Removed from list.", a ) );
}
}
@ -2783,7 +2796,8 @@ namespace Server.Gumps
if ( a == null )
break;
from.SendGump( new WarningGump( 1060635, 30720, String.Format( "You are about to remove address {0} from account {1}. Do you wish to continue?", ip, a ), 0xFFC000, 420, 280, new WarningGumpCallback( RemoveLoginIP_Callback ), new object[] { a, ip } ) );
from.SendGump( new WarningGump( 1060635, 30720,
$"You are about to remove address {ip} from account {a}. Do you wish to continue?", 0xFFC000, 420, 280, new WarningGumpCallback( RemoveLoginIP_Callback ), new object[] { a, ip } ) );
}
}
@ -2804,7 +2818,7 @@ namespace Server.Gumps
private void InvokeCommand( string c )
{
CommandSystem.Handle( m_From, String.Format( "{0}{1}", CommandSystem.Prefix, c ) );
CommandSystem.Handle( m_From, $"{CommandSystem.Prefix}{c}");
}
public static void GetAccountInfo( Account a, out AccessLevel accessLevel, out bool online )

View file

@ -234,7 +234,8 @@ namespace Server.Gumps
a.SetBanTags( from, DateTime.UtcNow, duration );
if ( comment != null )
a.Comments.Add( new AccountComment( from.RawName, String.Format( "Duration: {0}, Comment: {1}", (( duration == TimeSpan.MaxValue )? "Infinite" : duration.ToString()), comment ) ) );
a.Comments.Add( new AccountComment( from.RawName,
$"Duration: {((duration == TimeSpan.MaxValue) ? "Infinite" : duration.ToString())}, Comment: {comment}") );
}
if ( duration == TimeSpan.MaxValue )

View file

@ -45,12 +45,12 @@ namespace Server.Gumps
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 int GetButtonID( int typeCount, int type, int index )

View file

@ -35,7 +35,7 @@ namespace Server.Gumps
}
else
{
CommandSystem.Handle( from, String.Format( "{0}Add {1}", CommandSystem.Prefix, m_Type.Name ) );
CommandSystem.Handle( from, $"{CommandSystem.Prefix}Add {m_Type.Name}");
from.SendGump( new CategorizedAddGump( from, m_Parent, page ) );
}
@ -268,7 +268,8 @@ namespace Server.Gumps
if ( !OldStyle )
AddImageTiled( x - (OldStyle ? OffsetSize : 0), y, emptyWidth + (OldStyle ? OffsetSize * 2 : 0), EntryHeight, EntryGumpID );
AddHtml( x + TextOffsetX, y + ((EntryHeight - 20) / 2), emptyWidth - TextOffsetX, EntryHeight, String.Format( "<center>{0}</center>", m_Category.Caption ), false, false );
AddHtml( x + TextOffsetX, y + ((EntryHeight - 20) / 2), emptyWidth - TextOffsetX, EntryHeight,
$"<center>{m_Category.Caption}</center>", false, false );
x += emptyWidth + OffsetSize;

View file

@ -178,12 +178,12 @@ namespace Server.Gumps
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 ClientGump( Mobile from, NetState state, string initialText ) : base( 30, 20 )
@ -232,10 +232,10 @@ namespace Server.Gumps
if ( m != null )
{
AddHtml( 14, 36 + (line * 20), 200, 20, Color( "Mobile:", LabelColor32 ), false, false );
AddHtml( 70, 36 + (line++ * 20), 200, 20, Color( String.Format( "{0} (0x{1:X})", m.Name, m.Serial.Value ), LabelColor32 ), false, false );
AddHtml( 70, 36 + (line++ * 20), 200, 20, Color($"{m.Name} (0x{m.Serial.Value:X})", LabelColor32 ), false, false );
AddHtml( 14, 36 + (line * 20), 200, 20, Color( "Location:", LabelColor32 ), false, false );
AddHtml( 70, 36 + (line++ * 20), 200, 20, Color( String.Format( "{0} [{1}]", m.Location, m.Map ), LabelColor32 ), false, false );
AddHtml( 70, 36 + (line++ * 20), 200, 20, Color($"{m.Location} [{m.Map}]", LabelColor32 ), false, false );
AddButton( 13, 157, 0xFAB, 0xFAD, 1, GumpButtonType.Reply, 0 );
AddHtml( 48, 158, 200, 20, Color( "Send Message", LabelColor32 ), false, false );

View file

@ -46,7 +46,7 @@ namespace Server.Gumps
AddImageTiled( 0, 0, 410, 448, 0xA40 );
AddAlphaRegion( 1, 1, 408, 446 );
string title = String.Format( "Comments for '{0}'", acct.Username );
string title = $"Comments for '{acct.Username}'";
int x = 205 - ((title.Length / 2) * 7);
if ( x < 120 )
x = 120;
@ -72,7 +72,8 @@ namespace Server.Gumps
AddLabel( 48, 12, 2100, "Prev Page" );
}
string html = String.Format( "[Added By: {0} on {1}]<br>{2}", comment.AddedBy, comment.LastModified.ToString( "H:mm M/d/yy" ), comment.Content );
string html =
$"[Added By: {comment.AddedBy} on {comment.LastModified.ToString("H:mm M/d/yy")}]<br>{comment.Content}";
AddHtml( 12, 44 + ((i % 5) * 80), 386, 70, html, true, true );
}
}

View file

@ -137,7 +137,7 @@ namespace Server.Gumps
if ( !OldStyle )
AddImageTiled( x - (OldStyle ? OffsetSize : 0), y, emptyWidth + (OldStyle ? OffsetSize * 2 : 0), EntryHeight, EntryGumpID );
AddHtml( x + TextOffsetX, y, emptyWidth - TextOffsetX, EntryHeight, String.Format( "<center>{0}</center>", node.Name ), false, false );
AddHtml( x + TextOffsetX, y, emptyWidth - TextOffsetX, EntryHeight, $"<center>{node.Name}</center>", false, false );
x += emptyWidth + OffsetSize;

View file

@ -12,7 +12,7 @@ namespace Server.Gumps
protected override void Design()
{
AddHtml( 20, 10, 500, 35, String.Format( "<center>{0}</center>", m_Guild.Name ), false, false );
AddHtml( 20, 10, 500, 35, $"<center>{m_Guild.Name}</center>", false, false );
AddButton( 20, 400, 4005, 4007, 1, GumpButtonType.Reply, 0 );
AddHtmlLocalized( 55, 400, 300, 35, 1011120, false, false ); // Return to the main menu.

View file

@ -136,7 +136,7 @@ namespace Server.Guilds
public static string Color( string text, int color )
{
return String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", color, text );
return $"<BASEFONT COLOR=#{color:X6}>{text}</BASEFONT>";
}
}
}

View file

@ -21,7 +21,7 @@ namespace Server.Guilds
AddBackground( 0, 0, 350, 170, 0x2422 );
AddHtmlLocalized( 25, 20, 300, 45, 1062946, 0x0, true, false ); // <center>You have been invited to join a guild! (Warning: Accepting will make you attackable!)</center>
AddHtml( 25, 75, 300, 25, String.Format( "<center>{0}</center>", guild.Name ), true, false );
AddHtml( 25, 75, 300, 25, $"<center>{guild.Name}</center>", true, false );
AddButton( 265, 130, 0xF7, 0xF8, 1, GumpButtonType.Reply, 0 );
AddButton( 195, 130, 0xF2, 0xF1, 0, GumpButtonType.Reply, 0 );
AddButton( 20, 130, 0xD2, 0xD3, 2, GumpButtonType.Reply, 0 );
@ -38,14 +38,14 @@ namespace Server.Guilds
{
case 0:
{
m_Inviter.SendLocalizedMessage( 1063250, String.Format( "{0}\t{1}", player.Name, guild.Name ) ); // ~1_val~ has declined your invitation to join ~2_val~.
m_Inviter.SendLocalizedMessage( 1063250, $"{player.Name}\t{guild.Name}"); // ~1_val~ has declined your invitation to join ~2_val~.
break;
}
case 1:
{
guild.AddMember( player );
player.SendLocalizedMessage( 1063056, guild.Name ); // You have joined ~1_val~.
m_Inviter.SendLocalizedMessage( 1063249, String.Format( "{0}\t{1}", player.Name, guild.Name ) ); // ~1_val~ has accepted your invitation to join ~2_val~.
m_Inviter.SendLocalizedMessage( 1063249, $"{player.Name}\t{guild.Name}"); // ~1_val~ has accepted your invitation to join ~2_val~.
break;
}

View file

@ -142,7 +142,7 @@ namespace Server.Guilds
{
TextDefinition[] defs = new TextDefinition[aryLength];
string name = String.Format( "{0}{1}", pm.Name, ( player.GuildFealty == pm && player.GuildFealty != guild.Leader ) ? " *" : "" );
string name = $"{pm.Name}{((player.GuildFealty == pm && player.GuildFealty != guild.Leader) ? " *" : "")}";
if ( pm == player )
name = Color( name, 0x006600 );

View file

@ -77,7 +77,7 @@ namespace Server.Guilds
if ( ActiveWar )
{
kills = String.Format( "{0}/{1}", activeWar.Kills, activeWar.MaxKills );
kills = $"{activeWar.Kills}/{activeWar.MaxKills}";
TimeSpan timeRemaining = TimeSpan.Zero;
@ -85,21 +85,21 @@ namespace Server.Guilds
timeRemaining = (activeWar.WarBeginning + activeWar.WarLength) - DateTime.UtcNow;
//time = String.Format( "{0:D2}:{1:D2}", timeRemaining.Hours.ToString(), timeRemaining.Subtract( TimeSpan.FromHours( timeRemaining.Hours ) ).Minutes ); //Is there a formatter for htis? it's 2AM and I'm tired and can't find it
time = String.Format( "{0:D2}:{1:mm}", timeRemaining.Hours, DateTime.MinValue + timeRemaining );
time = $"{timeRemaining.Hours:D2}:{DateTime.MinValue + timeRemaining:mm}";
otherWar = m_Other.FindActiveWar( guild );
if ( otherWar != null )
otherKills = String.Format( "{0}/{1}", otherWar.Kills, otherWar.MaxKills );
otherKills = $"{otherWar.Kills}/{otherWar.MaxKills}";
}
else if ( PendingWar )
{
kills = Color( String.Format( "{0}/{1}", war.Kills, war.MaxKills ), 0x990000 );
kills = Color($"{war.Kills}/{war.MaxKills}", 0x990000 );
//time = Color( String.Format( "{0}:{1}", war.WarLength.Hours, ((TimeSpan)(war.WarLength - TimeSpan.FromHours( war.WarLength.Hours ))).Minutes ), 0xFF0000 );
time = Color( String.Format( "{0:D2}:{1:mm}", war.WarLength.Hours, DateTime.MinValue + war.WarLength ), 0x990000 );
time = Color($"{war.WarLength.Hours:D2}:{DateTime.MinValue + war.WarLength:mm}", 0x990000 );
otherWar = m_Other.FindPendingWar( guild );
if ( otherWar != null )
otherKills = Color( String.Format( "{0}/{1}", otherWar.Kills, otherWar.MaxKills ), 0x990000 );
otherKills = Color($"{otherWar.Kills}/{otherWar.MaxKills}", 0x990000 );
}
AddHtmlLocalized( 280, 110, 120, 26, 1062966, 0x0, true, false ); // <i>Your Kills</i>
@ -225,7 +225,7 @@ namespace Server.Guilds
}
else if ( alliance != null && alliance.Leader != guild )
{
pm.SendLocalizedMessage( 1063239, String.Format( "{0}\t{1}", guild.Name, alliance.Name ) ); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1063239, $"{guild.Name}\t{alliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1070707, alliance.Leader.Name ); // You need to negotiate via ~1_val~ instead.
}
else
@ -276,7 +276,7 @@ namespace Server.Guilds
}
else if ( alliance != null && alliance.Leader != guild )
{
pm.SendLocalizedMessage( 1063239, String.Format( "{0}\t{1}", guild.Name, alliance.Name ) ); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1063239, $"{guild.Name}\t{alliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1070707, alliance.Leader.Name ); // You need to negotiate via ~1_val~ instead.
}
else
@ -296,7 +296,7 @@ namespace Server.Guilds
}
else if ( alliance != null && alliance.Leader != guild )
{
pm.SendLocalizedMessage( 1063239, String.Format( "{0}\t{1}", guild.Name, alliance.Name ) ); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1063239, $"{guild.Name}\t{alliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1070707, alliance.Leader.Name ); // You need to negotiate via ~1_val~ instead.
}
else
@ -318,7 +318,7 @@ namespace Server.Guilds
}
else if ( alliance != null && alliance.Leader != guild )
{
pm.SendLocalizedMessage( 1063239, String.Format( "{0}\t{1}", guild.Name, alliance.Name ) ); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1063239, $"{guild.Name}\t{alliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1070707, alliance.Leader.Name ); // You need to negotiate via ~1_val~ instead.
}
else
@ -364,12 +364,12 @@ namespace Server.Guilds
}
else if ( alliance != null && alliance.Leader != guild )
{
pm.SendLocalizedMessage( 1063239, String.Format( "{0}\t{1}", guild.Name, alliance.Name ) ); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1063239, $"{guild.Name}\t{alliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1070707, alliance.Leader.Name ); // You need to negotiate via ~1_val~ instead.
}
else if ( otherAlliance != null && otherAlliance.Leader != m_Other )
{
pm.SendLocalizedMessage( 1063239, String.Format( "{0}\t{1}", m_Other.Name, otherAlliance.Name ) ); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1063239, $"{m_Other.Name}\t{otherAlliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1070707, otherAlliance.Leader.Name ); // You need to negotiate via ~1_val~ instead.
}
else
@ -424,7 +424,7 @@ namespace Server.Guilds
}
else if ( alliance.Leader != guild )
{
pm.SendLocalizedMessage( 1063239, String.Format( "{0}\t{1}", guild.Name, alliance.Name ) ); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1063239, $"{guild.Name}\t{alliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
}
else if ( otherAlliance != null )
{
@ -494,7 +494,7 @@ namespace Server.Guilds
}
else if ( alliance != null && alliance.Leader != guild )
{
pm.SendLocalizedMessage( 1063239, String.Format( "{0}\t{1}", guild.Name, alliance.Name ) ); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1063239, $"{guild.Name}\t{alliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
}
else if ( alliance != null && alliance.IsMember( guild ) && alliance.IsMember( m_Other ) )
{
@ -514,11 +514,11 @@ namespace Server.Guilds
}
else if ( alliance != null && alliance.Leader != guild )
{
pm.SendLocalizedMessage( 1063239, String.Format( "{0}\t{1}", guild.Name, alliance.Name ) ); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1063239, $"{guild.Name}\t{alliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
}
else if ( alliance != null && alliance.IsMember( guild ) && alliance.IsMember( m_Other ) )
{
pm.SendLocalizedMessage( 1063434, String.Format( "{0}\t{1}", m_Other.Name, alliance.Name ) ); // ~1_val~ is now the leader of ~2_val~.
pm.SendLocalizedMessage( 1063434, $"{m_Other.Name}\t{alliance.Name}"); // ~1_val~ is now the leader of ~2_val~.
alliance.Leader = m_Other;
}

View file

@ -59,12 +59,12 @@ namespace Server.Guilds
}
else if ( alliance != null && alliance.Leader != guild )
{
pm.SendLocalizedMessage( 1063239, String.Format( "{0}\t{1}", guild.Name, alliance.Name ) ); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1063239, $"{guild.Name}\t{alliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1070707, alliance.Leader.Name ); // You need to negotiate via ~1_val~ instead.
}
else if ( otherAlliance != null && otherAlliance.Leader != m_Other )
{
pm.SendLocalizedMessage( 1063239, String.Format( "{0}\t{1}", m_Other.Name, otherAlliance.Name ) ); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1063239, $"{m_Other.Name}\t{otherAlliance.Name}"); // ~1_val~ is not the leader of the ~2_val~ alliance.
pm.SendLocalizedMessage( 1070707, otherAlliance.Leader.Name ); // You need to negotiate via ~1_val~ instead.
}
else

View file

@ -55,7 +55,8 @@ namespace Server.Gumps
if ( m == null || (name = m.Name) == null || (name = name.Trim()).Length <= 0 )
continue;
AddLabel( 55, 55 + ((i % 16) * 20), 0, accountOf && m.Player && m.Account != null ? String.Format( "Account of {0}", name ) : name );
AddLabel( 55, 55 + ((i % 16) * 20), 0, accountOf && m.Player && m.Account != null ? $"Account of {name}"
: name );
}
}
}
@ -132,7 +133,8 @@ namespace Server.Gumps
continue;
AddCheck( 34, 52 + ((i % 15) * 20), 0xD2, 0xD3, false, i );
AddLabel( 55, 52 + ((i % 15) * 20), 0, accountOf && m.Player && m.Account != null ? String.Format( "Account of {0}", name ) : name );
AddLabel( 55, 52 + ((i % 15) * 20), 0, accountOf && m.Player && m.Account != null ? $"Account of {name}"
: name );
}
}
}

View file

@ -381,7 +381,7 @@ namespace Server.Gumps
if ( bonusStorage > 0 )
{
AddHtmlLocalized( 10, 150, 300, 20, 1072519, LabelColor, false, false ); // Increased Storage
AddLabel( 310, 150, LabelHue, String.Format( "{0}%", bonusStorage ) );
AddLabel( 310, 150, LabelHue, $"{bonusStorage}%");
}
AddHtmlLocalized( 10, 170, 300, 20, 1060683, LabelColor, false, false ); // Maximum Secure Storage

View file

@ -30,7 +30,7 @@ namespace Server.Gumps
if ( content is int i )
AddHtmlLocalized( 10, 40, width - 20, height - 80, i, contentColor, false, true );
else if ( content is string )
AddHtml( 10, 40, width - 20, height - 80, String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", contentColor, content ), false, true );
AddHtml( 10, 40, width - 20, height - 80, $"<BASEFONT COLOR=#{contentColor:X6}>{content}</BASEFONT>", false, true );
AddImageTiled( 10, height - 30, width - 20, 20, 2624 );
AddAlphaRegion( 10, height - 30, width - 20, 20 );

View file

@ -33,7 +33,7 @@ namespace Server.Gumps
AddItem( 218, 95, 0xCB0 );
AddHtmlLocalized( 30, 30, 150, 75, 1049665, false, false ); // <div align=center>Wilt thou sanctify the resurrection of:</div>
AddHtml( 30, 70, 150, 25, String.Format( "<div align=CENTER>{0}</div>", pet.Name ), true, false );
AddHtml( 30, 70, 150, 25, $"<div align=CENTER>{pet.Name}</div>", true, false );
AddButton( 40, 105, 0x81A, 0x81B, 0x1, GumpButtonType.Reply, 0 ); // Okay
AddButton( 110, 105, 0x819, 0x818, 0x2, GumpButtonType.Reply, 0 ); // Cancel

View file

@ -209,7 +209,8 @@ namespace Server.Gumps
{
rentedVendor.ComputeRentalExpireDelay( out var days, out var hours );
AddLabel( 38, 132, 0x480, String.Format( "Location rental will expire in {0} day{1} and {2} hour{3}.", days, days != 1 ? "s" : "", hours, hours != 1 ? "s" : "" ) );
AddLabel( 38, 132, 0x480,
$"Location rental will expire in {days} day{(days != 1 ? "s" : "")} and {hours} hour{(hours != 1 ? "s" : "")}.");
}
AddButton( 390, 24, 0x15E1, 0x15E5, 1, GumpButtonType.Reply, 0 );

View file

@ -175,7 +175,8 @@ namespace Server.Gumps
AddImageTiled( x, y, emptyWidth, EntryHeight, HeaderGumpID );
if ( TypeLabel && m_Type != null )
AddHtml( x, y, emptyWidth, EntryHeight, String.Format( "<BASEFONT COLOR=#FAFAFA><CENTER>{0}</CENTER></BASEFONT>", m_Type.Name ), false, false );
AddHtml( x, y, emptyWidth, EntryHeight,
$"<BASEFONT COLOR=#FAFAFA><CENTER>{m_Type.Name}</CENTER></BASEFONT>", false, false );
x += emptyWidth + OffsetSize;
@ -445,7 +446,7 @@ namespace Server.Gumps
}
catch ( Exception e )
{
return String.Format( "!{0}!", e.GetType() );
return $"!{e.GetType()}!";
}
}
@ -457,7 +458,7 @@ namespace Server.Gumps
}
if ( o is string s )
{
return String.Format( "\"{0}\"", s );
return $"\"{s}\"";
}
if ( o is bool )
{
@ -465,7 +466,7 @@ namespace Server.Gumps
}
if ( o is char c )
{
return String.Format( "0x{0:X} '{1}'", (int)c, c );
return $"0x{(int) c:X} '{c}'";
}
if ( o is Serial serial )
{
@ -473,15 +474,15 @@ namespace Server.Gumps
{
if ( serial.IsItem )
{
return String.Format( "(I) 0x{0:X}", serial.Value );
return $"(I) 0x{serial.Value:X}";
}
if ( serial.IsMobile )
{
return String.Format( "(M) 0x{0:X}", serial.Value );
return $"(M) 0x{serial.Value:X}";
}
}
return String.Format( "(?) 0x{0:X}", serial.Value );
return $"(?) 0x{serial.Value:X}";
}
if ( o is byte || o is sbyte || o is short || o is ushort || o is int || o is uint || o is long || o is ulong )
{
@ -489,11 +490,11 @@ namespace Server.Gumps
}
if ( o is Mobile mobile )
{
return String.Format( "(M) 0x{0:X} \"{1}\"", mobile.Serial.Value, mobile.Name );
return $"(M) 0x{mobile.Serial.Value:X} \"{mobile.Name}\"";
}
if ( o is Item item )
{
return String.Format( "(I) 0x{0:X}", item.Serial.Value );
return $"(I) 0x{item.Serial.Value:X}";
}
if ( o is Type type )
{
@ -641,7 +642,7 @@ namespace Server.Gumps
}
if ( o is string s )
{
return String.Format( "\"{0}\"", s );
return $"\"{s}\"";
}
if ( o is bool )
{
@ -649,7 +650,7 @@ namespace Server.Gumps
}
if ( o is char c )
{
return String.Format( "0x{0:X} '{1}'", (int)c, c );
return $"0x{(int) c:X} '{c}'";
}
if ( o is Serial serial )
{
@ -657,15 +658,15 @@ namespace Server.Gumps
{
if ( serial.IsItem )
{
return String.Format( "(I) 0x{0:X}", serial.Value );
return $"(I) 0x{serial.Value:X}";
}
if ( serial.IsMobile )
{
return String.Format( "(M) 0x{0:X}", serial.Value );
return $"(M) 0x{serial.Value:X}";
}
}
return String.Format( "(?) 0x{0:X}", serial.Value );
return $"(?) 0x{serial.Value:X}";
}
if ( o is byte || o is sbyte || o is short || o is ushort || o is int || o is uint || o is long || o is ulong )
{
@ -673,11 +674,11 @@ namespace Server.Gumps
}
if ( o is Mobile mobile )
{
return String.Format( "(M) 0x{0:X} \"{1}\"", mobile.Serial.Value, mobile.Name );
return $"(M) 0x{mobile.Serial.Value:X} \"{mobile.Name}\"";
}
if ( o is Item item )
{
return String.Format( "(I) 0x{0:X}", item.Serial.Value );
return $"(I) 0x{item.Serial.Value:X}";
}
if ( o is Type type )
{

View file

@ -30,12 +30,12 @@ namespace Server.Gumps
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 AddTypeButton( int x, int y, int buttonID, string text, ModelBodyType type )

View file

@ -138,8 +138,8 @@ namespace Server.Gumps
if ( Sextant.Format( e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) )
{
AddLabel( 135 + (half * 160), 80, 0, String.Format( "{0}<7D> {1}'{2}", yLat, yMins, ySouth ? "S" : "N" ) );
AddLabel( 135 + (half * 160), 95, 0, String.Format( "{0}<7D> {1}'{2}", xLong, xMins, xEast ? "E" : "W" ) );
AddLabel( 135 + (half * 160), 80, 0, $"{yLat}<7D> {yMins}'{(ySouth ? "S" : "N")}");
AddLabel( 135 + (half * 160), 95, 0, $"{xLong}<7D> {xMins}'{(xEast ? "E" : "W")}");
}
// Drop rune button
@ -309,7 +309,8 @@ namespace Server.Gumps
if ( Sextant.Format( e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) )
{
string location = String.Format( "{0}<7D> {1}'{2}, {3}<7D> {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" );
string location =
$"{yLat}<7D> {yMins}'{(ySouth ? "S" : "N")}, {xLong}<7D> {xMins}'{(xEast ? "E" : "W")}";
from.SendMessage( location );
}
@ -364,7 +365,8 @@ namespace Server.Gumps
if ( Sextant.Format( e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) )
{
string location = String.Format( "{0}<7D> {1}'{2}, {3}<7D> {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" );
string location =
$"{yLat}<7D> {yMins}'{(ySouth ? "S" : "N")}, {xLong}<7D> {xMins}'{(xEast ? "E" : "W")}";
from.SendMessage( location );
}
@ -390,7 +392,8 @@ namespace Server.Gumps
if ( Sextant.Format( e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) )
{
string location = String.Format( "{0}<7D> {1}'{2}, {3}<7D> {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" );
string location =
$"{yLat}<7D> {yMins}'{(ySouth ? "S" : "N")}, {xLong}<7D> {xMins}'{(xEast ? "E" : "W")}";
from.SendMessage( location );
}
@ -418,7 +421,8 @@ namespace Server.Gumps
if ( Sextant.Format( e.Location, e.Map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth ) )
{
string location = String.Format( "{0}<7D> {1}'{2}, {3}<7D> {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" );
string location =
$"{yLat}<7D> {yMins}'{(ySouth ? "S" : "N")}, {xLong}<7D> {xMins}'{(xEast ? "E" : "W")}";
from.SendMessage( location );
}

View file

@ -68,7 +68,7 @@ namespace Server.Gumps
if ( text != null )
{
m_Skill.Base = Convert.ToDouble( text.Text );
CommandLogging.LogChangeProperty( m_From, m_Target, String.Format( "{0}.Base", m_Skill ), m_Skill.Base.ToString() );
CommandLogging.LogChangeProperty( m_From, m_Target, $"{m_Skill}.Base", m_Skill.Base.ToString() );
}
}
else

View file

@ -33,7 +33,7 @@ namespace Server.Gumps
if ( inventory.Owner == from )
AddButton( 10, y, 0xFA5, 0xFA7, i + 1, GumpButtonType.Reply, 0 );
AddLabel( 45, y, 0x481, String.Format( "{0} ({1})", inventory.ShopName, inventory.VendorName ) );
AddLabel( 45, y, 0x481, $"{inventory.ShopName} ({inventory.VendorName})");
TimeSpan expire = inventory.ExpireTime - DateTime.UtcNow;
int hours = (int) expire.TotalHours;

View file

@ -108,7 +108,7 @@ namespace Server.Gumps
object name = FindHouseName( list[i] );
AddHtml( 15, 40 + ((i % 15) * 20), 20, 20, Color( String.Format( "{0}.", i+1 ), White ), false, false );
AddHtml( 15, 40 + ((i % 15) * 20), 20, 20, Color($"{i + 1}.", White ), false, false );
if ( name is int nameInt )
AddHtmlLocalized( 35, 40 + ((i % 15) * 20), 160, 20, nameInt, White16, false, false );
@ -132,7 +132,7 @@ namespace Server.Gumps
bool valid = Sextant.Format( sel.Location, map, ref xLong, ref yLat, ref xMins, ref yMins, ref xEast, ref ySouth );
if ( valid )
location = String.Format( "{0}° {1}'{2}, {3}° {4}'{5}", yLat, yMins, ySouth ? "S" : "N", xLong, xMins, xEast ? "E" : "W" );
location = $"{yLat}° {yMins}'{(ySouth ? "S" : "N")}, {xLong}° {xMins}'{(xEast ? "E" : "W")}";
else
location = "unknown";
@ -277,17 +277,17 @@ namespace Server.Gumps
public string Right( string text )
{
return String.Format( "<div align=right>{0}</div>", text );
return $"<div align=right>{text}</div>";
}
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 AddBlackAlpha( int x, int y, int width, int height )

View file

@ -37,7 +37,7 @@ namespace Server.Gumps
if ( content is int i )
AddHtmlLocalized( 10, 40, width - 20, height - 80, i, contentColor, false, true );
else if ( content is string )
AddHtml( 10, 40, width - 20, height - 80, String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", contentColor, content ), false, true );
AddHtml( 10, 40, width - 20, height - 80, $"<BASEFONT COLOR=#{contentColor:X6}>{content}</BASEFONT>", false, true );
AddImageTiled( 10, height - 30, width - 20, 20, 2624 );
AddAlphaRegion( 10, height - 30, width - 20, 20 );

View file

@ -167,7 +167,8 @@ namespace Server.Gumps
if ( !OldStyle )
AddImageTiled( x - (OldStyle ? OffsetSize : 0), y, emptyWidth + (OldStyle ? OffsetSize * 2 : 0), EntryHeight, EntryGumpID );
AddLabel( x + TextOffsetX, y, TextHue, String.Format( "Page {0} of {1} ({2})", page+1, (m_Mobiles.Count + EntryCount - 1) / EntryCount, m_Mobiles.Count ) );
AddLabel( x + TextOffsetX, y, TextHue,
$"Page {page + 1} of {(m_Mobiles.Count + EntryCount - 1) / EntryCount} ({m_Mobiles.Count})");
x += emptyWidth + OffsetSize;