Extracted Win and Lose and Leave notifications MissionObjectives.

This commit is contained in:
Andre Mohren
2018-07-22 14:36:47 +02:00
committed by abcdefg30
parent fac758f38e
commit d7f81d4a20
8 changed files with 28 additions and 5 deletions

View File

@@ -44,7 +44,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
Action onQuit = () =>
{
if (world.Type == WorldType.Regular)
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", "Leave", world.LocalPlayer == null ? null : world.LocalPlayer.Faction.InternalName);
{
var moi = world.Map.Rules.Actors["player"].TraitInfoOrDefault<MissionObjectivesInfo>();
if (moi != null)
{
var faction = world.LocalPlayer == null ? null : world.LocalPlayer.Faction.InternalName;
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", moi.LeaveNotification, faction);
}
}
leaving = true;