Disable sound on the shell maps.
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user