Unstatic the Sound class.

This commit is contained in:
Paul Chote
2015-09-05 18:31:21 +01:00
parent ff10fe3e07
commit ef55d646f7
82 changed files with 207 additions and 206 deletions

View File

@@ -187,7 +187,7 @@ namespace OpenRA.Mods.Common.Traits
self.World.Add(projectile);
if (args.Weapon.Report != null && args.Weapon.Report.Any())
Sound.Play(args.Weapon.Report.Random(self.World.SharedRandom), self.CenterPosition);
Game.Sound.Play(args.Weapon.Report.Random(self.World.SharedRandom), self.CenterPosition);
}
});

View File

@@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.Traits
notify.Charging(self, target);
if (!string.IsNullOrEmpty(attack.info.ChargeAudio))
Sound.Play(attack.info.ChargeAudio, self.CenterPosition);
Game.Sound.Play(attack.info.ChargeAudio, self.CenterPosition);
return Util.SequenceActivities(new Wait(attack.info.InitialChargeDelay), new ChargeFire(attack, target), this);
}

View File

@@ -204,7 +204,7 @@ namespace OpenRA.Mods.Common.Traits
public void BeforeTransform(Actor self)
{
foreach (var s in Info.UndeploySounds)
Sound.PlayToPlayer(self.Owner, s, self.CenterPosition);
Game.Sound.PlayToPlayer(self.Owner, s, self.CenterPosition);
}
public void OnTransform(Actor self) { }

View File

@@ -80,7 +80,7 @@ namespace OpenRA.Mods.Common.Traits
isPrimary = true;
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", "PrimaryBuildingSelected", self.Owner.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", "PrimaryBuildingSelected", self.Owner.Faction.InternalName);
}
}
}

View File

@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits
if (!Repairers.Remove(player) && Repairers.Count < Info.RepairBonuses.Length)
{
Repairers.Add(player);
Sound.PlayNotification(self.World.Map.Rules, player, "Speech", "Repairing", player.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", "Repairing", player.Faction.InternalName);
self.World.AddFrameEndTask(w =>
{

View File

@@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits
return;
var faction = info.NewOwnerVoice ? newOwner.Faction.InternalName : oldOwner.Faction.InternalName;
Sound.PlayNotification(self.World.Map.Rules, captor.World.LocalPlayer, "Speech", info.Notification, faction);
Game.Sound.PlayNotification(self.World.Map.Rules, captor.World.LocalPlayer, "Speech", info.Notification, faction);
}
}
}

View File

@@ -87,7 +87,7 @@ namespace OpenRA.Mods.Common.Traits
{
if (Cloaked)
{
Sound.Play(Info.UncloakSound, self.CenterPosition);
Game.Sound.Play(Info.UncloakSound, self.CenterPosition);
if (upgradeManager != null)
foreach (var u in Info.WhileCloakedUpgrades)
upgradeManager.RevokeUpgrade(self, u, this);
@@ -131,7 +131,7 @@ namespace OpenRA.Mods.Common.Traits
if (remainingTime > 0 && !IsTraitDisabled && !damageDisabled && --remainingTime <= 0)
{
Sound.Play(Info.CloakSound, self.CenterPosition);
Game.Sound.Play(Info.CloakSound, self.CenterPosition);
if (upgradeManager != null)
foreach (var u in Info.WhileCloakedUpgrades)
upgradeManager.GrantUpgrade(self, u, this);

View File

@@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.Traits
public virtual void Activate(Actor collector)
{
Sound.PlayToPlayer(collector.Owner, info.Notification);
Game.Sound.PlayToPlayer(collector.Owner, info.Notification);
if (info.Effect != null)
collector.World.AddFrameEndTask(w => w.Add(new CrateEffect(collector, info.Effect, info.Palette)));

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits
public void OnCrush(Actor crusher)
{
Sound.Play(info.CrushSound, crusher.CenterPosition);
Game.Sound.Play(info.CrushSound, crusher.CenterPosition);
var wda = self.TraitsImplementing<WithDeathAnimation>()
.FirstOrDefault(s => s.Info.CrushedSequence != null);
if (wda != null)

View File

@@ -81,7 +81,7 @@ namespace OpenRA.Mods.Common.Traits
w.Add(pilot);
pilot.QueueActivity(new Parachute(pilot, cp));
});
Sound.Play(info.ChuteSound, cp);
Game.Sound.Play(info.ChuteSound, cp);
}
else
{

View File

@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits
var weapon = e.Attacker.World.Map.Rules.Weapons[weaponName.ToLowerInvariant()];
if (weapon.Report != null && weapon.Report.Any())
Sound.Play(weapon.Report.Random(e.Attacker.World.SharedRandom), self.CenterPosition);
Game.Sound.Play(weapon.Report.Random(e.Attacker.World.SharedRandom), self.CenterPosition);
// Use .FromPos since this actor is killed. Cannot use Target.FromActor
weapon.Impact(Target.FromPos(self.CenterPosition), e.Attacker, Enumerable.Empty<int>());

View File

@@ -88,7 +88,7 @@ namespace OpenRA.Mods.Common.Traits
if (!silent)
{
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "LevelUp", self.Owner.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "LevelUp", self.Owner.Faction.InternalName);
self.World.AddFrameEndTask(w => w.Add(new CrateEffect(self, "levelup", info.LevelUpPalette)));
}
}

View File

@@ -87,7 +87,7 @@ namespace OpenRA.Mods.Common.Traits
w.Add(a);
a.QueueActivity(new Parachute(a, self.CenterPosition));
});
Sound.Play(info.ChuteSound, self.CenterPosition);
Game.Sound.Play(info.ChuteSound, self.CenterPosition);
}
static bool IsSuitableCell(Actor actorToDrop, CPos p)

