Added field to ProductionQueue to customize ordering in ObserverProductionIconsWidget
This commit is contained in:
@@ -26,6 +26,9 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
[Desc("What kind of production will be added (e.g. Building, Infantry, Vehicle, ...)")]
|
[Desc("What kind of production will be added (e.g. Building, Infantry, Vehicle, ...)")]
|
||||||
public readonly string Type = null;
|
public readonly string Type = null;
|
||||||
|
|
||||||
|
[Desc("The value used when ordering this for display (e.g. in the Spectator UI).")]
|
||||||
|
public readonly int DisplayOrder = 0;
|
||||||
|
|
||||||
[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;
|
||||||
|
|
||||||
@@ -617,6 +620,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public bool Started { get; private set; }
|
public bool Started { get; private set; }
|
||||||
public int Slowdown { get; private set; }
|
public int Slowdown { get; private set; }
|
||||||
public bool Infinite { get; set; }
|
public bool Infinite { get; set; }
|
||||||
|
public int BuildPaletteOrder { get; private set; }
|
||||||
|
|
||||||
readonly ActorInfo ai;
|
readonly ActorInfo ai;
|
||||||
readonly BuildableInfo bi;
|
readonly BuildableInfo bi;
|
||||||
@@ -632,6 +636,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
this.pm = pm;
|
this.pm = pm;
|
||||||
ai = Queue.Actor.World.Map.Rules.Actors[Item];
|
ai = Queue.Actor.World.Map.Rules.Actors[Item];
|
||||||
bi = ai.TraitInfo<BuildableInfo>();
|
bi = ai.TraitInfo<BuildableInfo>();
|
||||||
|
BuildPaletteOrder = bi.BuildPaletteOrder;
|
||||||
Infinite = false;
|
Infinite = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -110,8 +110,8 @@ namespace OpenRA.Mods.Common.Widgets
|
|||||||
.Select(a => a.Trait.CurrentItem())
|
.Select(a => a.Trait.CurrentItem())
|
||||||
.Where(pi => pi != null)
|
.Where(pi => pi != null)
|
||||||
.GroupBy(pr => pr.Item)
|
.GroupBy(pr => pr.Item)
|
||||||
.OrderBy(g => g.First().Queue.Info.Type)
|
.OrderBy(g => g.First().Queue.Info.DisplayOrder)
|
||||||
.ThenBy(g => g.First().Item)
|
.ThenBy(g => g.First().BuildPaletteOrder)
|
||||||
.ToList();
|
.ToList();
|
||||||
|
|
||||||
Bounds.Width = currentItemsByItem.Count * (IconWidth + IconSpacing);
|
Bounds.Width = currentItemsByItem.Count * (IconWidth + IconSpacing);
|
||||||
|
|||||||
@@ -30,6 +30,7 @@ FACT:
|
|||||||
Prerequisites: global-factundeploy
|
Prerequisites: global-factundeploy
|
||||||
ProductionQueue@GDIBuilding:
|
ProductionQueue@GDIBuilding:
|
||||||
Type: Building.GDI
|
Type: Building.GDI
|
||||||
|
DisplayOrder: 0
|
||||||
Factions: gdi
|
Factions: gdi
|
||||||
Group: Building
|
Group: Building
|
||||||
LowPowerModifier: 200
|
LowPowerModifier: 200
|
||||||
@@ -41,6 +42,7 @@ FACT:
|
|||||||
CancelledAudio: Cancelled
|
CancelledAudio: Cancelled
|
||||||
ProductionQueue@NodBuilding:
|
ProductionQueue@NodBuilding:
|
||||||
Type: Building.Nod
|
Type: Building.Nod
|
||||||
|
DisplayOrder: 0
|
||||||
Factions: nod
|
Factions: nod
|
||||||
Group: Building
|
Group: Building
|
||||||
LowPowerModifier: 200
|
LowPowerModifier: 200
|
||||||
@@ -52,6 +54,7 @@ FACT:
|
|||||||
CancelledAudio: Cancelled
|
CancelledAudio: Cancelled
|
||||||
ProductionQueue@GDIDefense:
|
ProductionQueue@GDIDefense:
|
||||||
Type: Defence.GDI
|
Type: Defence.GDI
|
||||||
|
DisplayOrder: 1
|
||||||
Factions: gdi
|
Factions: gdi
|
||||||
Group: Defence
|
Group: Defence
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
@@ -63,6 +66,7 @@ FACT:
|
|||||||
CancelledAudio: Cancelled
|
CancelledAudio: Cancelled
|
||||||
ProductionQueue@NodDefense:
|
ProductionQueue@NodDefense:
|
||||||
Type: Defence.Nod
|
Type: Defence.Nod
|
||||||
|
DisplayOrder: 1
|
||||||
Factions: nod
|
Factions: nod
|
||||||
Group: Defence
|
Group: Defence
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
@@ -316,6 +320,7 @@ PYLE:
|
|||||||
Condition: produced
|
Condition: produced
|
||||||
ProductionQueue:
|
ProductionQueue:
|
||||||
Type: Infantry.GDI
|
Type: Infantry.GDI
|
||||||
|
DisplayOrder: 2
|
||||||
Group: Infantry
|
Group: Infantry
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
@@ -367,6 +372,7 @@ HAND:
|
|||||||
Produces: Infantry.Nod
|
Produces: Infantry.Nod
|
||||||
ProductionQueue:
|
ProductionQueue:
|
||||||
Type: Infantry.Nod
|
Type: Infantry.Nod
|
||||||
|
DisplayOrder: 2
|
||||||
Group: Infantry
|
Group: Infantry
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
@@ -428,6 +434,7 @@ AFLD:
|
|||||||
RequiresCondition: !build-incomplete
|
RequiresCondition: !build-incomplete
|
||||||
ProductionQueue:
|
ProductionQueue:
|
||||||
Type: Vehicle.Nod
|
Type: Vehicle.Nod
|
||||||
|
DisplayOrder: 3
|
||||||
Group: Vehicle
|
Group: Vehicle
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
BlockedAudio: NoBuild
|
BlockedAudio: NoBuild
|
||||||
@@ -486,6 +493,7 @@ WEAP:
|
|||||||
Produces: Vehicle.GDI
|
Produces: Vehicle.GDI
|
||||||
ProductionQueue:
|
ProductionQueue:
|
||||||
Type: Vehicle.GDI
|
Type: Vehicle.GDI
|
||||||
|
DisplayOrder: 3
|
||||||
Group: Vehicle
|
Group: Vehicle
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
@@ -538,6 +546,7 @@ HPAD:
|
|||||||
RallyPoint:
|
RallyPoint:
|
||||||
ProductionQueue@GDI:
|
ProductionQueue@GDI:
|
||||||
Type: Aircraft.GDI
|
Type: Aircraft.GDI
|
||||||
|
DisplayOrder: 4
|
||||||
Factions: gdi
|
Factions: gdi
|
||||||
Group: Aircraft
|
Group: Aircraft
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
@@ -549,6 +558,7 @@ HPAD:
|
|||||||
CancelledAudio: Cancelled
|
CancelledAudio: Cancelled
|
||||||
ProductionQueue@Nod:
|
ProductionQueue@Nod:
|
||||||
Type: Aircraft.Nod
|
Type: Aircraft.Nod
|
||||||
|
DisplayOrder: 4
|
||||||
Factions: nod
|
Factions: nod
|
||||||
Group: Aircraft
|
Group: Aircraft
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Player:
|
|||||||
TechTree:
|
TechTree:
|
||||||
ClassicProductionQueue@Building:
|
ClassicProductionQueue@Building:
|
||||||
Type: Building
|
Type: Building
|
||||||
|
DisplayOrder: 0
|
||||||
BuildDurationModifier: 250
|
BuildDurationModifier: 250
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: BuildingReady
|
ReadyAudio: BuildingReady
|
||||||
@@ -20,6 +21,7 @@ Player:
|
|||||||
SpeedUp: true
|
SpeedUp: true
|
||||||
ClassicProductionQueue@Infantry:
|
ClassicProductionQueue@Infantry:
|
||||||
Type: Infantry
|
Type: Infantry
|
||||||
|
DisplayOrder: 1
|
||||||
BuildDurationModifier: 250
|
BuildDurationModifier: 250
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
@@ -30,6 +32,7 @@ Player:
|
|||||||
SpeedUp: true
|
SpeedUp: true
|
||||||
ClassicProductionQueue@Vehicle:
|
ClassicProductionQueue@Vehicle:
|
||||||
Type: Vehicle
|
Type: Vehicle
|
||||||
|
DisplayOrder: 2
|
||||||
BuildDurationModifier: 250
|
BuildDurationModifier: 250
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
@@ -40,6 +43,7 @@ Player:
|
|||||||
SpeedUp: true
|
SpeedUp: true
|
||||||
ClassicProductionQueue@Armor:
|
ClassicProductionQueue@Armor:
|
||||||
Type: Armor
|
Type: Armor
|
||||||
|
DisplayOrder: 3
|
||||||
BuildDurationModifier: 250
|
BuildDurationModifier: 250
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
@@ -50,6 +54,7 @@ Player:
|
|||||||
SpeedUp: true
|
SpeedUp: true
|
||||||
ClassicProductionQueue@Starport:
|
ClassicProductionQueue@Starport:
|
||||||
Type: Starport
|
Type: Starport
|
||||||
|
DisplayOrder: 4
|
||||||
BuildDurationModifier: 212
|
BuildDurationModifier: 212
|
||||||
BlockedAudio: NoRoom
|
BlockedAudio: NoRoom
|
||||||
QueuedAudio: OrderPlaced
|
QueuedAudio: OrderPlaced
|
||||||
@@ -57,6 +62,7 @@ Player:
|
|||||||
CancelledAudio: Cancelled
|
CancelledAudio: Cancelled
|
||||||
ClassicProductionQueue@Aircraft:
|
ClassicProductionQueue@Aircraft:
|
||||||
Type: Aircraft
|
Type: Aircraft
|
||||||
|
DisplayOrder: 5
|
||||||
BuildDurationModifier: 312
|
BuildDurationModifier: 312
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ Player:
|
|||||||
TechTree:
|
TechTree:
|
||||||
ClassicProductionQueue@Building:
|
ClassicProductionQueue@Building:
|
||||||
Type: Building
|
Type: Building
|
||||||
|
DisplayOrder: 0
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: ConstructionComplete
|
ReadyAudio: ConstructionComplete
|
||||||
BlockedAudio: NoBuild
|
BlockedAudio: NoBuild
|
||||||
@@ -20,6 +21,7 @@ Player:
|
|||||||
SpeedUp: True
|
SpeedUp: True
|
||||||
ClassicProductionQueue@Defense:
|
ClassicProductionQueue@Defense:
|
||||||
Type: Defense
|
Type: Defense
|
||||||
|
DisplayOrder: 1
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: ConstructionComplete
|
ReadyAudio: ConstructionComplete
|
||||||
BlockedAudio: NoBuild
|
BlockedAudio: NoBuild
|
||||||
@@ -30,6 +32,7 @@ Player:
|
|||||||
SpeedUp: True
|
SpeedUp: True
|
||||||
ClassicProductionQueue@Vehicle:
|
ClassicProductionQueue@Vehicle:
|
||||||
Type: Vehicle
|
Type: Vehicle
|
||||||
|
DisplayOrder: 3
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
BlockedAudio: NoBuild
|
BlockedAudio: NoBuild
|
||||||
@@ -41,6 +44,7 @@ Player:
|
|||||||
BuildTimeSpeedReduction: 100, 75, 60, 50
|
BuildTimeSpeedReduction: 100, 75, 60, 50
|
||||||
ClassicProductionQueue@Infantry:
|
ClassicProductionQueue@Infantry:
|
||||||
Type: Infantry
|
Type: Infantry
|
||||||
|
DisplayOrder: 2
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
BlockedAudio: NoBuild
|
BlockedAudio: NoBuild
|
||||||
@@ -51,6 +55,7 @@ Player:
|
|||||||
SpeedUp: True
|
SpeedUp: True
|
||||||
ClassicProductionQueue@Ship:
|
ClassicProductionQueue@Ship:
|
||||||
Type: Ship
|
Type: Ship
|
||||||
|
DisplayOrder: 5
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
BlockedAudio: NoBuild
|
BlockedAudio: NoBuild
|
||||||
@@ -61,6 +66,7 @@ Player:
|
|||||||
SpeedUp: True
|
SpeedUp: True
|
||||||
ClassicProductionQueue@Aircraft:
|
ClassicProductionQueue@Aircraft:
|
||||||
Type: Aircraft
|
Type: Aircraft
|
||||||
|
DisplayOrder: 4
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
BlockedAudio: NoBuild
|
BlockedAudio: NoBuild
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ Player:
|
|||||||
GrantConditionOnPrerequisiteManager:
|
GrantConditionOnPrerequisiteManager:
|
||||||
ClassicProductionQueue@Building:
|
ClassicProductionQueue@Building:
|
||||||
Type: Building
|
Type: Building
|
||||||
|
DisplayOrder: 0
|
||||||
BuildDurationModifier: 120
|
BuildDurationModifier: 120
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: ConstructionComplete
|
ReadyAudio: ConstructionComplete
|
||||||
@@ -21,6 +22,7 @@ Player:
|
|||||||
SpeedUp: True
|
SpeedUp: True
|
||||||
ClassicProductionQueue@Defense:
|
ClassicProductionQueue@Defense:
|
||||||
Type: Defense
|
Type: Defense
|
||||||
|
DisplayOrder: 1
|
||||||
BuildDurationModifier: 120
|
BuildDurationModifier: 120
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: ConstructionComplete
|
ReadyAudio: ConstructionComplete
|
||||||
@@ -31,6 +33,7 @@ Player:
|
|||||||
SpeedUp: True
|
SpeedUp: True
|
||||||
ClassicProductionQueue@Vehicle:
|
ClassicProductionQueue@Vehicle:
|
||||||
Type: Vehicle
|
Type: Vehicle
|
||||||
|
DisplayOrder: 3
|
||||||
BuildDurationModifier: 120
|
BuildDurationModifier: 120
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
@@ -41,6 +44,7 @@ Player:
|
|||||||
SpeedUp: True
|
SpeedUp: True
|
||||||
ClassicProductionQueue@Infantry:
|
ClassicProductionQueue@Infantry:
|
||||||
Type: Infantry
|
Type: Infantry
|
||||||
|
DisplayOrder: 2
|
||||||
BuildDurationModifier: 120
|
BuildDurationModifier: 120
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
@@ -51,6 +55,7 @@ Player:
|
|||||||
SpeedUp: True
|
SpeedUp: True
|
||||||
ClassicProductionQueue@Air:
|
ClassicProductionQueue@Air:
|
||||||
Type: Air
|
Type: Air
|
||||||
|
DisplayOrder: 4
|
||||||
BuildDurationModifier: 120
|
BuildDurationModifier: 120
|
||||||
LowPowerModifier: 300
|
LowPowerModifier: 300
|
||||||
ReadyAudio: UnitReady
|
ReadyAudio: UnitReady
|
||||||
|
|||||||
Reference in New Issue
Block a user