Disable world sounds when the ingame menu is open.
This commit is contained in:
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user