Add support for playing a BridgeRepaired notification

This commit is contained in:
abcdefg30
2016-01-23 18:48:16 +01:00
parent 085367ced6
commit db1d83fc4e
2 changed files with 9 additions and 2 deletions

View File

@@ -16,11 +16,13 @@ namespace OpenRA.Mods.Common.Activities
class RepairBridge : Enter
{
readonly BridgeHut hut;
readonly string notification;
public RepairBridge(Actor self, Actor target, EnterBehaviour enterBehaviour)
public RepairBridge(Actor self, Actor target, EnterBehaviour enterBehaviour, string notification)
: base(self, target, enterBehaviour)
{
hut = target.Trait<BridgeHut>();
this.notification = notification;
}
protected override bool CanReserve(Actor self)
@@ -34,6 +36,8 @@ namespace OpenRA.Mods.Common.Activities
return;
hut.Repair(self);
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", notification, self.Owner.Faction.InternalName);
}
}
}