Disable sound on the shell maps.

This commit is contained in:
Paul Chote
2016-12-10 17:50:46 +00:00
parent 9ddfdc45b3
commit 443c3ee72d
6 changed files with 16 additions and 2 deletions

View File

@@ -32,6 +32,9 @@ namespace OpenRA.Mods.Common.Traits
"It cannot be paused, but can be overridden by selecting a new track.")]
public readonly string BackgroundMusic = null;
[Desc("Disable all world sounds (combat etc).")]
public readonly bool DisableWorldSounds = false;
public object Create(ActorInitializer init) { return new MusicPlaylist(init.World, this); }
}
@@ -55,6 +58,9 @@ namespace OpenRA.Mods.Common.Traits
this.info = info;
this.world = world;
if (info.DisableWorldSounds)
Game.Sound.DisableWorldSounds = true;
IsMusicInstalled = world.Map.Rules.InstalledMusic.Any();
if (!IsMusicInstalled)
return;
@@ -220,6 +226,8 @@ namespace OpenRA.Mods.Common.Traits
{
if (currentSong != null)
Game.Sound.StopMusic();
Game.Sound.DisableWorldSounds = false;
}
}
}