Fixes string interpolation
This commit is contained in:
parent
42d0b6271f
commit
7d3a0ca265
233 changed files with 758 additions and 690 deletions
|
|
@ -655,7 +655,7 @@ namespace Server.Engines.BulkOrders
|
|||
else
|
||||
AddLabel( 316, y, 1152, name.ToString() );
|
||||
|
||||
AddLabel( 421, y, 1152, String.Format( "{0} / {1}", sub.AmountCur, entry.AmountMax ) );
|
||||
AddLabel( 421, y, 1152, $"{sub.AmountCur} / {entry.AmountMax}");
|
||||
|
||||
++tableIndex;
|
||||
y += 32;
|
||||
|
|
@ -692,7 +692,7 @@ namespace Server.Engines.BulkOrders
|
|||
else
|
||||
AddLabel( 316, y, 1152, name.ToString() );
|
||||
|
||||
AddLabel( 421, y, 1152, String.Format( "{0} / {1}", smallEntry.AmountCur, smallEntry.AmountMax ) );
|
||||
AddLabel( 421, y, 1152, $"{smallEntry.AmountCur} / {smallEntry.AmountMax}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -47,7 +47,7 @@ namespace Server.Engines.BulkOrders
|
|||
|
||||
public static SmallBulkEntry[] LoadEntries( string type, string name )
|
||||
{
|
||||
return LoadEntries( String.Format( "Data/Bulk Orders/{0}/{1}.cfg", type, name ) );
|
||||
return LoadEntries($"Data/Bulk Orders/{type}/{name}.cfg");
|
||||
}
|
||||
|
||||
public static SmallBulkEntry[] LoadEntries( string path )
|
||||
|
|
|
|||
|
|
@ -15,12 +15,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private const int LabelColor32 = 0xFFFFFF;
|
||||
|
|
|
|||
|
|
@ -248,12 +248,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, string text, int color, int borderColor )
|
||||
|
|
|
|||
|
|
@ -7,12 +7,12 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
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>";
|
||||
}
|
||||
|
||||
private const int LabelColor32 = 0xFFFFFF;
|
||||
|
|
|
|||
|
|
@ -459,7 +459,8 @@ namespace Server.Engines.ConPVP
|
|||
pl.Eliminated = true;
|
||||
|
||||
mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have forfeited your position in the duel." );
|
||||
mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has forfeited by leaving the dueling arena.", mob.Name ) );
|
||||
mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false,
|
||||
$"{mob.Name} has forfeited by leaving the dueling arena.");
|
||||
|
||||
Participant winner = CheckCompletion();
|
||||
|
||||
|
|
@ -498,7 +499,7 @@ namespace Server.Engines.ConPVP
|
|||
else if ( !m_Yielding )
|
||||
{
|
||||
mob.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have been defeated." );
|
||||
mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has been defeated.", mob.Name ) );
|
||||
mob.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, $"{mob.Name} has been defeated.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1176,7 +1177,8 @@ namespace Server.Engines.ConPVP
|
|||
if ( entry == null )
|
||||
return; // sanity
|
||||
|
||||
string text = String.Format( "{{0}} are ranked {0} at level {1}.", LadderGump.Rank( entry.Index + 1 ), Ladder.GetLevel( entry.Experience ) );
|
||||
string text =
|
||||
$"{{0}} are ranked {LadderGump.Rank(entry.Index + 1)} at level {Ladder.GetLevel(entry.Experience)}.";
|
||||
|
||||
pm.PrivateOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, from==pm?"You":"They" ), from.NetState );
|
||||
}
|
||||
|
|
@ -1267,7 +1269,8 @@ namespace Server.Engines.ConPVP
|
|||
if ( entry == null )
|
||||
return; // sanity
|
||||
|
||||
string text = String.Format( "{{0}} {{1}} ranked {0} at level {1}.", LadderGump.Rank( entry.Index + 1 ), Ladder.GetLevel( entry.Experience ) );
|
||||
string text =
|
||||
$"{{0}} {{1}} ranked {LadderGump.Rank(entry.Index + 1)} at level {Ladder.GetLevel(entry.Experience)}.";
|
||||
|
||||
pm.LocalOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, "You", "are" ) );
|
||||
pm.NonlocalOverheadMessage( MessageType.Regular, pm.SpeechHue, true, String.Format( text, pm.Name, "is" ) );
|
||||
|
|
@ -1474,7 +1477,7 @@ namespace Server.Engines.ConPVP
|
|||
else
|
||||
{
|
||||
pm.LocalOverheadMessage( MessageType.Regular, 0x22, false, "You have yielded." );
|
||||
pm.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, String.Format( "{0} has yielded.", pm.Name ) );
|
||||
pm.NonlocalOverheadMessage( MessageType.Regular, 0x22, false, $"{pm.Name} has yielded.");
|
||||
|
||||
pm.DuelContext.m_Yielding=true;
|
||||
pm.Kill();
|
||||
|
|
@ -2325,21 +2328,21 @@ namespace Server.Engines.ConPVP
|
|||
return "a slot is empty";
|
||||
|
||||
if ( dp.Mobile.Region.IsPartOf( typeof( Regions.Jail ) ) )
|
||||
return String.Format( "{0} is in jail", dp.Mobile.Name );
|
||||
return $"{dp.Mobile.Name} is in jail";
|
||||
|
||||
if ( Sigil.ExistsOn( dp.Mobile ) )
|
||||
return String.Format( "{0} is holding a sigil", dp.Mobile.Name );
|
||||
return $"{dp.Mobile.Name} is holding a sigil";
|
||||
|
||||
if ( !dp.Mobile.Alive )
|
||||
{
|
||||
if ( m_Tournament == null )
|
||||
return String.Format( "{0} is dead", dp.Mobile.Name );
|
||||
return $"{dp.Mobile.Name} is dead";
|
||||
else
|
||||
dp.Mobile.Resurrect();
|
||||
}
|
||||
|
||||
if ( m_Tournament == null && CheckCombat( dp.Mobile ) )
|
||||
return String.Format( "{0} is in combat", dp.Mobile.Name );
|
||||
return $"{dp.Mobile.Name} is in combat";
|
||||
|
||||
if ( dp.Mobile.Mounted )
|
||||
{
|
||||
|
|
@ -2348,7 +2351,7 @@ namespace Server.Engines.ConPVP
|
|||
if ( m_Tournament != null && mount != null )
|
||||
mount.Rider = null;
|
||||
else
|
||||
return String.Format( "{0} is mounted", dp.Mobile.Name );
|
||||
return $"{dp.Mobile.Name} is mounted";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public void AddGoldenButton( int x, int y, int bid )
|
||||
|
|
|
|||
|
|
@ -991,12 +991,12 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -1137,7 +1137,7 @@ namespace Server.Engines.ConPVP
|
|||
break;
|
||||
}
|
||||
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, String.Format( "{0}: {1}", LadderGump.Rank( 1 + i ), teamInfo.Name ), nameColor, borderColor );
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name}", nameColor, borderColor );
|
||||
|
||||
AddBorderedText( 50 + 10, 85 + ( i * 75 ), 100, 20, "Score:", 0xFFC000, BlackColor32 );
|
||||
AddBorderedText( 50 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Score.ToString( "N0" ), 0xFFC000, BlackColor32 );
|
||||
|
|
@ -1266,7 +1266,7 @@ namespace Server.Engines.ConPVP
|
|||
return res;
|
||||
}
|
||||
|
||||
public string Name => String.Format( "{0} Team", m_Name );
|
||||
public string Name => $"{m_Name} Team";
|
||||
|
||||
public BRGame Game { get => m_Game;
|
||||
set => m_Game = value;
|
||||
|
|
@ -1399,7 +1399,7 @@ namespace Server.Engines.ConPVP
|
|||
public override string ToString()
|
||||
{
|
||||
if ( m_Name != null )
|
||||
return String.Format( "({0}) ...", Name );
|
||||
return $"({Name}) ...";
|
||||
else
|
||||
return "...";
|
||||
}
|
||||
|
|
@ -1848,7 +1848,7 @@ namespace Server.Engines.ConPVP
|
|||
if ( pl == leader )
|
||||
item.ItemID = 4810;
|
||||
|
||||
item.Name = String.Format( "{0}, {1} team", item.Name, ((BRTeamInfo)teams[i]).Name.ToLower() );
|
||||
item.Name = $"{item.Name}, {((BRTeamInfo) teams[i]).Name.ToLower()} team";
|
||||
|
||||
if ( !mob.PlaceInBackpack( item ) )
|
||||
mob.BankBox.DropItem( item );
|
||||
|
|
|
|||
|
|
@ -55,12 +55,12 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -199,7 +199,7 @@ namespace Server.Engines.ConPVP
|
|||
break;
|
||||
}
|
||||
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, String.Format( "{0}: {1} Team", LadderGump.Rank( 1 + i ), teamInfo.Name ), nameColor, borderColor );
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name} Team", nameColor, borderColor );
|
||||
|
||||
AddBorderedText( 50 + 10, 85 + ( i * 75 ), 100, 20, "Score:", 0xFFC000, BlackColor32 );
|
||||
AddBorderedText( 50 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Score.ToString( "N0" ), 0xFFC000, BlackColor32 );
|
||||
|
|
@ -451,7 +451,8 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
else if ( passTeam == useTeam && passTo.PlaceInBackpack( this ) )
|
||||
{
|
||||
passTo.LocalOverheadMessage( MessageType.Regular, 0x59, false, String.Format( "{0} has passed you the cookies!", from.Name ) );
|
||||
passTo.LocalOverheadMessage( MessageType.Regular, 0x59, false,
|
||||
$"{@from.Name} has passed you the cookies!");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -605,7 +606,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private Dictionary<Mobile, CTFPlayerInfo> m_Players;
|
||||
|
||||
string IRankedCTF.Name => String.Format( "{0} Team", m_Name );
|
||||
string IRankedCTF.Name => $"{m_Name} Team";
|
||||
|
||||
public CTFGame Game { get => m_Game;
|
||||
set => m_Game = value;
|
||||
|
|
@ -1231,7 +1232,7 @@ namespace Server.Engines.ConPVP
|
|||
if ( pl == leader )
|
||||
item.ItemID = 4810;
|
||||
|
||||
item.Name = String.Format( "{0}, {1} team", item.Name, teams[i].Name.ToLower() );
|
||||
item.Name = $"{item.Name}, {teams[i].Name.ToLower()} team";
|
||||
|
||||
if ( !mob.PlaceInBackpack( item ) )
|
||||
mob.BankBox.DropItem( item );
|
||||
|
|
|
|||
|
|
@ -53,12 +53,12 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -195,7 +195,7 @@ namespace Server.Engines.ConPVP
|
|||
break;
|
||||
}
|
||||
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, String.Format( "{0}: {1}", LadderGump.Rank( 1 + i ), teamInfo.Name ), nameColor, borderColor );
|
||||
AddBorderedText( 60, 65 + ( i * 75 ), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name}", nameColor, borderColor );
|
||||
|
||||
AddBorderedText( 50 + 10, 85 + ( i * 75 ), 100, 20, "Score:", 0xFFC000, BlackColor32 );
|
||||
AddBorderedText( 50 + 15, 105 + ( i * 75 ), 100, 20, teamInfo.Score.ToString( "N0" ), 0xFFC000, BlackColor32 );
|
||||
|
|
@ -297,7 +297,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
private Dictionary<Mobile, DDPlayerInfo> m_Players;
|
||||
|
||||
public string Name => String.Format( "{0} Team", m_Name );
|
||||
public string Name => $"{m_Name} Team";
|
||||
|
||||
public DDGame Game { get => m_Game;
|
||||
set => m_Game = value;
|
||||
|
|
@ -840,7 +840,7 @@ namespace Server.Engines.ConPVP
|
|||
if ( pl == leader )
|
||||
item.ItemID = 4810;
|
||||
|
||||
item.Name = String.Format( "{0}, {1} team", item.Name, ((DDTeamInfo)teams[i]).Name.ToLower() );
|
||||
item.Name = $"{item.Name}, {((DDTeamInfo) teams[i]).Name.ToLower()} team";
|
||||
|
||||
if ( !mob.PlaceInBackpack( item ) )
|
||||
mob.BankBox.DropItem( item );
|
||||
|
|
|
|||
|
|
@ -195,7 +195,7 @@ namespace Server.Engines.ConPVP
|
|||
m_KingTimer.StartHillTicker();
|
||||
|
||||
if (m_King.Name != null)
|
||||
PublicOverheadMessage(MessageType.Regular, 0x0481, false, String.Format("Taken by {0}!", m_King.Name));
|
||||
PublicOverheadMessage(MessageType.Regular, 0x0481, false, $"Taken by {m_King.Name}!");
|
||||
}
|
||||
|
||||
private class KingTimer : Timer
|
||||
|
|
@ -365,12 +365,12 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText(int x, int y, int width, int height, string text, int color, int borderColor)
|
||||
|
|
@ -490,7 +490,7 @@ namespace Server.Engines.ConPVP
|
|||
break;
|
||||
}
|
||||
|
||||
AddBorderedText(60, 65 + (i * 75), 250, 20, String.Format("{0}: {1}", LadderGump.Rank(1 + i), teamInfo.Name), nameColor, borderColor);
|
||||
AddBorderedText(60, 65 + (i * 75), 250, 20, $"{LadderGump.Rank(1 + i)}: {teamInfo.Name}", nameColor, borderColor);
|
||||
|
||||
AddBorderedText(50 + 10, 85 + (i * 75), 100, 20, "Score:", 0xFFC000, BlackColor32);
|
||||
AddBorderedText(50 + 15, 105 + (i * 75), 100, 20, teamInfo.Score.ToString("N0"), 0xFFC000, BlackColor32);
|
||||
|
|
@ -627,7 +627,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (m_Name == null)
|
||||
return "(null) Team";
|
||||
return String.Format("{0} Team", m_Name);
|
||||
return $"{m_Name} Team";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -730,7 +730,7 @@ namespace Server.Engines.ConPVP
|
|||
public override string ToString()
|
||||
{
|
||||
if (m_Name != null)
|
||||
return String.Format("({0}) ...", Name);
|
||||
return $"({Name}) ...";
|
||||
else
|
||||
return "...";
|
||||
}
|
||||
|
|
@ -1216,7 +1216,7 @@ namespace Server.Engines.ConPVP
|
|||
if (pl == leader)
|
||||
item.ItemID = 4810;
|
||||
|
||||
item.Name = String.Format("{0}, {1}", item.Name, ((KHTeamInfo)teams[i]).Name.ToLower());
|
||||
item.Name = $"{item.Name}, {((KHTeamInfo) teams[i]).Name.ToLower()}";
|
||||
|
||||
if (!mob.PlaceInBackpack(item))
|
||||
mob.BankBox.DropItem(item);
|
||||
|
|
|
|||
|
|
@ -219,12 +219,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, string text, int color, int borderColor )
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public void AddGoldenButton( int x, int y, int bid )
|
||||
|
|
@ -64,7 +64,7 @@ namespace Server.Engines.ConPVP
|
|||
int x = 35;
|
||||
int y = 47;
|
||||
|
||||
AddHtml( x, y, 200, 20, String.Format( "Team Size: {0}", p.Players.Length ), false, false ); y += 22;
|
||||
AddHtml( x, y, 200, 20, $"Team Size: {p.Players.Length}", false, false ); y += 22;
|
||||
|
||||
AddGoldenButtonLabeled( x + 20, y, 1, "Increase" ); y += 22;
|
||||
AddGoldenButtonLabeled( x + 20, y, 2, "Decrease" ); y += 30;
|
||||
|
|
@ -75,7 +75,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
DuelPlayer pl = p.Players[i];
|
||||
|
||||
AddGoldenButtonLabeled( x, y, 5 + i, String.Format( "{0}: {1}", 1 + i, pl == null ? "Empty" : pl.Mobile.Name ) ); y += 22;
|
||||
AddGoldenButtonLabeled( x, y, 5 + i, $"{1 + i}: {(pl == null ? "Empty" : pl.Mobile.Name)}"); y += 22;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public PickRulesetGump( Mobile from, DuelContext context, Ruleset ruleset ) : base( 50, 50 )
|
||||
|
|
|
|||
|
|
@ -265,12 +265,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, string text, int color, int borderColor )
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public ReadyGump( Mobile from, DuelContext context, int count ) : base( 50, 50 )
|
||||
|
|
@ -72,7 +72,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
if ( p.Players.Length > 1 )
|
||||
{
|
||||
AddHtml( 35 + 14, y, 176, 20, String.Format( "Participant #{0}", i + 1 ), false, false );
|
||||
AddHtml( 35 + 14, y, 176, 20, $"Participant #{i + 1}", false, false );
|
||||
y += 22;
|
||||
offset = 10;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public void AddGoldenButton( int x, int y, int bid )
|
||||
|
|
@ -82,7 +82,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
if ( p.Players.Length > 1 )
|
||||
{
|
||||
AddHtml( 35, y, 176, 20, String.Format( "Team #{0}", i + 1 ), false, false );
|
||||
AddHtml( 35, y, 176, 20, $"Team #{i + 1}", false, false );
|
||||
y += 22;
|
||||
offset = 10;
|
||||
}
|
||||
|
|
@ -152,12 +152,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
AddHtml( 35, 25, 190, 20, Center( "Rules" ), false, false );
|
||||
|
||||
AddHtml( 35, 50, 190, 20, String.Format( "Set: {0}", basedef.Title ), false, false );
|
||||
AddHtml( 35, 50, 190, 20, $"Set: {basedef.Title}", false, false );
|
||||
|
||||
y = 70;
|
||||
|
||||
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
|
||||
AddHtml( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), false, false );
|
||||
AddHtml( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", false, false );
|
||||
|
||||
y += 4;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
public string Center( string text )
|
||||
{
|
||||
return String.Format( "<CENTER>{0}</CENTER>", text );
|
||||
return $"<CENTER>{text}</CENTER>";
|
||||
}
|
||||
|
||||
public void AddGoldenButton( int x, int y, int bid )
|
||||
|
|
|
|||
|
|
@ -91,7 +91,8 @@ namespace Server.Engines.ConPVP
|
|||
if ( tourny.HasParticipant( m ) )
|
||||
return;
|
||||
|
||||
PrivateOverheadMessage( MessageType.Regular, 0x35, false, String.Format( "Hello m'{0}. Dost thou wish to enter this tournament? You need only to write your name in this book.", m.Female ? "Lady" : "Lord" ), m.NetState );
|
||||
PrivateOverheadMessage( MessageType.Regular, 0x35, false,
|
||||
$"Hello m'{(m.Female ? "Lady" : "Lord")}. Dost thou wish to enter this tournament? You need only to write your name in this book.", m.NetState );
|
||||
m.BeginAction( this );
|
||||
Timer.DelayCall( TimeSpan.FromSeconds( 10.0 ), new TimerStateCallback( ReleaseLock_Callback ), m );
|
||||
}
|
||||
|
|
@ -299,12 +300,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -450,7 +451,7 @@ namespace Server.Engines.ConPVP
|
|||
case GroupingType.Random: groupText = "Random"; break;
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Grouping: {0}", groupText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Grouping: {groupText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
string tieText = null;
|
||||
|
|
@ -464,22 +465,22 @@ namespace Server.Engines.ConPVP
|
|||
case TieType.FullElimination: tieText = ( tourny.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated" ); break;
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Tiebreaker: {0}", tieText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Tiebreaker: {tieText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
string sdText = "Off";
|
||||
|
||||
if ( tourny.SuddenDeath > TimeSpan.Zero )
|
||||
{
|
||||
sdText = String.Format( "{0}:{1:D2}", (int) tourny.SuddenDeath.TotalMinutes, tourny.SuddenDeath.Seconds );
|
||||
sdText = $"{(int) tourny.SuddenDeath.TotalMinutes}:{tourny.SuddenDeath.Seconds:D2}";
|
||||
|
||||
if ( tourny.SuddenDeathRounds > 0 )
|
||||
sdText = String.Format( "{0} (first {1} rounds)", sdText, tourny.SuddenDeathRounds );
|
||||
sdText = $"{sdText} (first {tourny.SuddenDeathRounds} rounds)";
|
||||
else
|
||||
sdText = String.Format( "{0} (all rounds)", sdText );
|
||||
sdText = $"{sdText} (all rounds)";
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 240, 20, String.Format( "Sudden Death: {0}", sdText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 240, 20, $"Sudden Death: {sdText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
y += 6;
|
||||
|
|
@ -487,11 +488,11 @@ namespace Server.Engines.ConPVP
|
|||
AddImageTiled( 42, y+1, 264, 1, 9157 );
|
||||
y += 6;
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Ruleset: {0}", basedef.Title ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Ruleset: {basedef.Title}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", LabelColor32, BlackColor32 );
|
||||
|
||||
y += 4;
|
||||
|
||||
|
|
@ -642,7 +643,7 @@ namespace Server.Engines.ConPVP
|
|||
else
|
||||
{
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x35, false, String.Format( "{0} has not yet proven themselves a worthy dueler.", mob.Name ), from.NetState );
|
||||
0x35, false, $"{mob.Name} has not yet proven themselves a worthy dueler.", from.NetState );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -669,7 +670,7 @@ namespace Server.Engines.ConPVP
|
|||
else
|
||||
{
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x35, false, String.Format( "{0} has already entered this tournament.", mob.Name ), from.NetState );
|
||||
0x35, false, $"{mob.Name} has already entered this tournament.", from.NetState );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -686,7 +687,8 @@ namespace Server.Engines.ConPVP
|
|||
else
|
||||
{
|
||||
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x35, false, String.Format( "{0} is already assigned to a duel. They must yield it before joining this tournament.", mobile.Name ), from.NetState );
|
||||
0x35, false,
|
||||
$"{mobile.Name} is already assigned to a duel. They must yield it before joining this tournament.", from.NetState );
|
||||
}
|
||||
|
||||
m_From.SendGump( new ConfirmSignupGump( m_From, m_Registrar, m_Tournament, m_Players ) );
|
||||
|
|
@ -711,7 +713,7 @@ namespace Server.Engines.ConPVP
|
|||
if ( minutesUntil == 0 )
|
||||
timeUntil = "momentarily";
|
||||
else
|
||||
timeUntil = String.Format( "in {0} minute{1}", minutesUntil, minutesUntil == 1 ? "" : "s" );
|
||||
timeUntil = $"in {minutesUntil} minute{(minutesUntil == 1 ? "" : "s")}";
|
||||
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x35, false, String.Format( fmt, from.Female ? "Lady" : "Lord", timeUntil ), from.NetState );
|
||||
|
|
@ -822,7 +824,8 @@ namespace Server.Engines.ConPVP
|
|||
mob.SendGump( new AcceptTeamGump( from, mob, m_Tournament, m_Registrar, m_Players ) );
|
||||
|
||||
m_Registrar?.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x59, false, String.Format( "As you command m'{0}. I've given your offer to {1}.", from.Female ? "Lady" : "Lord", mob.Name ), from.NetState );
|
||||
0x59, false,
|
||||
$"As you command m'{(@from.Female ? "Lady" : "Lord")}. I've given your offer to {mob.Name}.", from.NetState );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -843,12 +846,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -965,7 +968,7 @@ namespace Server.Engines.ConPVP
|
|||
AddBorderedText( 22, 22, 294, 20, Center( sb.ToString() ), LabelColor32, BlackColor32 );
|
||||
|
||||
AddBorderedText( 22, 50, 294, 40,
|
||||
String.Format( "You have been asked to partner with {0} in a tournament. Do you accept?", from.Name ),
|
||||
$"You have been asked to partner with {@from.Name} in a tournament. Do you accept?",
|
||||
0xB0C868, BlackColor32 );
|
||||
|
||||
AddImageTiled( 32, 88, 264, 1, 9107 );
|
||||
|
|
@ -983,7 +986,7 @@ namespace Server.Engines.ConPVP
|
|||
case GroupingType.Random: groupText = "Random"; break;
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Grouping: {0}", groupText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Grouping: {groupText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
string tieText = null;
|
||||
|
|
@ -997,22 +1000,22 @@ namespace Server.Engines.ConPVP
|
|||
case TieType.FullElimination: tieText = ( tourny.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated" ); break;
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Tiebreaker: {0}", tieText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Tiebreaker: {tieText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
string sdText = "Off";
|
||||
|
||||
if ( tourny.SuddenDeath > TimeSpan.Zero )
|
||||
{
|
||||
sdText = String.Format( "{0}:{1:D2}", (int) tourny.SuddenDeath.TotalMinutes, tourny.SuddenDeath.Seconds );
|
||||
sdText = $"{(int) tourny.SuddenDeath.TotalMinutes}:{tourny.SuddenDeath.Seconds:D2}";
|
||||
|
||||
if ( tourny.SuddenDeathRounds > 0 )
|
||||
sdText = String.Format( "{0} (first {1} rounds)", sdText, tourny.SuddenDeathRounds );
|
||||
sdText = $"{sdText} (first {tourny.SuddenDeathRounds} rounds)";
|
||||
else
|
||||
sdText = String.Format( "{0} (all rounds)", sdText );
|
||||
sdText = $"{sdText} (all rounds)";
|
||||
}
|
||||
|
||||
AddBorderedText( 35, y, 240, 20, String.Format( "Sudden Death: {0}", sdText ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 240, 20, $"Sudden Death: {sdText}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
y += 6;
|
||||
|
|
@ -1020,11 +1023,11 @@ namespace Server.Engines.ConPVP
|
|||
AddImageTiled( 42, y+1, 264, 1, 9157 );
|
||||
y += 6;
|
||||
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( "Ruleset: {0}", basedef.Title ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $"Ruleset: {basedef.Title}", LabelColor32, BlackColor32 );
|
||||
y += 20;
|
||||
|
||||
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
|
||||
AddBorderedText( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), LabelColor32, BlackColor32 );
|
||||
AddBorderedText( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", LabelColor32, BlackColor32 );
|
||||
|
||||
y += 4;
|
||||
|
||||
|
|
@ -1092,10 +1095,10 @@ namespace Server.Engines.ConPVP
|
|||
if ( m_Registrar != null )
|
||||
{
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x22, false, String.Format( "{0} seems unresponsive.", m_Requested.Name ), m_From.NetState );
|
||||
0x22, false, $"{m_Requested.Name} seems unresponsive.", m_From.NetState );
|
||||
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x22, false, String.Format( "You have declined the partnership with {0}.", m_From.Name ), m_Requested.NetState );
|
||||
0x22, false, $"You have declined the partnership with {m_From.Name}.", m_Requested.NetState );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -1158,10 +1161,10 @@ namespace Server.Engines.ConPVP
|
|||
if ( m_Registrar != null )
|
||||
{
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x59, false, String.Format( "{0} has accepted your offer of partnership.", mob.Name ), from.NetState );
|
||||
0x59, false, $"{mob.Name} has accepted your offer of partnership.", from.NetState );
|
||||
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x59, false, String.Format( "You have accepted the partnership with {0}.", from.Name ), mob.NetState );
|
||||
0x59, false, $"You have accepted the partnership with {@from.Name}.", mob.NetState );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1175,10 +1178,10 @@ namespace Server.Engines.ConPVP
|
|||
if ( m_Registrar != null )
|
||||
{
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x22, false, String.Format( "{0} has declined your offer of partnership.", mob.Name ), from.NetState );
|
||||
0x22, false, $"{mob.Name} has declined your offer of partnership.", from.NetState );
|
||||
|
||||
m_Registrar.PrivateOverheadMessage( MessageType.Regular,
|
||||
0x22, false, String.Format( "You have declined the partnership with {0}.", from.Name ), mob.NetState );
|
||||
0x22, false, $"You have declined the partnership with {@from.Name}.", mob.NetState );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -2041,9 +2044,11 @@ namespace Server.Engines.ConPVP
|
|||
try
|
||||
{
|
||||
if ( m_EventController != null )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", m_EventController.GetTeamName( ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) ) ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {m_EventController.GetTeamName(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner))} has won!");
|
||||
else if ( m_TournyType == TournyType.RandomTeam )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
|
||||
else if ( m_TournyType == TournyType.Faction ) {
|
||||
if ( m_ParticipantsPerMatch == 4 )
|
||||
{
|
||||
|
|
@ -2069,21 +2074,25 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
Alert( "The tournament has completed!", String.Format( "The {0} team has won!", name ) );
|
||||
Alert( "The tournament has completed!", $"The {name} team has won!");
|
||||
}
|
||||
else if ( m_ParticipantsPerMatch == 2 )
|
||||
{
|
||||
Alert( "The tournament has completed!", String.Format( "The {0} team has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Evil" : "Hero" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"The {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Evil" : "Hero")} team has won!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
|
||||
}
|
||||
}
|
||||
else if ( m_TournyType == TournyType.RedVsBlue )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Red" : "Blue" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Red" : "Blue")} has won!");
|
||||
else
|
||||
Alert( "The tournament has completed!", String.Format( "{0} {1} the champion{2}.", winner.NameList, winner.Players.Count > 1 ? "are" : "is", winner.Players.Count == 1 ? "" : "s" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"{winner.NameList} {(winner.Players.Count > 1 ? "are" : "is")} the champion{(winner.Players.Count == 1 ? "" : "s")}.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -2155,9 +2164,11 @@ namespace Server.Engines.ConPVP
|
|||
try
|
||||
{
|
||||
if ( m_EventController != null )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won", m_EventController.GetTeamName( ( (TournyMatch) ( (PyramidLevel) m_Pyramid.Levels[0] ).Matches[0] ).Participants.IndexOf( winner ) ) ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {m_EventController.GetTeamName(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner))} has won");
|
||||
else if ( m_TournyType == TournyType.RandomTeam )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
|
||||
else if ( m_TournyType == TournyType.Faction ) {
|
||||
if ( m_ParticipantsPerMatch == 4 )
|
||||
{
|
||||
|
|
@ -2183,21 +2194,25 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
Alert( "The tournament has completed!", String.Format( "The {0} team has won!", name ) );
|
||||
Alert( "The tournament has completed!", $"The {name} team has won!");
|
||||
}
|
||||
else if ( m_ParticipantsPerMatch == 2 )
|
||||
{
|
||||
Alert( "The tournament has completed!", String.Format( "The {0} team has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Evil" : "Hero" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"The {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Evil" : "Hero")} team has won!");
|
||||
}
|
||||
else
|
||||
{
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) + 1 ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) + 1} has won!");
|
||||
}
|
||||
}
|
||||
else if ( m_TournyType == TournyType.RedVsBlue )
|
||||
Alert( "The tournament has completed!", String.Format( "Team {0} has won!", ((TournyMatch)((PyramidLevel)m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf( winner ) == 0 ? "Red" : "Blue" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"Team {(((TournyMatch) ((PyramidLevel) m_Pyramid.Levels[0]).Matches[0]).Participants.IndexOf(winner) == 0 ? "Red" : "Blue")} has won!");
|
||||
else
|
||||
Alert( "The tournament has completed!", String.Format( "{0} {1} the champion{2}.", winner.NameList, winner.Players.Count > 1 ? "are" : "is", winner.Players.Count == 1 ? "" : "s" ) );
|
||||
Alert( "The tournament has completed!",
|
||||
$"{winner.NameList} {(winner.Players.Count > 1 ? "are" : "is")} the champion{(winner.Players.Count == 1 ? "" : "s")}.");
|
||||
}
|
||||
catch
|
||||
{
|
||||
|
|
@ -2733,12 +2748,12 @@ namespace Server.Engines.ConPVP
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
private void AddBorderedText( int x, int y, int width, int height, string text, int color, int borderColor )
|
||||
|
|
@ -2882,11 +2897,12 @@ namespace Server.Engines.ConPVP
|
|||
secs %= 60;
|
||||
|
||||
if ( mins > 0 && secs > 0 )
|
||||
text = String.Format( "The tournament will begin in {0} minute{1} and {2} second{3}.", mins, mins==1?"":"s", secs, secs==1?"":"s" );
|
||||
text =
|
||||
$"The tournament will begin in {mins} minute{(mins == 1 ? "" : "s")} and {secs} second{(secs == 1 ? "" : "s")}.";
|
||||
else if ( mins > 0 )
|
||||
text = String.Format( "The tournament will begin in {0} minute{1}.", mins, mins==1?"":"s" );
|
||||
text = $"The tournament will begin in {mins} minute{(mins == 1 ? "" : "s")}.";
|
||||
else if ( secs > 0 )
|
||||
text = String.Format( "The tournament will begin in {0} second{1}.", secs, secs==1?"":"s" );
|
||||
text = $"The tournament will begin in {secs} second{(secs == 1 ? "" : "s")}.";
|
||||
else
|
||||
text = "The tournament will begin shortly.";
|
||||
}
|
||||
|
|
@ -2950,7 +2966,7 @@ namespace Server.Engines.ConPVP
|
|||
case GroupingType.Random: groupText = "Random"; break;
|
||||
}
|
||||
|
||||
AddHtml( 35, y, 190, 20, String.Format( "Grouping: {0}", groupText ), false, false );
|
||||
AddHtml( 35, y, 190, 20, $"Grouping: {groupText}", false, false );
|
||||
y += 20;
|
||||
|
||||
string tieText = null;
|
||||
|
|
@ -2964,31 +2980,31 @@ namespace Server.Engines.ConPVP
|
|||
case TieType.FullElimination: tieText = ( tourny.ParticipantsPerMatch == 2 ? "Both eliminated" : "Everyone eliminated" ); break;
|
||||
}
|
||||
|
||||
AddHtml( 35, y, 190, 20, String.Format( "Tiebreaker: {0}", tieText ), false, false );
|
||||
AddHtml( 35, y, 190, 20, $"Tiebreaker: {tieText}", false, false );
|
||||
y += 20;
|
||||
|
||||
string sdText = "Off";
|
||||
|
||||
if ( tourny.SuddenDeath > TimeSpan.Zero )
|
||||
{
|
||||
sdText = String.Format( "{0}:{1:D2}", (int) tourny.SuddenDeath.TotalMinutes, tourny.SuddenDeath.Seconds );
|
||||
sdText = $"{(int) tourny.SuddenDeath.TotalMinutes}:{tourny.SuddenDeath.Seconds:D2}";
|
||||
|
||||
if ( tourny.SuddenDeathRounds > 0 )
|
||||
sdText = String.Format( "{0} (first {1} rounds)", sdText, tourny.SuddenDeathRounds );
|
||||
sdText = $"{sdText} (first {tourny.SuddenDeathRounds} rounds)";
|
||||
else
|
||||
sdText = String.Format( "{0} (all rounds)", sdText );
|
||||
sdText = $"{sdText} (all rounds)";
|
||||
}
|
||||
|
||||
AddHtml( 35, y, 240, 20, String.Format( "Sudden Death: {0}", sdText ), false, false );
|
||||
AddHtml( 35, y, 240, 20, $"Sudden Death: {sdText}", false, false );
|
||||
y += 20;
|
||||
|
||||
y += 8;
|
||||
|
||||
AddHtml( 35, y, 190, 20, String.Format( "Ruleset: {0}", basedef.Title ), false, false );
|
||||
AddHtml( 35, y, 190, 20, $"Ruleset: {basedef.Title}", false, false );
|
||||
y += 20;
|
||||
|
||||
for ( int i = 0; i < ruleset.Flavors.Count; ++i, y += 18 )
|
||||
AddHtml( 35, y, 190, 20, String.Format( " + {0}", ((Ruleset)ruleset.Flavors[i]).Title ), false, false );
|
||||
AddHtml( 35, y, 190, 20, $" + {((Ruleset) ruleset.Flavors[i]).Title}", false, false );
|
||||
|
||||
y += 4;
|
||||
|
||||
|
|
@ -3030,7 +3046,7 @@ namespace Server.Engines.ConPVP
|
|||
m_List = new ArrayList( tourny.Participants );
|
||||
|
||||
AddLeftArrow( 25, 11, ToButtonID( 0, 0 ) );
|
||||
AddHtml( 25, 35, 250, 20, Center( String.Format( "{0} Participant{1}", m_List.Count, m_List.Count == 1 ? "" : "s" ) ), false, false );
|
||||
AddHtml( 25, 35, 250, 20, Center($"{m_List.Count} Participant{(m_List.Count == 1 ? "" : "s")}"), false, false );
|
||||
|
||||
int index, count, y;
|
||||
StartPage( out index, out count, out y, 12 );
|
||||
|
|
@ -3082,7 +3098,8 @@ namespace Server.Engines.ConPVP
|
|||
y += 18;
|
||||
}
|
||||
|
||||
AddHtml( 25, y, 200, 20, String.Format( "Free Advances: {0}", part.FreeAdvances == 0 ? "None" : part.FreeAdvances.ToString() ), false, false );
|
||||
AddHtml( 25, y, 200, 20,
|
||||
$"Free Advances: {(part.FreeAdvances == 0 ? "None" : part.FreeAdvances.ToString())}", false, false );
|
||||
y += 20;
|
||||
|
||||
AddHtml( 25, y, 200, 20, "Log:", false, false );
|
||||
|
|
@ -3119,12 +3136,13 @@ namespace Server.Engines.ConPVP
|
|||
Ladder ladder = Ladder.Instance;
|
||||
LadderEntry entry = ladder?.Find( mob );
|
||||
|
||||
AddHtml( 25, 53, 250, 20, String.Format( "Name: {0}", mob.Name ), false, false );
|
||||
AddHtml( 25, 73, 250, 20, String.Format( "Guild: {0}", mob.Guild == null ? "None" : mob.Guild.Name + " [" + mob.Guild.Abbreviation + "]" ), false, false );
|
||||
AddHtml( 25, 93, 250, 20, String.Format( "Rank: {0}", entry == null ? "N/A" : LadderGump.Rank( entry.Index + 1 ) ), false, false );
|
||||
AddHtml( 25, 113, 250, 20, String.Format( "Level: {0}", entry == null ? 0 : Ladder.GetLevel( entry.Experience ) ), false, false );
|
||||
AddHtml( 25, 133, 250, 20, String.Format( "Wins: {0:N0}", entry == null ? 0 : entry.Wins ), false, false );
|
||||
AddHtml( 25, 153, 250, 20, String.Format( "Losses: {0:N0}", entry == null ? 0 : entry.Losses ), false, false );
|
||||
AddHtml( 25, 53, 250, 20, $"Name: {mob.Name}", false, false );
|
||||
AddHtml( 25, 73, 250, 20,
|
||||
$"Guild: {(mob.Guild == null ? "None" : mob.Guild.Name + " [" + mob.Guild.Abbreviation + "]")}", false, false );
|
||||
AddHtml( 25, 93, 250, 20, $"Rank: {(entry == null ? "N/A" : LadderGump.Rank(entry.Index + 1))}", false, false );
|
||||
AddHtml( 25, 113, 250, 20, $"Level: {(entry == null ? 0 : Ladder.GetLevel(entry.Experience))}", false, false );
|
||||
AddHtml( 25, 133, 250, 20, $"Wins: {(entry == null ? 0 : entry.Wins):N0}", false, false );
|
||||
AddHtml( 25, 153, 250, 20, $"Losses: {(entry == null ? 0 : entry.Losses):N0}", false, false );
|
||||
|
||||
break;
|
||||
}
|
||||
|
|
@ -3165,9 +3183,10 @@ namespace Server.Engines.ConPVP
|
|||
if ( m_List == null )
|
||||
m_List = new ArrayList( level.Matches );
|
||||
|
||||
AddRightArrow( 25, 53, ToButtonID( 5, 0 ), String.Format( "Free Advance: {0}", level.FreeAdvance == null ? "None" : level.FreeAdvance.NameList ) );
|
||||
AddRightArrow( 25, 53, ToButtonID( 5, 0 ),
|
||||
$"Free Advance: {(level.FreeAdvance == null ? "None" : level.FreeAdvance.NameList)}");
|
||||
|
||||
AddHtml( 25, 73, 200, 20, String.Format( "{0} Match{1}", m_List.Count, m_List.Count == 1 ? "" : "es" ), false, false );
|
||||
AddHtml( 25, 73, 200, 20, $"{m_List.Count} Match{(m_List.Count == 1 ? "" : "es")}", false, false );
|
||||
|
||||
int index, count, y;
|
||||
StartPage( out index, out count, out y, 10 );
|
||||
|
|
@ -3214,9 +3233,9 @@ namespace Server.Engines.ConPVP
|
|||
string txt;
|
||||
|
||||
if ( m_Tournament.EventController != null )
|
||||
txt = String.Format( "Team {0} ({1})", m_Tournament.EventController.GetTeamName( j ), part.Players.Count );
|
||||
txt = $"Team {m_Tournament.EventController.GetTeamName(j)} ({part.Players.Count})";
|
||||
else if ( m_Tournament.TournyType == TournyType.RandomTeam )
|
||||
txt = String.Format( "Team {0} ({1})", j + 1, part.Players.Count );
|
||||
txt = $"Team {j + 1} ({part.Players.Count})";
|
||||
else if ( m_Tournament.TournyType == TournyType.Faction ) {
|
||||
if ( m_Tournament.ParticipantsPerMatch == 4 )
|
||||
{
|
||||
|
|
@ -3242,19 +3261,19 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
txt = String.Format( "{0} ({1})", name, part.Players.Count );
|
||||
txt = $"{name} ({part.Players.Count})";
|
||||
}
|
||||
else if ( m_Tournament.ParticipantsPerMatch == 2 )
|
||||
{
|
||||
txt = String.Format( "{0} Team ({1})", j==0?"Evil":"Hero", part.Players.Count );
|
||||
txt = $"{(j == 0 ? "Evil" : "Hero")} Team ({part.Players.Count})";
|
||||
}
|
||||
else
|
||||
{
|
||||
txt = String.Format( "Team {0} ({1})", j + 1, part.Players.Count );
|
||||
txt = $"Team {j + 1} ({part.Players.Count})";
|
||||
}
|
||||
}
|
||||
else
|
||||
txt = String.Format( "Team {0} ({1})", j == 0 ? "Red" : "Blue", part.Players.Count );
|
||||
txt = $"Team {(j == 0 ? "Red" : "Blue")} ({part.Players.Count})";
|
||||
|
||||
if ( color == -1 && match.Context != null && match.Winner == part )
|
||||
txt = Color( txt, 0x336633 );
|
||||
|
|
@ -3292,8 +3311,9 @@ namespace Server.Engines.ConPVP
|
|||
AddLeftArrow( 25, 11, ToButtonID( 0, 5 ) );
|
||||
AddHtml( 25, 35, 250, 20, Center( "Rounds" ), false, false );
|
||||
|
||||
AddHtml( 25, 53, 250, 20, String.Format( "Winner: {0}", match.Winner == null ? "N/A" : match.Winner.NameList ), false, false );
|
||||
AddHtml( 25, 73, 250, 20, String.Format( "State: {0}", match.InProgress ? "In progress" : match.Context != null ? "Complete" : "Waiting" ), false, false );
|
||||
AddHtml( 25, 53, 250, 20, $"Winner: {(match.Winner == null ? "N/A" : match.Winner.NameList)}", false, false );
|
||||
AddHtml( 25, 73, 250, 20,
|
||||
$"State: {(match.InProgress ? "In progress" : match.Context != null ? "Complete" : "Waiting")}", false, false );
|
||||
AddHtml( 25, 93, 250, 20, "Participants:", false, false );
|
||||
|
||||
if ( m_Tournament.TournyType == TournyType.Standard )
|
||||
|
|
@ -3312,9 +3332,11 @@ namespace Server.Engines.ConPVP
|
|||
TournyParticipant part = (TournyParticipant)match.Participants[i];
|
||||
|
||||
if ( m_Tournament.EventController != null )
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", m_Tournament.EventController.GetTeamName( i ), part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"Team {m_Tournament.EventController.GetTeamName(i)} ({part.Players.Count})");
|
||||
else if ( m_Tournament.TournyType == TournyType.RandomTeam )
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", i+1, part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"Team {i + 1} ({part.Players.Count})");
|
||||
else if ( m_Tournament.TournyType == TournyType.Faction ) {
|
||||
if ( m_Tournament.ParticipantsPerMatch == 4 )
|
||||
{
|
||||
|
|
@ -3340,19 +3362,23 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
}
|
||||
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "{0} ({1})", name, part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"{name} ({part.Players.Count})");
|
||||
}
|
||||
else if ( m_Tournament.ParticipantsPerMatch == 2 )
|
||||
{
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "{0} Team ({1})", i==0?"Evil":"Hero", part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"{(i == 0 ? "Evil" : "Hero")} Team ({part.Players.Count})");
|
||||
}
|
||||
else
|
||||
{
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", i+1, part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"Team {i + 1} ({part.Players.Count})");
|
||||
}
|
||||
}
|
||||
else
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ), String.Format( "Team {0} ({1})", i==0?"Red":"Blue", part.Players.Count ) );
|
||||
AddRightArrow( 25, 113 + (i * 18), ToButtonID( 6, i ),
|
||||
$"Team {(i == 0 ? "Red" : "Blue")} ({part.Players.Count})");
|
||||
}
|
||||
}
|
||||
else if ( m_Tournament.TournyType == TournyType.FreeForAll )
|
||||
|
|
|
|||
|
|
@ -100,7 +100,7 @@ namespace Server.Items
|
|||
|
||||
public void UpdateStyle()
|
||||
{
|
||||
Name = String.Format( "{0} trophy", m_Rank.ToString().ToLower() );
|
||||
Name = $"{m_Rank.ToString().ToLower()} trophy";
|
||||
|
||||
switch ( m_Rank )
|
||||
{
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ namespace Server.Engines.Craft
|
|||
if ( notice is int noticeInt && noticeInt > 0 )
|
||||
AddHtmlLocalized( 170, 295, 350, 40, noticeInt, LabelColor, false, false );
|
||||
else if ( notice is string )
|
||||
AddHtml( 170, 295, 350, 40, String.Format( "<BASEFONT COLOR=#{0:X6}>{1}</BASEFONT>", FontColor, notice ), false, false );
|
||||
AddHtml( 170, 295, 350, 40, $"<BASEFONT COLOR=#{FontColor:X6}>{notice}</BASEFONT>", false, false );
|
||||
|
||||
// If the system has more than one resource
|
||||
if ( craftSystem.CraftSubRes.Init )
|
||||
|
|
@ -142,7 +142,7 @@ namespace Server.Engines.Craft
|
|||
if ( nameNumber > 0 )
|
||||
AddHtmlLocalized( 50, 365, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 50, 362, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) );
|
||||
AddLabel( 50, 362, LabelHue, $"{nameString} ({resourceCount} Available)");
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
|
|
@ -180,7 +180,7 @@ namespace Server.Engines.Craft
|
|||
if ( nameNumber > 0 )
|
||||
AddHtmlLocalized( 50, 385, 250, 18, nameNumber, resourceCount.ToString(), LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 50, 385, LabelHue, String.Format( "{0} ({1} Available)", nameString, resourceCount ) );
|
||||
AddLabel( 50, 385, LabelHue, $"{nameString} ({resourceCount} Available)");
|
||||
}
|
||||
// ****************************************
|
||||
|
||||
|
|
@ -235,7 +235,7 @@ namespace Server.Engines.Craft
|
|||
if ( subResource.NameNumber > 0 )
|
||||
AddHtmlLocalized( 255, 63 + (index * 20), 250, 18, subResource.NameNumber, resourceCount.ToString(), LabelColor, false, false );
|
||||
else
|
||||
AddLabel( 255, 60 + ( index * 20 ), LabelHue, String.Format( "{0} ({1})", subResource.NameString, resourceCount ) );
|
||||
AddLabel( 255, 60 + ( index * 20 ), LabelHue, $"{subResource.NameString} ({resourceCount})");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ namespace Server.Engines.Craft
|
|||
case Expansion.ML:
|
||||
return 1072651; // * Requires the "Mondain's Legacy" expansion
|
||||
default:
|
||||
return String.Format( "* Requires the \"{0}\" expansion", ExpansionInfo.GetInfo( expansion ).Name );
|
||||
return $"* Requires the \"{ExpansionInfo.GetInfo(expansion).Name}\" expansion";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -142,7 +142,7 @@ namespace Server.Engines.Craft
|
|||
minSkill = 0;
|
||||
|
||||
AddHtmlLocalized( 170, 132 + (i * 20), 200, 18, AosSkillBonuses.GetLabel( skill.SkillToMake ), LabelColor, false, false );
|
||||
AddLabel( 430, 132 + (i * 20), LabelHue, String.Format( "{0:F1}", minSkill ) );
|
||||
AddLabel( 430, 132 + (i * 20), LabelHue, $"{minSkill:F1}");
|
||||
}
|
||||
|
||||
CraftSubResCol res = ( m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes );
|
||||
|
|
@ -163,7 +163,7 @@ namespace Server.Engines.Craft
|
|||
chance = 1.0;
|
||||
|
||||
AddHtmlLocalized( 170, 80, 250, 18, 1044057, LabelColor, false, false ); // Success Chance:
|
||||
AddLabel( 430, 80, LabelHue, String.Format( "{0:F1}%", chance * 100 ) );
|
||||
AddLabel( 430, 80, LabelHue, $"{chance * 100:F1}%");
|
||||
|
||||
if ( m_ShowExceptionalChance )
|
||||
{
|
||||
|
|
@ -173,7 +173,7 @@ namespace Server.Engines.Craft
|
|||
excepChance = 1.0;
|
||||
|
||||
AddHtmlLocalized( 170, 100, 250, 18, 1044058, 32767, false, false ); // Exceptional Chance:
|
||||
AddLabel( 430, 100, LabelHue, String.Format( "{0:F1}%", excepChance * 100 ) );
|
||||
AddLabel( 430, 100, LabelHue, $"{excepChance * 100:F1}%");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1016,7 +1016,8 @@ namespace Server.Engines.Craft
|
|||
case Expansion.ML:
|
||||
return 1072650; // The "Mondain's Legacy" expansion is required to attempt this item.
|
||||
default:
|
||||
return String.Format( "The \"{0}\" expansion is required to attempt this item.", ExpansionInfo.GetInfo( expansion ).Name );
|
||||
return
|
||||
$"The \"{ExpansionInfo.GetInfo(expansion).Name}\" expansion is required to attempt this item.";
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1141,7 +1141,7 @@ namespace Server.Factions
|
|||
silver = killerState.Faction.AwardSilver( killer, award * 40 );
|
||||
|
||||
if ( silver > 0 )
|
||||
killer.SendLocalizedMessage( 1042736, String.Format( "{0:N0} silver\t{1}", silver, victim.Name ) ); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
|
||||
killer.SendLocalizedMessage( 1042736, $"{silver:N0} silver\t{victim.Name}"); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
|
||||
}
|
||||
|
||||
victimState.KillPoints -= award;
|
||||
|
|
@ -1149,7 +1149,7 @@ namespace Server.Factions
|
|||
|
||||
int offset = ( award != 1 ? 0 : 2 ); // for pluralization
|
||||
|
||||
string args = String.Format( "{0}\t{1}\t{2}", award, victim.Name, killer.Name );
|
||||
string args = $"{award}\t{victim.Name}\t{killer.Name}";
|
||||
|
||||
killer.SendLocalizedMessage( 1042737 + offset, args ); // Thou hast been honored with ~1_KILL_POINTS~ kill point(s) for vanquishing ~2_DEAD_PLAYER~!
|
||||
victim.SendLocalizedMessage( 1042738 + offset, args ); // Thou has lost ~1_KILL_POINTS~ kill point(s) to ~3_ATTACKER_NAME~ for being vanquished!
|
||||
|
|
|
|||
|
|
@ -8,22 +8,22 @@ namespace Server.Factions
|
|||
{
|
||||
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 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 const int LabelColor = 0xFFFFFF;
|
||||
|
|
|
|||
|
|
@ -93,7 +93,7 @@ namespace Server.Factions
|
|||
if ( from.Alive )
|
||||
m_Placer.SendMessage( "You have earned {0} silver pieces because {1} fell for your trap.", silverGiven, from.Name );
|
||||
else
|
||||
m_Placer.SendLocalizedMessage( 1042736, String.Format( "{0} silver\t{1}", silverGiven, from.Name ) ); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
|
||||
m_Placer.SendLocalizedMessage( 1042736, $"{silverGiven} silver\t{@from.Name}"); // You have earned ~1_SILVER_AMOUNT~ pieces for vanquishing ~2_PLAYER_NAME~!
|
||||
}
|
||||
|
||||
victimState.OnGivenSilverTo( m_Placer );
|
||||
|
|
|
|||
|
|
@ -215,7 +215,7 @@ namespace Server.Factions
|
|||
|
||||
public int GetStatMod( Mobile mob, StatType type )
|
||||
{
|
||||
StatMod mod = mob.GetStatMod( String.Format( "[Magic] {0} Offset", type ) );
|
||||
StatMod mod = mob.GetStatMod($"[Magic] {type} Offset");
|
||||
|
||||
if ( mod == null )
|
||||
return 0;
|
||||
|
|
|
|||
|
|
@ -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" );
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ namespace Server.Engines.Help
|
|||
|
||||
AddHtmlLocalized( 150, 40, 360, 40, 1062610, false, false ); // <CENTER><U>Ultima Online Help Response</U></CENTER>
|
||||
|
||||
AddHtml( 80, 90, 480, 290, String.Format( "{0} tells {1}: {2}", name, from.Name, text ), true, true );
|
||||
AddHtml( 80, 90, 480, 290, $"{name} tells {@from.Name}: {text}", true, true );
|
||||
|
||||
AddHtmlLocalized( 80, 390, 480, 40, 1062611, false, false ); // Clicking the OKAY button will remove the reponse you have received.
|
||||
AddButton( 400, 417, 2074, 2075, 1, GumpButtonType.Reply, 0 ); // OKAY
|
||||
|
|
|
|||
|
|
@ -37,7 +37,8 @@ namespace Server.Engines.Help
|
|||
string playerName = player.Name;
|
||||
string playerAccount = player.Account is Account ? player.Account.Username : "???";
|
||||
|
||||
AddHtml( 10, 10, 280, 20, String.Format( "<basefont color=#A0A0FF><center>SPEECH LOG - {0} (<i>{1}</i>)</center></basefont>", playerName, Utility.FixHtml( playerAccount ) ), false, false );
|
||||
AddHtml( 10, 10, 280, 20,
|
||||
$"<basefont color=#A0A0FF><center>SPEECH LOG - {playerName} (<i>{Utility.FixHtml(playerAccount)}</i>)</center></basefont>", false, false );
|
||||
|
||||
int lastPage = ( log.Count - 1 ) / MaxEntriesPerPage;
|
||||
|
||||
|
|
@ -78,7 +79,7 @@ namespace Server.Engines.Help
|
|||
if ( page > 0 )
|
||||
AddButton( 10, 395, 0xFAE, 0xFB0, 1, GumpButtonType.Reply, 0 ); // Previous page
|
||||
|
||||
AddLabel( 45, 395, 0x481, String.Format( "Current page: {0}/{1}", page + 1, lastPage + 1 ) );
|
||||
AddLabel( 45, 395, 0x481, $"Current page: {page + 1}/{lastPage + 1}");
|
||||
|
||||
if ( page < lastPage )
|
||||
AddButton( 261, 395, 0xFA5, 0xFA7, 2, GumpButtonType.Reply, 0 ); // Next page
|
||||
|
|
|
|||
|
|
@ -204,7 +204,7 @@ namespace Server.Commands
|
|||
sw.RaisableItem = stone;
|
||||
lv.RaisableItem = door;
|
||||
|
||||
e.Mobile.SendMessage( String.Format( "{0} dynamic Khaldun item{1} generated.", m_Count, m_Count == 1 ? "" : "s" ) );
|
||||
e.Mobile.SendMessage($"{m_Count} dynamic Khaldun item{(m_Count == 1 ? "" : "s")} generated.");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
public void SetTitle( TextDefinition def )
|
||||
{
|
||||
if ( def.Number > 0 )
|
||||
m_Title = String.Format( "#{0}", def.Number ); // OSI does "@@#{0}" instead, why? KR client related?
|
||||
m_Title = $"#{def.Number}"; // OSI does "@@#{0}" instead, why? KR client related?
|
||||
else
|
||||
m_Title = def.String;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ namespace Server.Engines.MLQuests.Gumps
|
|||
else if ( targetRace == Race.Elf )
|
||||
AddHtmlLocalized( 15, 15, 210, 75, 1073642, 0, false, false ); // Are you sure you want to follow the elven ways?
|
||||
else
|
||||
AddHtml( 15, 15, 210, 75, String.Format( "Are you sure you want to change your race to {0}?", targetRace.Name ), false, false );
|
||||
AddHtml( 15, 15, 210, 75, $"Are you sure you want to change your race to {targetRace.Name}?", false, false );
|
||||
|
||||
AddButton( 160, 95, 0xF7, 0xF8, 1, GumpButtonType.Reply, 0 );
|
||||
AddButton( 90, 95, 0xF2, 0xF1, 0, GumpButtonType.Reply, 0 );
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ namespace Server.Engines.MLQuests.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (m_QuestType != null)
|
||||
list.Add(String.Format("Required quest: {0}", m_QuestType.Name));
|
||||
list.Add($"Required quest: {m_QuestType.Name}");
|
||||
}
|
||||
|
||||
public MLQuestTeleporter(Serial serial)
|
||||
|
|
@ -187,7 +187,7 @@ namespace Server.Engines.MLQuests.Items
|
|||
base.GetProperties(list);
|
||||
|
||||
if (m_TicketType != null)
|
||||
list.Add(String.Format("Required ticket: {0}", m_TicketType.Name));
|
||||
list.Add($"Required ticket: {m_TicketType.Name}");
|
||||
}
|
||||
|
||||
public TicketTeleporter(Serial serial)
|
||||
|
|
|
|||
|
|
@ -159,7 +159,7 @@ namespace Server.Engines.MLQuests
|
|||
|
||||
public void PutSpawner( Spawner s, Point3D loc, Map map )
|
||||
{
|
||||
string name = String.Format( "MLQS-{0}", GetType().Name );
|
||||
string name = $"MLQS-{GetType().Name}";
|
||||
|
||||
// Auto cleanup on regeneration
|
||||
List<Item> toDelete = new List<Item>();
|
||||
|
|
|
|||
|
|
@ -218,7 +218,7 @@ namespace Server.Engines.MLQuests.Mobiles
|
|||
if ( m_Index == 0 )
|
||||
{
|
||||
if ( m_Target.ShowFameTitle && m_Target.Fame >= 10000 )
|
||||
m_Owner.Say( true, String.Format( "{0} {1}", m_Target.Female ? "Lady" : "Lord", m_Target.Name ) );
|
||||
m_Owner.Say( true, $"{(m_Target.Female ? "Lady" : "Lord")} {m_Target.Name}");
|
||||
else
|
||||
m_Owner.Say( true, m_Target.Name );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
if ( total < desired )
|
||||
{
|
||||
pm.SendLocalizedMessage( 1074861 ); // You do not have everything you need!
|
||||
pm.SendLocalizedMessage( 1074885, String.Format( "{0}\t{1}", total, desired ) ); // You have ~1_val~ item(s) but require ~2_val~
|
||||
pm.SendLocalizedMessage( 1074885, $"{total}\t{desired}"); // You have ~1_val~ item(s) but require ~2_val~
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -85,9 +85,9 @@ namespace Server.Engines.MLQuests.Objectives
|
|||
string args;
|
||||
|
||||
if ( m_ThresholdFixed % 10 == 0 )
|
||||
args = String.Format( "#{0}\t{1}", skillLabel, m_ThresholdFixed / 10 ); // as seen on OSI
|
||||
args = $"#{skillLabel}\t{m_ThresholdFixed / 10}"; // as seen on OSI
|
||||
else
|
||||
args = String.Format( "#{0}\t{1:0.0}", skillLabel, (double)m_ThresholdFixed / 10 ); // for non-integer skill levels
|
||||
args = $"#{skillLabel}\t{(double) m_ThresholdFixed / 10:0.0}"; // for non-integer skill levels
|
||||
|
||||
g.AddHtmlLocalized( 98, y, 312, 16, 1077485, args, 0x15F90, false, false ); // Increase ~1_SKILL~ to ~2_VALUE~
|
||||
y += 16;
|
||||
|
|
|
|||
|
|
@ -42,8 +42,8 @@ namespace Server.Engines.MyRunUO
|
|||
|
||||
public static string CompileConnectionString()
|
||||
{
|
||||
string connectionString = String.Format( "DRIVER={0};SERVER={1};DATABASE={2};UID={3};PASSWORD={4};",
|
||||
DatabaseDriver, DatabaseServer, DatabaseName, DatabaseUserID, DatabasePassword );
|
||||
string connectionString =
|
||||
$"DRIVER={DatabaseDriver};SERVER={DatabaseServer};DATABASE={DatabaseName};UID={DatabaseUserID};PASSWORD={DatabasePassword};";
|
||||
|
||||
return connectionString;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -532,7 +532,7 @@ namespace Server.Engines.MyRunUO
|
|||
|
||||
public StreamWriter GetUniqueWriter( string type, out string filePath )
|
||||
{
|
||||
filePath = Path.Combine( Core.BaseDirectory, String.Format( "myrunuodb_{0}.txt", type ) ).Replace( Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar );
|
||||
filePath = Path.Combine( Core.BaseDirectory, $"myrunuodb_{type}.txt").Replace( Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar );
|
||||
|
||||
try
|
||||
{
|
||||
|
|
@ -544,7 +544,7 @@ namespace Server.Engines.MyRunUO
|
|||
{
|
||||
try
|
||||
{
|
||||
filePath = Path.Combine( Core.BaseDirectory, String.Format( "myrunuodb_{0}_{1}.txt", type, i ) ).Replace( Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar );
|
||||
filePath = Path.Combine( Core.BaseDirectory, $"myrunuodb_{type}_{i}.txt").Replace( Path.DirectorySeparatorChar, Path.AltDirectorySeparatorChar );
|
||||
return new StreamWriter( filePath );
|
||||
}
|
||||
catch
|
||||
|
|
@ -639,7 +639,7 @@ namespace Server.Engines.MyRunUO
|
|||
|
||||
ExecuteNonQueryIfNull(
|
||||
String.Format( "SELECT guild_1 FROM myrunuo_guilds_wars WHERE (guild_1={0} AND guild_2={1}) OR (guild_1={1} AND guild_2={0})", ourId, theirId ),
|
||||
String.Format( "INSERT INTO myrunuo_guilds_wars (guild_1, guild_2) VALUES ({0}, {1})", ourId, theirId ) );
|
||||
$"INSERT INTO myrunuo_guilds_wars (guild_1, guild_2) VALUES ({ourId}, {theirId})");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,8 @@ namespace Server.Engines.MyRunUO
|
|||
Mobile mob = ns.Mobile;
|
||||
|
||||
if ( mob != null )
|
||||
m_Command.Enqueue( String.Format( "INSERT INTO myrunuo_status (char_id) VALUES ({0})", mob.Serial.Value.ToString() ) );
|
||||
m_Command.Enqueue(
|
||||
$"INSERT INTO myrunuo_status (char_id) VALUES ({mob.Serial.Value.ToString()})");
|
||||
}
|
||||
}
|
||||
catch ( Exception e )
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ namespace Server.Engines.PartySystem
|
|||
else if ( m == null )
|
||||
p.SendPublicMessage( from, "I was killed !!" );
|
||||
else
|
||||
p.SendPublicMessage( from, String.Format( "I was killed by {0} !!", m.Name ) );
|
||||
p.SendPublicMessage( from, $"I was killed by {m.Name} !!");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -258,9 +258,9 @@ namespace Server.Engines.Plants
|
|||
string args;
|
||||
|
||||
if ( ShowContainerType )
|
||||
args = String.Format( "#{0}\t#{1}", GetLocalizedContainerType(), m_PlantSystem.GetLocalizedDirtStatus() );
|
||||
args = $"#{GetLocalizedContainerType()}\t#{m_PlantSystem.GetLocalizedDirtStatus()}";
|
||||
else
|
||||
args = String.Format( "#{0}", m_PlantSystem.GetLocalizedDirtStatus() );
|
||||
args = $"#{m_PlantSystem.GetLocalizedDirtStatus()}";
|
||||
|
||||
list.Add( 1060830, args ); // a ~1_val~ of ~2_val~ dirt
|
||||
}
|
||||
|
|
@ -271,24 +271,26 @@ namespace Server.Engines.Plants
|
|||
|
||||
if ( m_PlantStatus >= PlantStatus.DecorativePlant )
|
||||
{
|
||||
list.Add( typeInfo.GetPlantLabelDecorative( hueInfo ), String.Format( "#{0}\t#{1}", hueInfo.Name, typeInfo.Name ) );
|
||||
list.Add( typeInfo.GetPlantLabelDecorative( hueInfo ), $"#{hueInfo.Name}\t#{typeInfo.Name}");
|
||||
}
|
||||
else if ( m_PlantStatus >= PlantStatus.FullGrownPlant )
|
||||
{
|
||||
list.Add( typeInfo.GetPlantLabelFullGrown( hueInfo ), String.Format( "#{0}\t#{1}\t#{2}", m_PlantSystem.GetLocalizedHealth(), hueInfo.Name, typeInfo.Name ) );
|
||||
list.Add( typeInfo.GetPlantLabelFullGrown( hueInfo ),
|
||||
$"#{m_PlantSystem.GetLocalizedHealth()}\t#{hueInfo.Name}\t#{typeInfo.Name}");
|
||||
}
|
||||
else
|
||||
{
|
||||
string args;
|
||||
|
||||
if ( ShowContainerType )
|
||||
args = String.Format( "#{0}\t#{1}\t#{2}", GetLocalizedContainerType(), m_PlantSystem.GetLocalizedDirtStatus(), m_PlantSystem.GetLocalizedHealth() );
|
||||
args =
|
||||
$"#{GetLocalizedContainerType()}\t#{m_PlantSystem.GetLocalizedDirtStatus()}\t#{m_PlantSystem.GetLocalizedHealth()}";
|
||||
else
|
||||
args = String.Format( "#{0}\t#{1}", m_PlantSystem.GetLocalizedDirtStatus(), m_PlantSystem.GetLocalizedHealth() );
|
||||
args = $"#{m_PlantSystem.GetLocalizedDirtStatus()}\t#{m_PlantSystem.GetLocalizedHealth()}";
|
||||
|
||||
if ( m_ShowType )
|
||||
{
|
||||
args += String.Format( "\t#{0}\t#{1}\t#{2}", hueInfo.Name, typeInfo.Name, GetLocalizedPlantStatus() );
|
||||
args += $"\t#{hueInfo.Name}\t#{typeInfo.Name}\t#{GetLocalizedPlantStatus()}";
|
||||
|
||||
if ( m_PlantStatus == PlantStatus.Plant )
|
||||
list.Add( typeInfo.GetPlantLabelPlant( hueInfo ), args );
|
||||
|
|
@ -297,7 +299,8 @@ namespace Server.Engines.Plants
|
|||
}
|
||||
else
|
||||
{
|
||||
args += String.Format( "\t#{0}\t#{1}", ( typeInfo.PlantCategory == PlantCategory.Default ) ? hueInfo.Name : (int)typeInfo.PlantCategory, GetLocalizedPlantStatus() );
|
||||
args +=
|
||||
$"\t#{((typeInfo.PlantCategory == PlantCategory.Default) ? hueInfo.Name : (int) typeInfo.PlantCategory)}\t#{GetLocalizedPlantStatus()}";
|
||||
|
||||
list.Add( hueInfo.IsBright() ? 1060832 : 1060831, args ); // a ~1_val~ of ~2_val~ dirt with a ~3_val~ [bright] ~4_val~ ~5_val~
|
||||
}
|
||||
|
|
|
|||
|
|
@ -90,7 +90,7 @@ namespace Server.Engines.Plants
|
|||
else
|
||||
{
|
||||
AddLabel( x, y, PlantHueInfo.GetInfo( m_Plant.PlantHue ).GumpHue,
|
||||
string.Format( "{0}/{1}", system.AvailableResources, totalResources ) );
|
||||
$"{system.AvailableResources}/{totalResources}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -106,7 +106,7 @@ namespace Server.Engines.Plants
|
|||
else
|
||||
{
|
||||
AddLabel( x, y, PlantHueInfo.GetInfo( system.SeedHue ).GumpHue,
|
||||
string.Format( "{0}/{1}", system.AvailableSeeds, totalSeeds ) );
|
||||
$"{system.AvailableSeeds}/{totalSeeds}");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -106,12 +106,12 @@ namespace Server.Engines.Plants
|
|||
{
|
||||
if ( m_ShowType )
|
||||
{
|
||||
args = String.Format( "#{0}\t#{1}", title, typeInfo.Name );
|
||||
args = $"#{title}\t#{typeInfo.Name}";
|
||||
return typeInfo.GetSeedLabel( hueInfo );
|
||||
}
|
||||
else
|
||||
{
|
||||
args = String.Format( "#{0}", title );
|
||||
args = $"#{title}";
|
||||
return hueInfo.IsBright() ? 1060839 : 1060838; // [bright] ~1_val~ seed
|
||||
}
|
||||
}
|
||||
|
|
@ -119,12 +119,12 @@ namespace Server.Engines.Plants
|
|||
{
|
||||
if ( m_ShowType )
|
||||
{
|
||||
args = String.Format( "{0}\t#{1}\t#{2}", Amount, title, typeInfo.Name );
|
||||
args = $"{Amount}\t#{title}\t#{typeInfo.Name}";
|
||||
return typeInfo.GetSeedLabelPlural( hueInfo );
|
||||
}
|
||||
else
|
||||
{
|
||||
args = String.Format( "{0}\t#{1}", Amount, title );
|
||||
args = $"{Amount}\t#{title}";
|
||||
return hueInfo.IsBright() ? 1113491 : 1113490; // ~1_amount~ [bright] ~2_val~ seeds
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -647,7 +647,7 @@ namespace Server.Engines.Quests
|
|||
|
||||
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>";
|
||||
}
|
||||
|
||||
public static ArrayList BuildList( object obj )
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@ namespace Server.RemoteAdmin
|
|||
string outStr;
|
||||
if ( m_NewLine )
|
||||
{
|
||||
outStr = String.Format( "[{0}]: {1}", DateTime.UtcNow.ToString( DateFormat ), str );
|
||||
outStr = $"[{DateTime.UtcNow.ToString(DateFormat)}]: {str}";
|
||||
m_NewLine = false;
|
||||
}
|
||||
else
|
||||
|
|
@ -50,7 +50,7 @@ namespace Server.RemoteAdmin
|
|||
if ( m_NewLine )
|
||||
{
|
||||
string outStr;
|
||||
outStr = String.Format( "[{0}]: {1}", DateTime.UtcNow.ToString( DateFormat ), ch );
|
||||
outStr = $"[{DateTime.UtcNow.ToString(DateFormat)}]: {ch}";
|
||||
|
||||
m_ConsoleData.Append( outStr );
|
||||
SendToAll( outStr );
|
||||
|
|
@ -70,9 +70,9 @@ namespace Server.RemoteAdmin
|
|||
{
|
||||
string outStr;
|
||||
if ( m_NewLine )
|
||||
outStr = String.Format( "[{0}]: {1}{2}", DateTime.UtcNow.ToString( DateFormat ), line, Console.Out.NewLine );
|
||||
outStr = $"[{DateTime.UtcNow.ToString(DateFormat)}]: {line}{Console.Out.NewLine}";
|
||||
else
|
||||
outStr = String.Format( "{0}{1}", line, Console.Out.NewLine );
|
||||
outStr = $"{line}{Console.Out.NewLine}";
|
||||
|
||||
m_ConsoleData.Append( outStr );
|
||||
RoughTrimConsoleData();
|
||||
|
|
@ -126,7 +126,8 @@ namespace Server.RemoteAdmin
|
|||
}
|
||||
else if ( cmd == 0xFF )
|
||||
{
|
||||
string statStr = String.Format( ", Name={0}, Age={1}, Clients={2}, Items={3}, Chars={4}, Mem={5}K, Ver={6}", Misc.ServerList.ServerName, (int)(DateTime.UtcNow - Items.Clock.ServerStart).TotalHours, NetState.Instances.Count, World.Items.Count, World.Mobiles.Count, (int)(GC.GetTotalMemory( false ) / 1024), ProtocolVersion );
|
||||
string statStr =
|
||||
$", Name={Misc.ServerList.ServerName}, Age={(int) (DateTime.UtcNow - Items.Clock.ServerStart).TotalHours}, Clients={NetState.Instances.Count}, Items={World.Items.Count}, Chars={World.Mobiles.Count}, Mem={(int) (GC.GetTotalMemory(false) / 1024)}K, Ver={ProtocolVersion}";
|
||||
state.Send( new UOGInfo( statStr ) );
|
||||
state.Dispose();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -225,7 +225,8 @@ namespace Server.RemoteAdmin
|
|||
{
|
||||
string changes = string.Empty;
|
||||
if ( UpdatedPass ) changes += " Password Changed.";
|
||||
if ( oldAcessLevel != a.AccessLevel ) changes = string.Format( "{0} Access level changed from {1} to {2}.", changes, oldAcessLevel, a.AccessLevel );
|
||||
if ( oldAcessLevel != a.AccessLevel ) changes =
|
||||
$"{changes} Access level changed from {oldAcessLevel} to {a.AccessLevel}.";
|
||||
if ( oldbanned != a.Banned ) changes += a.Banned ? " Banned." : " Unbanned.";
|
||||
RemoteAdminLogging.WriteLine( state, "Updated account {0}:{1}", a.Username, changes );
|
||||
}
|
||||
|
|
|
|||
|
|
@ -89,7 +89,7 @@ namespace Server.RemoteAdmin
|
|||
Commands.CommandLogging.AppendPath( ref path, LogBaseDirectory );
|
||||
Commands.CommandLogging.AppendPath( ref path, LogSubDirectory );
|
||||
Commands.CommandLogging.AppendPath( ref path, accesslevel );
|
||||
path = Path.Combine( path, String.Format( "{0}.log", name ) );
|
||||
path = Path.Combine( path, $"{name}.log");
|
||||
|
||||
using ( StreamWriter sw = new StreamWriter( path, true ) )
|
||||
sw.WriteLine( "{0}: {1}: {2}", DateTime.UtcNow, statestr, text );
|
||||
|
|
|
|||
|
|
@ -105,7 +105,7 @@ namespace Server.Engines.Reports
|
|||
ProcessStartInfo psi = new ProcessStartInfo();
|
||||
|
||||
psi.FileName = "ftp";
|
||||
psi.Arguments = String.Format( "-i -s:\"{0}\"", filePath );
|
||||
psi.Arguments = $"-i -s:\"{filePath}\"";
|
||||
|
||||
psi.CreateNoWindow = true;
|
||||
psi.WindowStyle = ProcessWindowStyle.Hidden;
|
||||
|
|
@ -298,7 +298,8 @@ namespace Server.Engines.Reports
|
|||
html.Write( "<!-- " );
|
||||
|
||||
html.AddAttribute( HtmlAttr.Href, "#" );
|
||||
html.AddAttribute( HtmlAttr.Onclick, String.Format( "javascript:window.open('{0}.html','ChildWindow','width={1},height={2},resizable=no,status=no,toolbar=no')", SafeFileName( FindNameFrom( chart ) ), bmp.Width+30,bmp.Height+80 ) );
|
||||
html.AddAttribute( HtmlAttr.Onclick,
|
||||
$"javascript:window.open('{SafeFileName(FindNameFrom(chart))}.html','ChildWindow','width={bmp.Width + 30},height={bmp.Height + 80},resizable=no,status=no,toolbar=no')");
|
||||
html.RenderBeginTag( HtmlTag.A );
|
||||
html.Write( chart.Name );
|
||||
html.RenderEndTag();
|
||||
|
|
@ -393,7 +394,8 @@ namespace Server.Engines.Reports
|
|||
html.Write( "<!-- " );
|
||||
|
||||
html.AddAttribute( HtmlAttr.Href, "#" );
|
||||
html.AddAttribute( HtmlAttr.Onclick, String.Format( "javascript:window.open('{0}.html','ChildWindow','width={1},height={2},resizable=no,status=no,toolbar=no')", SafeFileName( FindNameFrom( graph ) ), bmp.Width+30,bmp.Height+80 ) );
|
||||
html.AddAttribute( HtmlAttr.Onclick,
|
||||
$"javascript:window.open('{SafeFileName(FindNameFrom(graph))}.html','ChildWindow','width={bmp.Width + 30},height={bmp.Height + 80},resizable=no,status=no,toolbar=no')");
|
||||
html.RenderBeginTag( HtmlTag.A );
|
||||
html.Write( graph.Name );
|
||||
html.RenderEndTag();
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ namespace Server.Engines.Reports
|
|||
}
|
||||
|
||||
float perc = (item.SweepSize * 100.0f) / 360.0f;
|
||||
string percString = String.Format( "{0:F0}%", perc );
|
||||
string percString = $"{perc:F0}%";
|
||||
|
||||
float px = pieRect.X+(pieRect.Width/2);
|
||||
float py = pieRect.Y+(pieRect.Height/2);
|
||||
|
|
|
|||
|
|
@ -404,9 +404,9 @@ namespace Server.Engines.Reports
|
|||
if ( pl.Faction.Commander == pl.Mobile )
|
||||
office = "Commanding Lord";
|
||||
else if ( pl.Finance != null )
|
||||
office = String.Format( "{0} Finance Minister", pl.Finance.Definition.FriendlyName );
|
||||
office = $"{pl.Finance.Definition.FriendlyName} Finance Minister";
|
||||
else if ( pl.Sheriff != null )
|
||||
office = String.Format( "{0} Sheriff", pl.Sheriff.Definition.FriendlyName );
|
||||
office = $"{pl.Sheriff.Definition.FriendlyName} Sheriff";
|
||||
else
|
||||
office = "";
|
||||
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ namespace Server.Mobiles
|
|||
if ( pm.ToTItemsTurnedIn == 0 )
|
||||
SayTo( pm, 1071013 ); // Bring me 10 of the lost treasures of Tokuno and I will reward you with a valuable item.
|
||||
else
|
||||
SayTo( pm, 1070981, String.Format( "{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward ) ); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
|
||||
SayTo( pm, 1070981, $"{pm.ToTItemsTurnedIn}\t{TreasuresOfTokuno.ItemsPerReward}"); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
|
||||
|
||||
ArrayList buttons = ToTTurnInGump.FindRedeemableItems( pm );
|
||||
|
||||
|
|
@ -363,7 +363,7 @@ namespace Server.Gumps
|
|||
}
|
||||
else
|
||||
{
|
||||
m_Collector.SayTo( pm, 1070981, String.Format( "{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward ) ); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
|
||||
m_Collector.SayTo( pm, 1070981, $"{pm.ToTItemsTurnedIn}\t{TreasuresOfTokuno.ItemsPerReward}"); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
|
||||
|
||||
ArrayList buttons = FindRedeemableItems( pm );
|
||||
|
||||
|
|
@ -382,7 +382,7 @@ namespace Server.Gumps
|
|||
if ( pm.ToTItemsTurnedIn == 0 )
|
||||
m_Collector.SayTo( pm, 1071013 ); // Bring me 10 of the lost treasures of Tokuno and I will reward you with a valuable item.
|
||||
else if ( pm.ToTItemsTurnedIn < TreasuresOfTokuno.ItemsPerReward ) //This case should ALWAYS be true with this gump, jsut a sanity check
|
||||
m_Collector.SayTo( pm, 1070981, String.Format( "{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward ) ); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
|
||||
m_Collector.SayTo( pm, 1070981, $"{pm.ToTItemsTurnedIn}\t{TreasuresOfTokuno.ItemsPerReward}"); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
|
||||
else
|
||||
m_Collector.SayTo( pm, 1070982 ); // When you wish to choose your reward, you have but to approach me again.
|
||||
}
|
||||
|
|
@ -572,7 +572,7 @@ namespace Server.Gumps
|
|||
if ( pm.AddToBackpack( item ) )
|
||||
{
|
||||
pm.ToTItemsTurnedIn -= TreasuresOfTokuno.ItemsPerReward;
|
||||
m_Collector.SayTo( pm, 1070984, (item.Name == null || item.Name.Length <= 0)? String.Format( "#{0}", item.LabelNumber ) : item.Name ); // You have earned the gratitude of the Empire. I have placed the ~1_OBJTYPE~ in your backpack.
|
||||
m_Collector.SayTo( pm, 1070984, (item.Name == null || item.Name.Length <= 0)? $"#{item.LabelNumber}" : item.Name ); // You have earned the gratitude of the Empire. I have placed the ~1_OBJTYPE~ in your backpack.
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -591,7 +591,7 @@ namespace Server.Gumps
|
|||
if ( pm.ToTItemsTurnedIn == 0 )
|
||||
m_Collector.SayTo( pm, 1071013 ); // Bring me 10 of the lost treasures of Tokuno and I will reward you with a valuable item.
|
||||
else if ( pm.ToTItemsTurnedIn < TreasuresOfTokuno.ItemsPerReward ) //This and above case should ALWAYS be FALSE with this gump, jsut a sanity check
|
||||
m_Collector.SayTo( pm, 1070981, String.Format( "{0}\t{1}", pm.ToTItemsTurnedIn, TreasuresOfTokuno.ItemsPerReward ) ); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
|
||||
m_Collector.SayTo( pm, 1070981, $"{pm.ToTItemsTurnedIn}\t{TreasuresOfTokuno.ItemsPerReward}"); // You have turned in ~1_COUNT~ minor artifacts. Turn in ~2_NUM~ to receive a reward.
|
||||
else
|
||||
m_Collector.SayTo( pm, 1070982 ); // When you wish to choose your reward, you have but to approach me again.
|
||||
|
||||
|
|
|
|||
|
|
@ -132,7 +132,7 @@ namespace Server.Mobiles
|
|||
if ( m_SculptedBy != null )
|
||||
{
|
||||
if ( m_SculptedBy.ShowFameTitle && ( m_SculptedBy.Player || m_SculptedBy.Body.IsHuman ) && m_SculptedBy.Fame >= 10000 )
|
||||
list.Add( 1076202, String.Format( "{0} {1}", m_SculptedBy.Female ? "Lady" : "Lord", m_SculptedBy.Name ) ); // Sculpted by ~1_Name~
|
||||
list.Add( 1076202, $"{(m_SculptedBy.Female ? "Lady" : "Lord")} {m_SculptedBy.Name}"); // Sculpted by ~1_Name~
|
||||
else
|
||||
list.Add( 1076202, m_SculptedBy.Name ); // Sculpted by ~1_Name~
|
||||
}
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ namespace Server.Engines.VeteranRewards
|
|||
else if ( rewardInterval == TimeSpan.FromDays( 365.0 ) )
|
||||
intervalAsString = "year";
|
||||
else
|
||||
intervalAsString = String.Format( "{0} day{1}", rewardInterval.TotalDays, rewardInterval.TotalDays == 1 ? "" : "s" );
|
||||
intervalAsString = $"{rewardInterval.TotalDays} day{(rewardInterval.TotalDays == 1 ? "" : "s")}";
|
||||
|
||||
AddPage( 1 );
|
||||
|
||||
|
|
|
|||
|
|
@ -134,7 +134,7 @@ namespace Server
|
|||
{
|
||||
protectee.JusticeProtectors.Add( protector );
|
||||
|
||||
string args = String.Format( "{0}\t{1}", protector.Name, protectee.Name );
|
||||
string args = $"{protector.Name}\t{protectee.Name}";
|
||||
|
||||
protectee.SendLocalizedMessage( 1049451, args ); // You are now being protected by ~1_NAME~.
|
||||
protector.SendLocalizedMessage( 1049452, args ); // You are now protecting ~2_NAME~.
|
||||
|
|
@ -143,7 +143,7 @@ namespace Server
|
|||
|
||||
public static void OnVirtueRejected( PlayerMobile protector, PlayerMobile protectee )
|
||||
{
|
||||
string args = String.Format( "{0}\t{1}", protector.Name, protectee.Name );
|
||||
string args = $"{protector.Name}\t{protectee.Name}";
|
||||
|
||||
protectee.SendLocalizedMessage( 1049453, args ); // You have declined protection from ~1_NAME~.
|
||||
protector.SendLocalizedMessage( 1049454, args ); // ~2_NAME~ has declined your protection.
|
||||
|
|
|
|||
|
|
@ -160,7 +160,7 @@ namespace Server
|
|||
|
||||
public override string Compile( NetState ns )
|
||||
{
|
||||
return String.Format( "{{ gumppic {0} {1} {2} hue={3} class=VirtueGumpItem }}", X, Y, GumpID, Hue );
|
||||
return $"{{ gumppic {X} {Y} {GumpID} hue={Hue} class=VirtueGumpItem }}";
|
||||
}
|
||||
|
||||
private static byte[] m_Class = StringToBuffer( " class=VirtueGumpItem" );
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue