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

@@ -96,8 +96,9 @@ namespace OpenRA
ISound Play(SoundType type, Player player, string name, bool headRelative, WPos pos, float volumeModifier = 1f, bool loop = false)
{
if (string.IsNullOrEmpty(name))
if (string.IsNullOrEmpty(name) || (DisableWorldSounds && type == SoundType.World))
return null;
if (player != null && player != player.World.LocalPlayer)
return null;
@@ -121,6 +122,7 @@ namespace OpenRA
soundEngine.Volume = 1f;
}
public bool DisableWorldSounds { get; set; }
public ISound Play(SoundType type, string name) { return Play(type, null, name, true, WPos.Zero, 1f); }
public ISound Play(SoundType type, string name, WPos pos) { return Play(type, null, name, false, pos, 1f); }
public ISound Play(SoundType type, string name, float volumeModifier) { return Play(type, null, name, true, WPos.Zero, volumeModifier); }
@@ -308,7 +310,7 @@ namespace OpenRA
if (ruleset == null)
throw new ArgumentNullException("ruleset");
if (definition == null)
if (definition == null || (DisableWorldSounds && soundType == SoundType.World))
return false;
if (ruleset.Voices == null || ruleset.Notifications == null)