Extracted Win and Lose and Leave notifications MissionObjectives.
This commit is contained in:
@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.RunAfterDelay(info.NotificationDelay, () =>
|
Game.RunAfterDelay(info.NotificationDelay, () =>
|
||||||
{
|
{
|
||||||
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
||||||
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Faction.InternalName);
|
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.LoseNotification, player.Faction.InternalName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -93,7 +93,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.RunAfterDelay(info.NotificationDelay, () =>
|
Game.RunAfterDelay(info.NotificationDelay, () =>
|
||||||
{
|
{
|
||||||
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
||||||
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Faction.InternalName);
|
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.WinNotification, player.Faction.InternalName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -48,6 +48,10 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Delay between the game over condition being met, and the game actually ending, in milliseconds.")]
|
[Desc("Delay between the game over condition being met, and the game actually ending, in milliseconds.")]
|
||||||
public readonly int GameOverDelay = 1500;
|
public readonly int GameOverDelay = 1500;
|
||||||
|
|
||||||
|
public readonly string WinNotification = null;
|
||||||
|
public readonly string LoseNotification = null;
|
||||||
|
public readonly string LeaveNotification = null;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new MissionObjectives(init.World, this); }
|
public object Create(ActorInitializer init) { return new MissionObjectives(init.World, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.RunAfterDelay(info.NotificationDelay, () =>
|
Game.RunAfterDelay(info.NotificationDelay, () =>
|
||||||
{
|
{
|
||||||
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
||||||
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Faction.InternalName);
|
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.LoseNotification, player.Faction.InternalName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -132,7 +132,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
Game.RunAfterDelay(info.NotificationDelay, () =>
|
Game.RunAfterDelay(info.NotificationDelay, () =>
|
||||||
{
|
{
|
||||||
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
if (Game.IsCurrentWorld(player.World) && player == player.World.LocalPlayer)
|
||||||
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Faction.InternalName);
|
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", mo.Info.WinNotification, player.Faction.InternalName);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -44,7 +44,14 @@ namespace OpenRA.Mods.Common.Widgets.Logic
|
|||||||
Action onQuit = () =>
|
Action onQuit = () =>
|
||||||
{
|
{
|
||||||
if (world.Type == WorldType.Regular)
|
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;
|
leaving = true;
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,9 @@ Player:
|
|||||||
SupportPowerManager:
|
SupportPowerManager:
|
||||||
ScriptTriggers:
|
ScriptTriggers:
|
||||||
MissionObjectives:
|
MissionObjectives:
|
||||||
|
WinNotification: Win
|
||||||
|
LoseNotification: Lose
|
||||||
|
LeaveNotification: Leave
|
||||||
ConquestVictoryConditions:
|
ConquestVictoryConditions:
|
||||||
PowerManager:
|
PowerManager:
|
||||||
SpeechNotification: LowPower
|
SpeechNotification: LowPower
|
||||||
|
|||||||
@@ -81,6 +81,9 @@ Player:
|
|||||||
SupportPowerManager:
|
SupportPowerManager:
|
||||||
ScriptTriggers:
|
ScriptTriggers:
|
||||||
MissionObjectives:
|
MissionObjectives:
|
||||||
|
WinNotification: Win
|
||||||
|
LoseNotification: Lose
|
||||||
|
LeaveNotification: Leave
|
||||||
ConquestVictoryConditions:
|
ConquestVictoryConditions:
|
||||||
PowerManager:
|
PowerManager:
|
||||||
AdviceInterval: 650
|
AdviceInterval: 650
|
||||||
|
|||||||
@@ -75,6 +75,9 @@ Player:
|
|||||||
SupportPowerManager:
|
SupportPowerManager:
|
||||||
ScriptTriggers:
|
ScriptTriggers:
|
||||||
MissionObjectives:
|
MissionObjectives:
|
||||||
|
WinNotification: Win
|
||||||
|
LoseNotification: Lose
|
||||||
|
LeaveNotification: Leave
|
||||||
ConquestVictoryConditions:
|
ConquestVictoryConditions:
|
||||||
PowerManager:
|
PowerManager:
|
||||||
SpeechNotification: LowPower
|
SpeechNotification: LowPower
|
||||||
|
|||||||
@@ -67,6 +67,9 @@ Player:
|
|||||||
SupportPowerManager:
|
SupportPowerManager:
|
||||||
ScriptTriggers:
|
ScriptTriggers:
|
||||||
MissionObjectives:
|
MissionObjectives:
|
||||||
|
WinNotification: Win
|
||||||
|
LoseNotification: Lose
|
||||||
|
LeaveNotification: Leave
|
||||||
ConquestVictoryConditions:
|
ConquestVictoryConditions:
|
||||||
PowerManager:
|
PowerManager:
|
||||||
SpeechNotification: LowPower
|
SpeechNotification: LowPower
|
||||||
|
|||||||
Reference in New Issue
Block a user