View File

@@ -64,7 +64,7 @@ namespace OpenRA.Mods.Common.Traits
var terrain = self.World.Map.GetTerrainInfo(self.Location);
var sound = terrain.IsWater ? info.WaterImpactSound : info.GroundImpactSound;
Sound.Play(sound, self.CenterPosition);
Game.Sound.Play(sound, self.CenterPosition);
var sequence = terrain.IsWater ? info.WaterCorpseSequence : info.GroundCorpseSequence;
var palette = terrain.IsWater ? info.WaterCorpsePalette : info.GroundCorpsePalette;

View File

@@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Traits
if (self.World.WorldTick - lastAttackTime > info.NotifyInterval * 25)
{
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Faction.InternalName);
if (radarPings != null)
radarPings.Add(() => self.Owner == self.World.LocalPlayer, self.CenterPosition, info.RadarPingColor, info.RadarPingDuration);

View File

@@ -67,7 +67,7 @@ namespace OpenRA.Mods.Common.Traits
Game.RunAfterDelay(info.NotificationDelay, () =>
{
if (Game.IsCurrentWorld(player.World))
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Faction.InternalName);
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Faction.InternalName);
});
}
}
@@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Traits
Game.Debug("{0} is victorious.", player.PlayerName);
if (player == player.World.LocalPlayer)
Game.RunAfterDelay(info.NotificationDelay, () => Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Faction.InternalName));
Game.RunAfterDelay(info.NotificationDelay, () => Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Faction.InternalName));
}
public void OnObjectiveAdded(Player player, int id) { }

View File

@@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits
if (self.World.WorldTick - lastAttackTime > info.NotifyInterval * 25)
{
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.Notification, self.Owner.Faction.InternalName);
if (radarPings != null)
radarPings.Add(() => self.Owner == self.World.LocalPlayer, self.CenterPosition, info.RadarPingColor, info.RadarPingDuration);

View File

@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits
self.World.Add(playerBeacon);
if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
Sound.PlayNotification(self.World.Map.Rules, null, info.NotificationType, info.Notification,
Game.Sound.PlayNotification(self.World.Map.Rules, null, info.NotificationType, info.Notification,
self.World.RenderPlayer != null ? self.World.RenderPlayer.Faction.InternalName : null);
if (radarPings != null)

View File

@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Traits
if (playSounds)
foreach (var s in buildingInfo.BuildSounds)
Sound.PlayToPlayer(order.Player, s, building.CenterPosition);
Game.Sound.PlayToPlayer(order.Player, s, building.CenterPosition);
playSounds = false;
}
@@ -119,7 +119,7 @@ namespace OpenRA.Mods.Common.Traits
pluggable.EnablePlug(host, plugInfo.Type);
foreach (var s in buildingInfo.BuildSounds)
Sound.PlayToPlayer(order.Player, s, host.CenterPosition);
Game.Sound.PlayToPlayer(order.Player, s, host.CenterPosition);
}
else
{
@@ -135,7 +135,7 @@ namespace OpenRA.Mods.Common.Traits
});
foreach (var s in buildingInfo.BuildSounds)
Sound.PlayToPlayer(order.Player, s, building.CenterPosition);
Game.Sound.PlayToPlayer(order.Player, s, building.CenterPosition);
}
if (producer.Actor != null)
@@ -155,7 +155,7 @@ namespace OpenRA.Mods.Common.Traits
if (GetNumBuildables(self.Owner) > prevItems)
w.Add(new DelayedAction(info.NewOptionsNotificationDelay,
() => Sound.PlayNotification(self.World.Map.Rules, order.Player, "Speech", info.NewOptionsNotification, order.Player.Faction.InternalName)));
() => Game.Sound.PlayNotification(self.World.Map.Rules, order.Player, "Speech", info.NewOptionsNotification, order.Player.Faction.InternalName)));
});
}

