Add a delay before playing the win/lose audio notification.

This commit is contained in:
Paul Chote
2011-07-14 22:44:32 +12:00
parent bc1a50693c
commit e39d45d108

View File

@@ -17,6 +17,7 @@ namespace OpenRA.Mods.RA
{
public string WinNotification = null;
public string LoseNotification = null;
public int NotificationDelay = 1500; // Milliseconds
public object Create(ActorInitializer init) { return new ConquestVictoryConditions(this); }
}
@@ -63,7 +64,7 @@ namespace OpenRA.Mods.RA
if (self.Owner == self.World.LocalPlayer)
{
self.World.LocalShroud.Disabled = true;
Sound.Play(Info.LoseNotification);
Game.RunAfterDelay(Info.NotificationDelay, () => Sound.Play(Info.LoseNotification));
}
}
@@ -76,7 +77,7 @@ namespace OpenRA.Mods.RA
if (self.Owner == self.World.LocalPlayer)
{
self.World.LocalShroud.Disabled = true;
Sound.Play(Info.WinNotification);
Game.RunAfterDelay(Info.NotificationDelay, () => Sound.Play(Info.WinNotification));
}
}
}