Restore radar enable/disable sounds.

This commit is contained in:
Paul Chote
2013-07-08 21:06:30 +12:00
parent 948eaa03c5
commit ec15aa5ee4
2 changed files with 11 additions and 1 deletions

View File

@@ -135,6 +135,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic
return Color.LimeGreen;
};
var cachedRadarActive = false;
var sidebarTicker = playerWidgets.Get<LogicTickerWidget>("SIDEBAR_TICKER");
sidebarTicker.OnTick = () =>
{
@@ -142,6 +143,10 @@ namespace OpenRA.Mods.RA.Widgets.Logic
radarActive = world.ActorsWithTrait<ProvidesRadar>()
.Any(a => a.Actor.Owner == world.LocalPlayer && a.Trait.IsActive);
if (radarActive != cachedRadarActive)
Sound.PlayNotification(null, "Sounds", (radarActive ? "RadarUp" : "RadarDown"), null);
cachedRadarActive = radarActive;
// Switch to observer mode after win/loss
if (world.LocalPlayer.WinState != WinState.Undefined)
Game.RunAfterTick(() =>