View File

@@ -281,13 +281,13 @@ namespace OpenRA.Mods.Common.Traits
var isBuilding = unit.HasTraitInfo<BuildingInfo>();
if (isBuilding && !hasPlayedSound)
hasPlayedSound = Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
hasPlayedSound = Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
else if (!isBuilding)
{
if (BuildUnit(order.TargetString))
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.ReadyAudio, self.Owner.Faction.InternalName);
else if (!hasPlayedSound && time > 0)
hasPlayedSound = Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.BlockedAudio, self.Owner.Faction.InternalName);
hasPlayedSound = Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", Info.BlockedAudio, self.Owner.Faction.InternalName);
}
})));
}

View File

@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits
Game.RunAfterDelay(info.NotificationDelay, () =>
{
if (Game.IsCurrentWorld(player.World))
Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Faction.InternalName);
Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Lose", player.Faction.InternalName);
});
}
}
@@ -122,7 +122,7 @@ namespace OpenRA.Mods.Common.Traits
Game.Debug("{0} is victorious.", player.PlayerName);
if (player == player.World.LocalPlayer)
Game.RunAfterDelay(info.NotificationDelay, () => Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Faction.InternalName));
Game.RunAfterDelay(info.NotificationDelay, () => Game.Sound.PlayNotification(player.World.Map.Rules, player, "Speech", "Win", player.Faction.InternalName));
}
public void OnObjectiveAdded(Player player, int id) { }

View File

@@ -45,7 +45,7 @@ namespace OpenRA.Mods.Common.Traits
if (!IsTraitDisabled && order.OrderString == "PowerDown")
{
disabled = !disabled;
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", disabled ? "EnablePower" : "DisablePower", self.Owner.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", disabled ? "EnablePower" : "DisablePower", self.Owner.Faction.InternalName);
power.UpdateActor(self);
if (disabled)
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits
if (!disabled || !Info.CancelWhenDisabled)
return;
disabled = false;
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "EnablePower", self.Owner.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Sounds", "EnablePower", self.Owner.Faction.InternalName);
power.UpdateActor(self);
}
}

View File

@@ -112,7 +112,7 @@ namespace OpenRA.Mods.Common.Traits
if (--nextPowerAdviceTime <= 0)
{
if (lowPower)
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.SpeechNotification, self.Owner.Faction.InternalName);
nextPowerAdviceTime = info.AdviceInterval;
}

View File

@@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.Traits
self.CancelActivity();
foreach (var s in info.SellSounds)
Sound.PlayToPlayer(self.Owner, s, self.CenterPosition);
Game.Sound.PlayToPlayer(self.Owner, s, self.CenterPosition);
foreach (var ns in self.TraitsImplementing<INotifySold>())
ns.Selling(self);

View File

@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
public void Killed(Actor self, AttackInfo e)
{
var player = info.NotifyAll ? self.World.LocalPlayer : self.Owner;
Sound.PlayNotification(self.World.Map.Rules, player, "Speech", info.Notification, self.Owner.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, player, "Speech", info.Notification, self.Owner.Faction.InternalName);
}
}
}

View File

@@ -26,9 +26,9 @@ namespace OpenRA.Mods.Common.Traits
public AmbientSound(Actor self, AmbientSoundInfo info)
{
if (self.Info.HasTraitInfo<IOccupySpaceInfo>())
Sound.PlayLooped(info.SoundFile, self.CenterPosition);
Game.Sound.PlayLooped(info.SoundFile, self.CenterPosition);
else
Sound.PlayLooped(info.SoundFile);
Game.Sound.PlayLooped(info.SoundFile);
}
}
}

