Fixes string interpolation
This commit is contained in:
parent
42d0b6271f
commit
7d3a0ca265
233 changed files with 758 additions and 690 deletions
|
|
@ -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 )
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue