Rename ProductionQueueInfo.Race to Factions
Also add an upgrade rule.
This commit is contained in:
@@ -27,8 +27,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("Group queues from separate buildings together into the same tab.")]
|
[Desc("Group queues from separate buildings together into the same tab.")]
|
||||||
public readonly string Group = null;
|
public readonly string Group = null;
|
||||||
|
|
||||||
[Desc("Only enable this queue for certain factions")]
|
[Desc("Only enable this queue for certain factions.")]
|
||||||
public readonly string[] Race = { };
|
public readonly string[] Factions = { };
|
||||||
|
|
||||||
[Desc("Should the prerequisite remain enabled if the owner changes?")]
|
[Desc("Should the prerequisite remain enabled if the owner changes?")]
|
||||||
public readonly bool Sticky = true;
|
public readonly bool Sticky = true;
|
||||||
@@ -98,7 +98,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
developerMode = playerActor.Trait<DeveloperMode>();
|
developerMode = playerActor.Trait<DeveloperMode>();
|
||||||
|
|
||||||
Race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;
|
Race = init.Contains<FactionInit>() ? init.Get<FactionInit, string>() : self.Owner.Faction.InternalName;
|
||||||
Enabled = !info.Race.Any() || info.Race.Contains(Race);
|
Enabled = !info.Factions.Any() || info.Factions.Contains(Race);
|
||||||
|
|
||||||
CacheProduceables(playerActor);
|
CacheProduceables(playerActor);
|
||||||
}
|
}
|
||||||
@@ -124,7 +124,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!Info.Sticky)
|
if (!Info.Sticky)
|
||||||
{
|
{
|
||||||
Race = self.Owner.Faction.InternalName;
|
Race = self.Owner.Faction.InternalName;
|
||||||
Enabled = !Info.Race.Any() || Info.Race.Contains(Race);
|
Enabled = !Info.Factions.Any() || Info.Factions.Contains(Race);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Regenerate the produceables and tech tree state
|
// Regenerate the produceables and tech tree state
|
||||||
|
|||||||
@@ -1736,6 +1736,16 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
node.Key = "Offset";
|
node.Key = "Offset";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (engineVersion < 20150811)
|
||||||
|
{
|
||||||
|
if (node.Key.StartsWith("ProductionQueue"))
|
||||||
|
{
|
||||||
|
var race = node.Value.Nodes.FirstOrDefault(x => x.Key == "Race");
|
||||||
|
if (race != null)
|
||||||
|
race.Key = "Factions";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
UpgradeActorRules(engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ FACT:
|
|||||||
Facing: 108
|
Facing: 108
|
||||||
ProductionQueue@GDIBuilding:
|
ProductionQueue@GDIBuilding:
|
||||||
Type: Building.GDI
|
Type: Building.GDI
|
||||||
Race: gdi
|
Factions: gdi
|
||||||
Group: Building
|
Group: Building
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 2
|
LowPowerSlowdown: 2
|
||||||
@@ -31,7 +31,7 @@ FACT:
|
|||||||
ReadyAudio: ConstructionComplete
|
ReadyAudio: ConstructionComplete
|
||||||
ProductionQueue@NodBuilding:
|
ProductionQueue@NodBuilding:
|
||||||
Type: Building.Nod
|
Type: Building.Nod
|
||||||
Race: nod
|
Factions: nod
|
||||||
Group: Building
|
Group: Building
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 2
|
LowPowerSlowdown: 2
|
||||||
@@ -39,7 +39,7 @@ FACT:
|
|||||||
ReadyAudio: ConstructionComplete
|
ReadyAudio: ConstructionComplete
|
||||||
ProductionQueue@GDIDefense:
|
ProductionQueue@GDIDefense:
|
||||||
Type: Defence.GDI
|
Type: Defence.GDI
|
||||||
Race: gdi
|
Factions: gdi
|
||||||
Group: Defence
|
Group: Defence
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
@@ -47,7 +47,7 @@ FACT:
|
|||||||
ReadyAudio: ConstructionComplete
|
ReadyAudio: ConstructionComplete
|
||||||
ProductionQueue@NodDefense:
|
ProductionQueue@NodDefense:
|
||||||
Type: Defence.Nod
|
Type: Defence.Nod
|
||||||
Race: nod
|
Factions: nod
|
||||||
Group: Defence
|
Group: Defence
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
@@ -420,13 +420,13 @@ HPAD:
|
|||||||
RallyPoint:
|
RallyPoint:
|
||||||
ProductionQueue@GDI:
|
ProductionQueue@GDI:
|
||||||
Type: Aircraft.GDI
|
Type: Aircraft.GDI
|
||||||
Race: gdi
|
Factions: gdi
|
||||||
Group: Aircraft
|
Group: Aircraft
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
ProductionQueue@Nod:
|
ProductionQueue@Nod:
|
||||||
Type: Aircraft.Nod
|
Type: Aircraft.Nod
|
||||||
Race: nod
|
Factions: nod
|
||||||
Group: Aircraft
|
Group: Aircraft
|
||||||
BuildSpeed: .4
|
BuildSpeed: .4
|
||||||
LowPowerSlowdown: 3
|
LowPowerSlowdown: 3
|
||||||
|
|||||||
Reference in New Issue
Block a user