Disable world sounds when the ingame menu is open.

This commit is contained in:
Paul Chote
2016-12-10 18:41:31 +00:00
parent 443c3ee72d
commit 55f76c02d6
8 changed files with 18 additions and 0 deletions

View File

@@ -105,12 +105,19 @@ namespace OpenRA.Mods.Common.Widgets.Logic
if (button.Pause && world.LobbyInfo.IsSinglePlayer)
world.SetPauseState(true);
var cachedDisableWorldSounds = Game.Sound.DisableWorldSounds;
if (button.DisableWorldSounds)
Game.Sound.DisableWorldSounds = true;
widgetArgs = widgetArgs ?? new WidgetArgs();
widgetArgs.Add("onExit", () =>
{
if (button.HideIngameUI)
worldRoot.IsVisible = () => true;
if (button.DisableWorldSounds)
Game.Sound.DisableWorldSounds = cachedDisableWorldSounds;
if (button.Pause && world.LobbyInfo.IsSinglePlayer)
world.SetPauseState(cachedPause);