fixed various sound bugs

This commit is contained in:
Chris Forbes
2010-01-25 20:40:04 +13:00
parent f0ae162fb0
commit 890ff42c70
4 changed files with 23 additions and 11 deletions

View File

@@ -34,7 +34,8 @@ namespace OpenRa.Traits
if (order.OrderString == "PowerDown") if (order.OrderString == "PowerDown")
{ {
IsDisabled = !IsDisabled; IsDisabled = !IsDisabled;
Sound.Play((IsDisabled) ? "bleep12.aud" : "bleep11.aud"); if (self.Owner == self.World.LocalPlayer)
Sound.Play(IsDisabled ? "bleep12.aud" : "bleep11.aud");
} }
} }
} }

View File

@@ -95,6 +95,8 @@ namespace OpenRa.Traits
} }
} }
isPrimary = true; isPrimary = true;
if (self.Owner == self.World.LocalPlayer)
Sound.Play("pribldg1.aud"); Sound.Play("pribldg1.aud");
} }
} }

View File

@@ -95,6 +95,8 @@ namespace OpenRa.Traits
public void Selling( Actor self ) public void Selling( Actor self )
{ {
anim.PlayBackwardsThen( "make", null ); anim.PlayBackwardsThen( "make", null );
if (self.Owner == self.World.LocalPlayer)
Sound.Play("cashturn.aud"); Sound.Play("cashturn.aud");
} }

View File

@@ -10,16 +10,22 @@ namespace OpenRa.Traits
public override object Create(Actor self) { return new SonarPulsePower(self, this); } public override object Create(Actor self) { return new SonarPulsePower(self, this); }
} }
public class SonarPulsePower : SupportPower public class SonarPulsePower : SupportPower, IResolveOrder
{ {
public SonarPulsePower(Actor self, SonarPulsePowerInfo info) : base(self, info) { } public SonarPulsePower(Actor self, SonarPulsePowerInfo info) : base(self, info) { }
protected override void OnBeginCharging() { } protected override void OnBeginCharging() { }
protected override void OnFinishCharging() { Sound.Play("pulse1.aud"); } protected override void OnFinishCharging() { Sound.Play("pulse1.aud"); }
protected override void OnActivate() protected override void OnActivate()
{ {
// Question: Is this method synced? or does it have to go via an order? Game.orderManager.IssueOrder(new Order("SonarPulse", Owner.PlayerActor));
}
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString == "SonarPulse")
{
// TODO: Reveal submarines // TODO: Reveal submarines
// Should this play for all players? // Should this play for all players?
@@ -27,4 +33,5 @@ namespace OpenRa.Traits
FinishActivate(); FinishActivate();
} }
} }
}
} }