View File

@@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Traits
// Audio notification
if (discoverer != null && !string.IsNullOrEmpty(Info.Notification))
Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, discoverer, "Speech", Info.Notification, discoverer.Faction.InternalName);
// Radar notificaion
if (Info.PingRadar && radarPings.Value != null)

View File

@@ -40,12 +40,12 @@ namespace OpenRA.Mods.Common.Traits
if (e.DamageState == DamageState.Dead)
{
var sound = info.DestroyedSounds.RandomOrDefault(rand);
Sound.Play(sound, self.CenterPosition);
Game.Sound.Play(sound, self.CenterPosition);
}
else if (e.DamageState >= DamageState.Heavy && e.PreviousDamageState < DamageState.Heavy)
{
var sound = info.DamagedSounds.RandomOrDefault(rand);
Sound.Play(sound, self.CenterPosition);
Game.Sound.Play(sound, self.CenterPosition);
}
}
}

View File

@@ -128,7 +128,7 @@ namespace OpenRA.Mods.Common.Traits
self.World.AddFrameEndTask(w =>
{
var notification = self.Owner.IsAlliedWith(self.World.RenderPlayer) ? Info.LaunchSound : Info.IncomingSound;
Sound.Play(notification);
Game.Sound.Play(notification);
Actor distanceTestActor = null;
for (var i = -info.SquadSize / 2; i <= info.SquadSize / 2; i++)

View File

@@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits
public override IOrderGenerator OrderGenerator(string order, SupportPowerManager manager)
{
Sound.PlayToPlayer(manager.Self.Owner, Info.SelectTargetSound);
Game.Sound.PlayToPlayer(manager.Self.Owner, Info.SelectTargetSound);
return new SelectTarget(Self.World, order, manager, this);
}
@@ -58,7 +58,7 @@ namespace OpenRA.Mods.Common.Traits
self.Trait<WithSpriteBody>().PlayCustomAnimation(self, info.GrantUpgradeSequence);
Sound.Play(info.GrantUpgradeSound, self.World.Map.CenterOfCell(order.TargetLocation));
Game.Sound.Play(info.GrantUpgradeSound, self.World.Map.CenterOfCell(order.TargetLocation));
foreach (var a in UnitsInRange(order.TargetLocation))
{

View File

@@ -71,9 +71,9 @@ namespace OpenRA.Mods.Common.Traits
base.Activate(self, order, manager);
if (self.Owner.IsAlliedWith(self.World.RenderPlayer))
Sound.Play(Info.LaunchSound);
Game.Sound.Play(Info.LaunchSound);
else
Sound.Play(Info.IncomingSound);
Game.Sound.Play(Info.IncomingSound);
if (!string.IsNullOrEmpty(info.ActivationSequence))
{

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits
{
var location = self.World.Map.CenterOfCell(order.TargetLocation);
Sound.Play(info.DeploySound, location);
Game.Sound.Play(info.DeploySound, location);
if (!string.IsNullOrEmpty(info.EffectSequence) && !string.IsNullOrEmpty(info.EffectPalette))
w.Add(new SpriteEffect(location, w, info.EffectSequence, info.EffectPalette));

View File

@@ -73,12 +73,12 @@ namespace OpenRA.Mods.Common.Traits
public virtual void Charging(Actor self, string key)
{
Sound.PlayToPlayer(self.Owner, Info.BeginChargeSound);
Game.Sound.PlayToPlayer(self.Owner, Info.BeginChargeSound);
}
public virtual void Charged(Actor self, string key)
{
Sound.PlayToPlayer(self.Owner, Info.EndChargeSound);
Game.Sound.PlayToPlayer(self.Owner, Info.EndChargeSound);
}
public virtual void Activate(Actor self, Order order, SupportPowerManager manager)
@@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Traits
public virtual IOrderGenerator OrderGenerator(string order, SupportPowerManager manager)
{
Sound.PlayToPlayer(manager.Self.Owner, Info.SelectTargetSound);
Game.Sound.PlayToPlayer(manager.Self.Owner, Info.SelectTargetSound);
return new SelectGenericPowerTarget(order, manager, info.Cursor, MouseButton.Left);
}
}

View File

@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Traits
self.World.Add(projectile);
if (args.Weapon.Report != null && args.Weapon.Report.Any())
Sound.Play(args.Weapon.Report.Random(self.World.SharedRandom), self.CenterPosition);
Game.Sound.Play(args.Weapon.Report.Random(self.World.SharedRandom), self.CenterPosition);
}
});
}

