Remove legacy .aud sound defaults from Common traits

While C&C-specific sound defaults might be acceptable for C&C-specific traits like MadTank and Chronoshiftable, for common, generic traits like Building they no longer are.
This commit is contained in:
reaperrr
2017-09-10 12:45:49 +02:00
committed by abcdefg30
parent 58b5e7b243
commit d643d2ebda
5 changed files with 40 additions and 5 deletions

View File

@@ -55,9 +55,9 @@ namespace OpenRA.Mods.Common.Traits
[Desc("Clear smudges from underneath the building footprint on transform.")] [Desc("Clear smudges from underneath the building footprint on transform.")]
public readonly bool RemoveSmudgesOnTransform = true; public readonly bool RemoveSmudgesOnTransform = true;
public readonly string[] BuildSounds = { "placbldg.aud", "build5.aud" }; public readonly string[] BuildSounds = { };
public readonly string[] UndeploySounds = { "cashturn.aud" }; public readonly string[] UndeploySounds = { };
public virtual object Create(ActorInitializer init) { return new Building(init, this); } public virtual object Create(ActorInitializer init) { return new Building(init, this); }

View File

@@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly int SuccessRate = 50; public readonly int SuccessRate = 50;
[Desc("Sound to play when ejecting the pilot from the aircraft.")] [Desc("Sound to play when ejecting the pilot from the aircraft.")]
public readonly string ChuteSound = "chute1.aud"; public readonly string ChuteSound = null;
[Desc("Can a destroyed aircraft eject its pilot while it has not yet fallen to ground level?")] [Desc("Can a destroyed aircraft eject its pilot while it has not yet fallen to ground level?")]
public readonly bool EjectInAir = false; public readonly bool EjectInAir = false;

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
public readonly WDist DropRange = WDist.FromCells(4); public readonly WDist DropRange = WDist.FromCells(4);
[Desc("Sound to play when dropping.")] [Desc("Sound to play when dropping.")]
public readonly string ChuteSound = "chute1.aud"; public readonly string ChuteSound = null;
public object Create(ActorInitializer init) { return new ParaDrop(init.Self, this); } public object Create(ActorInitializer init) { return new ParaDrop(init.Self, this); }
} }

View File

@@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
[ActorReference(typeof(AircraftInfo))] public readonly string ActorType = "badr"; [ActorReference(typeof(AircraftInfo))] public readonly string ActorType = "badr";
[Desc("Sound to play when dropping the unit.")] [Desc("Sound to play when dropping the unit.")]
public readonly string ChuteSound = "chute1.aud"; public readonly string ChuteSound = null;
[Desc("Notification to play when dropping the unit.")] [Desc("Notification to play when dropping the unit.")]
public readonly string ReadyAudio = null; public readonly string ReadyAudio = null;

View File

@@ -1674,6 +1674,41 @@ namespace OpenRA.Mods.Common.UtilityCommands
} }
} }
if (engineVersion < 20180309)
{
if (node.Key == "ParaDrop")
{
var soundNodePD = node.Value.Nodes.FirstOrDefault(n => n.Key == "ChuteSound");
if (soundNodePD == null)
node.Value.Nodes.Add(new MiniYamlNode("ChuteSound", "chute1.aud"));
}
if (depth == 1 && node.Key == "EjectOnDeath")
{
var soundNodeEOD = node.Value.Nodes.FirstOrDefault(n => n.Key == "ChuteSound");
if (soundNodeEOD == null)
node.Value.Nodes.Add(new MiniYamlNode("ChuteSound", "chute1.aud"));
}
if (node.Key.StartsWith("ProductionParadrop", StringComparison.Ordinal))
{
var soundNodePP = node.Value.Nodes.FirstOrDefault(n => n.Key == "ChuteSound");
if (soundNodePP == null)
node.Value.Nodes.Add(new MiniYamlNode("ChuteSound", "chute1.aud"));
}
if (node.Key == "Building")
{
var soundNodeB1 = node.Value.Nodes.FirstOrDefault(n => n.Key == "BuildSounds");
if (soundNodeB1 == null)
node.Value.Nodes.Add(new MiniYamlNode("BuildSounds", "placbldg.aud, build5.aud"));
var soundNodeB2 = node.Value.Nodes.FirstOrDefault(n => n.Key == "UndeploySounds");
if (soundNodeB2 == null)
node.Value.Nodes.Add(new MiniYamlNode("UndeploySounds", "cashturn.aud"));
}
}
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1); UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
} }