Extracted BuildingCannotPlaceAudio to PlaceBuilding.

This commit is contained in:
Andre Mohren
2018-07-22 14:02:08 +02:00
committed by abcdefg30
parent 8834cee13c
commit c2b1a5f4e0
6 changed files with 8 additions and 2 deletions

View File

@@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Orders
orderType = "PlacePlug"; orderType = "PlacePlug";
if (!AcceptsPlug(topLeft, plugInfo)) if (!AcceptsPlug(topLeft, plugInfo))
{ {
Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", "BuildingCannotPlaceAudio", owner.Faction.InternalName); Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", placeBuildingInfo.CannotPlaceNotification, owner.Faction.InternalName);
yield break; yield break;
} }
} }
@@ -127,7 +127,7 @@ namespace OpenRA.Mods.Common.Orders
foreach (var order in ClearBlockersOrders(world, topLeft)) foreach (var order in ClearBlockersOrders(world, topLeft))
yield return order; yield return order;
Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", "BuildingCannotPlaceAudio", owner.Faction.InternalName); Game.Sound.PlayNotification(world.Map.Rules, owner, "Speech", placeBuildingInfo.CannotPlaceNotification, owner.Faction.InternalName);
yield break; yield break;
} }

View File

@@ -34,6 +34,8 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Notification to play after building placement if new construction options are available.")] [Desc("Notification to play after building placement if new construction options are available.")]
public readonly string NewOptionsNotification = null; public readonly string NewOptionsNotification = null;
public readonly string CannotPlaceNotification = null;
public object Create(ActorInitializer init) { return new PlaceBuilding(this); } public object Create(ActorInitializer init) { return new PlaceBuilding(this); }
} }

View File

@@ -9,6 +9,7 @@ Player:
Inherits: ^BasePlayer Inherits: ^BasePlayer
PlaceBuilding: PlaceBuilding:
NewOptionsNotification: NewOptions NewOptionsNotification: NewOptions
CannotPlaceNotification: BuildingCannotPlaceAudio
TechTree: TechTree:
SupportPowerManager: SupportPowerManager:
ScriptTriggers: ScriptTriggers:

View File

@@ -59,6 +59,7 @@ Player:
BlockedAudio: NoRoom BlockedAudio: NoRoom
PlaceBuilding: PlaceBuilding:
NewOptionsNotification: NewOptions NewOptionsNotification: NewOptions
CannotPlaceNotification: BuildingCannotPlaceAudio
SupportPowerManager: SupportPowerManager:
ScriptTriggers: ScriptTriggers:
MissionObjectives: MissionObjectives:

View File

@@ -48,6 +48,7 @@ Player:
SpeedUp: True SpeedUp: True
PlaceBuilding: PlaceBuilding:
NewOptionsNotification: NewOptions NewOptionsNotification: NewOptions
CannotPlaceNotification: BuildingCannotPlaceAudio
SupportPowerManager: SupportPowerManager:
ScriptTriggers: ScriptTriggers:
MissionObjectives: MissionObjectives:

View File

@@ -50,6 +50,7 @@ Player:
SpeedUp: True SpeedUp: True
PlaceBuilding: PlaceBuilding:
NewOptionsNotification: NewOptions NewOptionsNotification: NewOptions
CannotPlaceNotification: BuildingCannotPlaceAudio
Palette: placebuilding Palette: placebuilding
LineBuildSegmentPalette: placelinesegment LineBuildSegmentPalette: placelinesegment
SupportPowerManager: SupportPowerManager: