Skip to content

Commit

Permalink
Add the Oil Derrick count to the economy statistics
Browse files Browse the repository at this point in the history
  • Loading branch information
abcdefg30 committed Sep 1, 2019
1 parent 9472b9c commit c33d994
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 4 deletions.
4 changes: 4 additions & 0 deletions OpenRA.Mods.Common/Widgets/Logic/Ingame/ObserverStatsLogic.cs
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,10 @@ ScrollItemWidget EconomyStats(Player player)
var harvesters = template.Get<LabelWidget>("HARVESTERS");
harvesters.GetText = () => world.ActorsHavingTrait<Harvester>().Count(a => a.Owner == player && !a.IsDead).ToString();

var cashTricklers = template.GetOrNull<LabelWidget>("DERRICKS");
if (cashTricklers != null)
cashTricklers.GetText = () => world.ActorsHavingTrait<UpdatesDerrickCount>().Count(a => a.Owner == player && !a.IsDead).ToString();

return template;
}

Expand Down
19 changes: 17 additions & 2 deletions mods/cnc/chrome/ingame.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -397,7 +397,7 @@ Container@OBSERVER_WIDGETS:
Container@ECONOMY_STATS_HEADERS:
X: 0
Y: 0
Width: 745
Width: 845
Height: PARENT_BOTTOM
Children:
ColorBlock@HEADER_COLOR:
Expand Down Expand Up @@ -476,6 +476,14 @@ Container@OBSERVER_WIDGETS:
Text: Harvesters
Align: Right
Shadow: True
Label@DERRICKS_HEADER:
X: 760
Width: 80
Height: PARENT_BOTTOM
Font: Bold
Text: Oil Derricks
Align: Right
Shadow: True
Container@PRODUCTION_STATS_HEADERS:
X: 0
Y: 0
Expand Down Expand Up @@ -773,7 +781,7 @@ Container@OBSERVER_WIDGETS:
ScrollItem@ECONOMY_PLAYER_TEMPLATE:
X: 0
Y: 0
Width: 745
Width: 845
Height: 24
BaseName: scrollitem-nohover
Children:
Expand Down Expand Up @@ -850,6 +858,13 @@ Container@OBSERVER_WIDGETS:
Height: PARENT_BOTTOM
Align: Right
Shadow: True
Label@DERRICKS:
X: 760
Y: 0
Width: 80
Height: PARENT_BOTTOM
Align: Right
Shadow: True
ScrollItem@PRODUCTION_PLAYER_TEMPLATE:
X: 0
Y: 0
Expand Down
1 change: 1 addition & 0 deletions mods/cnc/rules/tech.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ V19:
ValidStances: Neutral, Enemy
SpawnActorOnDeath:
Actor: V19.Husk
UpdatesDerrickCount:

V19.Husk:
Inherits: ^CivBuildingHusk
Expand Down
19 changes: 17 additions & 2 deletions mods/ra/chrome/ingame-observer.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ Container@OBSERVER_WIDGETS:
Container@ECONOMY_STATS_HEADERS:
X: 0
Y: 0
Width: 745
Width: 845
Height: PARENT_BOTTOM
Children:
ColorBlock@HEADER_COLOR:
Expand Down Expand Up @@ -412,6 +412,14 @@ Container@OBSERVER_WIDGETS:
Text: Harvesters
Align: Right
Shadow: True
Label@DERRICKS_HEADER:
X: 760
Width: 80
Height: PARENT_BOTTOM
Font: Bold
Text: Oil Derricks
Align: Right
Shadow: True
Container@PRODUCTION_STATS_HEADERS:
X: 0
Y: 0
Expand Down Expand Up @@ -711,7 +719,7 @@ Container@OBSERVER_WIDGETS:
ScrollItem@ECONOMY_PLAYER_TEMPLATE:
X: 0
Y: 0
Width: 745
Width: 845
Height: 24
BaseName: scrollitem-nohover
Children:
Expand Down Expand Up @@ -788,6 +796,13 @@ Container@OBSERVER_WIDGETS:
Height: PARENT_BOTTOM
Align: Right
Shadow: True
Label@DERRICKS:
X: 760
Y: 0
Width: 80
Height: PARENT_BOTTOM
Align: Right
Shadow: True
ScrollItem@PRODUCTION_PLAYER_TEMPLATE:
X: 0
Y: 0
Expand Down
1 change: 1 addition & 0 deletions mods/ra/rules/civilian.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,7 @@ OILB:
AppearsOnMapPreview:
GivesCashOnCapture:
Amount: 100
UpdatesDerrickCount:

BR1:
Inherits: ^Bridge
Expand Down

0 comments on commit c33d994

Please sign in to comment.