From 0eb506326000fcb0233a9a9dcb0484ac5b22690e Mon Sep 17 00:00:00 2001 From: Mustafa Alperen Seki Date: Sun, 9 Jun 2019 16:46:40 +0300 Subject: [PATCH] Add lua function Media.DisplaySystemMessage --- OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs index 209794735f..43e2b7d622 100644 --- a/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs @@ -198,6 +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") + { + if (string.IsNullOrEmpty(text)) + return; + + Game.AddSystemLine(prefix, text); + } + [Desc("Displays a debug message to the player, if \"Show Map Debug Messages\" is checked in the settings.")] public void Debug(string text) {