Reduce duplication of "Battlefield Control" chat line label

This commit is contained in:
Ivaylo Draganov
2020-01-06 16:21:18 +02:00
committed by Paul Chote
parent 3e2022a3dd
commit 1dd1786469
8 changed files with 26 additions and 19 deletions

View File

@@ -198,12 +198,15 @@ namespace OpenRA.Mods.Common.Scripting
Game.AddChatLine(prefix, c, text);
}
[Desc("Display a system message to the player.")]
public void DisplaySystemMessage(string text, string prefix = "Mission")
[Desc("Display a system message to the player. If 'prefix' is nil the default system prefix is used.")]
public void DisplaySystemMessage(string text, string prefix = null)
{
if (string.IsNullOrEmpty(text))
return;
if (string.IsNullOrEmpty(prefix))
Game.AddSystemLine(text);
Game.AddSystemLine(prefix, text);
}