From 06f92c5b94cf464a3fe18924b378ffab1314dedc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Matthias=20Mail=C3=A4nder?= Date: Sun, 3 May 2015 22:17:48 +0200 Subject: [PATCH] add sound file playing to the Lua API --- OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs index 5d476640df..bcc0d41058 100644 --- a/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs @@ -45,6 +45,12 @@ namespace OpenRA.Mods.Common.Scripting Sound.PlayNotification(world.Map.Rules, player, "Sounds", notification, player != null ? player.Country.Race : null); } + [Desc("Play a sound file")] + public void PlaySound(string file) + { + Sound.Play(file); + } + MusicInfo previousMusic; Action onComplete; [Desc("Play track defined in music.yaml or keep it empty for a random song.")]