Fixes string interpolation

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

View file

@ -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})");
}
}

View file

@ -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}%");
}
}

View file

@ -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.";
}
}