View File

@@ -99,9 +99,9 @@ namespace OpenRA.Mods.Common.Traits
if (!CanDeploy() || (building != null && !building.Lock()))
{
foreach (var s in info.NoTransformSounds)
Sound.PlayToPlayer(self.Owner, s);
Game.Sound.PlayToPlayer(self.Owner, s);
Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.NoTransformNotification, self.Owner.Faction.InternalName);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", info.NoTransformNotification, self.Owner.Faction.InternalName);
return;
}

View File

@@ -98,7 +98,7 @@ namespace OpenRA.Mods.Common.Traits
self.QueueActivity(false, new CallFunc(() =>
{
if (!string.IsNullOrEmpty(info.UndeploySound))
Sound.Play(info.UndeploySound, self.CenterPosition);
Game.Sound.Play(info.UndeploySound, self.CenterPosition);
if (string.IsNullOrEmpty(info.DeployAnimation))
{
@@ -127,7 +127,7 @@ namespace OpenRA.Mods.Common.Traits
self.QueueActivity(new CallFunc(() =>
{
if (!string.IsNullOrEmpty(info.DeploySound))
Sound.Play(info.DeploySound, self.CenterPosition);
Game.Sound.Play(info.DeploySound, self.CenterPosition);
if (string.IsNullOrEmpty(info.DeployAnimation))
return;

View File

@@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Traits
if (cachedDisabled != disabled)
{
Sound.Play(disabled ? info.DisableSound : info.EnableSound, self.CenterPosition);
Game.Sound.Play(disabled ? info.DisableSound : info.EnableSound, self.CenterPosition);
desiredRange = disabled ? WDist.Zero : info.Range;
cachedDisabled = disabled;
}

View File

@@ -49,7 +49,7 @@ namespace OpenRA.Mods.Common.Traits
var type = Info.VoiceSet.ToLowerInvariant();
var volume = Info.Volume;
return Sound.PlayPredefined(self.World.Map.Rules, null, self, type, phrase, variant, true, WPos.Zero, volume, true);
return Game.Sound.PlayPredefined(self.World.Map.Rules, null, self, type, phrase, variant, true, WPos.Zero, volume, true);
}
public bool PlayVoiceLocal(Actor self, string phrase, string variant, float volume)
@@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits
return false;
var type = Info.VoiceSet.ToLowerInvariant();
return Sound.PlayPredefined(self.World.Map.Rules, null, self, type, phrase, variant, false, self.CenterPosition, volume, true);
return Game.Sound.PlayPredefined(self.World.Map.Rules, null, self, type, phrase, variant, false, self.CenterPosition, volume, true);
}
public bool HasVoice(Actor self, string voice)

View File

@@ -134,7 +134,7 @@ namespace OpenRA.Mods.Common.Traits
if (!SongExists(currentSong))
return;
Sound.PlayMusicThen(currentSong, () =>
Game.Sound.PlayMusicThen(currentSong, () =>
{
if (!CurrentSongIsBackground && !Game.Settings.Sound.Repeat)
currentSong = GetNextSong();
@@ -161,7 +161,7 @@ namespace OpenRA.Mods.Common.Traits
currentSong = music;
CurrentSongIsBackground = false;
Sound.PlayMusicThen(music, onComplete);
Game.Sound.PlayMusicThen(music, onComplete);
}
public MusicInfo GetNextSong()
@@ -195,7 +195,7 @@ namespace OpenRA.Mods.Common.Traits
public void Stop()
{
currentSong = null;
Sound.StopMusic();
Game.Sound.StopMusic();
if (currentBackgroundSong != null)
{
@@ -208,7 +208,7 @@ namespace OpenRA.Mods.Common.Traits
public void Disposing(Actor self)
{
if (currentSong != null)
Sound.StopMusic();
Game.Sound.StopMusic();
}
}
}

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.Common.Traits
public void WorldLoaded(World world, WorldRenderer wr)
{
Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName);
Game.Sound.PlayNotification(world.Map.Rules, null, "Speech", info.Notification, world.RenderPlayer == null ? null : world.RenderPlayer.Faction.InternalName);
}
}
}