Introduce SoundType enum.

This commit is contained in:
Paul Chote
2016-12-10 17:38:44 +00:00
parent 28182ddc36
commit 9ddfdc45b3
48 changed files with 83 additions and 80 deletions

View File

@@ -50,7 +50,7 @@ namespace OpenRA.Mods.RA.Activities
self.Trait<WithInfantryBody>().Attacking(self, Target.FromActor(target), a);
if (weapon.Report != null && weapon.Report.Any())
Game.Sound.Play(weapon.Report.Random(self.World.SharedRandom), self.CenterPosition);
Game.Sound.Play(SoundType.World, weapon.Report.Random(self.World.SharedRandom), self.CenterPosition);
}
public override Activity Tick(Actor self)

View File

@@ -60,8 +60,8 @@ namespace OpenRA.Mods.RA.Activities
destination = bestCell.Value;
Game.Sound.Play(sound, self.CenterPosition);
Game.Sound.Play(sound, self.World.Map.CenterOfCell(destination));
Game.Sound.Play(SoundType.World, sound, self.CenterPosition);
Game.Sound.Play(SoundType.World, sound, self.World.Map.CenterOfCell(destination));
self.Trait<IPositionable>().SetPosition(self, destination);
self.Generation++;

View File

@@ -159,9 +159,9 @@ namespace OpenRA.Mods.RA.Traits
wfsb.PlayCustomAnimationRepeating(self, info.ThumpSequence);
deployed = true;
self.QueueActivity(new Wait(info.ChargeDelay, false));
self.QueueActivity(new CallFunc(() => Game.Sound.Play(info.ChargeSound, self.CenterPosition)));
self.QueueActivity(new CallFunc(() => Game.Sound.Play(SoundType.World, info.ChargeSound, self.CenterPosition)));
self.QueueActivity(new Wait(info.DetonationDelay, false));
self.QueueActivity(new CallFunc(() => Game.Sound.Play(info.DetonationSound, self.CenterPosition)));
self.QueueActivity(new CallFunc(() => Game.Sound.Play(SoundType.World, info.DetonationSound, self.CenterPosition)));
self.QueueActivity(new CallFunc(Detonate));
}

View File

@@ -55,7 +55,7 @@ namespace OpenRA.Mods.RA.Traits
public override void SelectTarget(Actor self, string order, SupportPowerManager manager)
{
Game.Sound.PlayToPlayer(manager.Self.Owner, Info.SelectTargetSound);
Game.Sound.PlayToPlayer(SoundType.UI, manager.Self.Owner, Info.SelectTargetSound);
self.World.OrderGenerator = new SelectChronoshiftTarget(Self.World, order, manager, this);
}

View File

@@ -74,7 +74,7 @@ namespace OpenRA.Mods.RA.Traits
self.World.AddFrameEndTask(w =>
{
Game.Sound.PlayToPlayer(self.Owner, Info.LaunchSound);
Game.Sound.PlayToPlayer(SoundType.World, self.Owner, Info.LaunchSound);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech",
Info.LaunchSpeechNotification, self.Owner.Faction.InternalName);