Skip to content

Commit

Permalink
Fix display of engineers' reclaim statistics in non-default unitview …
Browse files Browse the repository at this point in the history
…layouts (FAForever#6162)
  • Loading branch information
PaletzTheWise authored May 15, 2024
1 parent 8e726f4 commit 28cae22
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 10 deletions.
1 change: 1 addition & 0 deletions changelog/snippets/fix.6162.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- (#6162) Fix the display of engineers' reclaim statistics in the left and right UI layouts (default is the bottom layout).
30 changes: 21 additions & 9 deletions lua/ui/game/layouts/unitview_left.lua
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ local iconTextures = {
UIUtil.UIFile('/game/unit_view_icons/shield.dds'),
UIUtil.UIFile('/game/unit_view_icons/fuel.dds'),
UIUtil.UIFile('/game/unit_view_icons/build.dds'),
UIUtil.UIFile('/game/unit_view_icons/reclaim_alt_mass.dds'),
UIUtil.UIFile('/game/unit_view_icons/reclaim_alt_energy.dds'),
}

function SetLayout()
Expand Down Expand Up @@ -82,17 +84,27 @@ function SetLayout()
LayoutHelpers.SetDimensions(controls.vetBar, 56, 3)
controls.vetBar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/healthbar_bg.dds'))
controls.vetBar._bar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/fuelbar.dds'))

LayoutHelpers.AtLeftTopIn(controls.ReclaimGroup, controls.bg, 188, 58)
LayoutHelpers.SetDimensions(controls.ReclaimGroup, 100, 48)
-- LayoutHelpers.AtLeftTopIn(controls.ReclaimGroup.Title, controls.ReclaimGroup, -10, 0)
controls.ReclaimGroup.MassIcon:SetTexture(iconTextures[9])
controls.ReclaimGroup.EnergyIcon:SetTexture(iconTextures[10])
LayoutHelpers.AtLeftTopIn(controls.ReclaimGroup.MassIcon, controls.ReclaimGroup, 1, 2)
LayoutHelpers.RightOf(controls.ReclaimGroup.EnergyIcon, controls.ReclaimGroup.MassIcon, 5)

LayoutHelpers.AtLeftTopIn(controls.vetBar, controls.bg, 192, 68)
LayoutHelpers.SetDimensions(controls.vetBar, 56, 3)
controls.vetBar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/healthbar_bg.dds'))
controls.vetBar._bar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/fuelbar.dds'))
LayoutHelpers.Below(controls.ReclaimGroup.MassText, controls.ReclaimGroup.MassIcon, 2)
LayoutHelpers.AtHorizontalCenterIn(controls.ReclaimGroup.MassText, controls.ReclaimGroup.MassIcon, -2)


LayoutHelpers.Below(controls.ReclaimGroup.EnergyText, controls.ReclaimGroup.EnergyIcon, 2)
LayoutHelpers.AtHorizontalCenterIn(controls.ReclaimGroup.EnergyText, controls.ReclaimGroup.EnergyIcon, -2)

LayoutHelpers.FillParent(controls.ReclaimGroup.Debug, controls.ReclaimGroup)

controls.ReclaimGroup.Debug:SetSolidColor('00ffffff')
controls.ReclaimGroup.Debug.Depth:Set(-1000000)

LayoutHelpers.AtLeftTopIn(controls.ReclaimGroup, controls.bg, 192, 68)
LayoutHelpers.SetDimensions(controls.ReclaimGroup, 200, 200)
LayoutHelpers.FillParent(controls.ReclaimGroup.MassIcon, controls.ReclaimGroup)
controls.ReclaimGroup.MassIcon:SetSolidColor('ffffffff')

LayoutHelpers.Below(controls.nextVet, controls.vetBar)
controls.nextVet:SetDropShadow(true)
LayoutHelpers.Above(controls.vetTitle, controls.vetBar)
Expand Down
2 changes: 1 addition & 1 deletion lua/ui/game/layouts/unitview_mini.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ local iconTextures = {
UIUtil.UIFile('/game/unit_view_icons/reclaim_alt_mass.dds'),
UIUtil.UIFile('/game/unit_view_icons/reclaim_alt_energy.dds'),
}

function SetLayout()
local controls = import("/lua/ui/game/unitview.lua").controls

Expand Down Expand Up @@ -146,7 +147,6 @@ function SetLayout()
LayoutHelpers.RightOf(controls.ReclaimGroup.EnergyIcon, controls.ReclaimGroup.MassIcon, 5)

LayoutHelpers.Below(controls.ReclaimGroup.MassText, controls.ReclaimGroup.MassIcon, 2)

LayoutHelpers.AtHorizontalCenterIn(controls.ReclaimGroup.MassText, controls.ReclaimGroup.MassIcon, -2)


Expand Down
22 changes: 22 additions & 0 deletions lua/ui/game/layouts/unitview_right.lua
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ local iconTextures = {
UIUtil.UIFile('/game/unit_view_icons/shield.dds'),
UIUtil.UIFile('/game/unit_view_icons/fuel.dds'),
UIUtil.UIFile('/game/unit_view_icons/build.dds'),
UIUtil.UIFile('/game/unit_view_icons/reclaim_alt_mass.dds'),
UIUtil.UIFile('/game/unit_view_icons/reclaim_alt_energy.dds'),
}

function SetLayout()
Expand Down Expand Up @@ -76,6 +78,26 @@ function SetLayout()
controls.vetBar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/healthbar_bg.dds'))
controls.vetBar._bar:SetTexture(UIUtil.UIFile('/game/unit-build-over-panel/fuelbar.dds'))

LayoutHelpers.AtLeftTopIn(controls.ReclaimGroup, controls.bg, 188, 58)
LayoutHelpers.SetDimensions(controls.ReclaimGroup, 100, 48)
-- LayoutHelpers.AtLeftTopIn(controls.ReclaimGroup.Title, controls.ReclaimGroup, -10, 0)
controls.ReclaimGroup.MassIcon:SetTexture(iconTextures[9])
controls.ReclaimGroup.EnergyIcon:SetTexture(iconTextures[10])
LayoutHelpers.AtLeftTopIn(controls.ReclaimGroup.MassIcon, controls.ReclaimGroup, 1, 2)
LayoutHelpers.RightOf(controls.ReclaimGroup.EnergyIcon, controls.ReclaimGroup.MassIcon, 5)

LayoutHelpers.Below(controls.ReclaimGroup.MassText, controls.ReclaimGroup.MassIcon, 2)
LayoutHelpers.AtHorizontalCenterIn(controls.ReclaimGroup.MassText, controls.ReclaimGroup.MassIcon, -2)


LayoutHelpers.Below(controls.ReclaimGroup.EnergyText, controls.ReclaimGroup.EnergyIcon, 2)
LayoutHelpers.AtHorizontalCenterIn(controls.ReclaimGroup.EnergyText, controls.ReclaimGroup.EnergyIcon, -2)

LayoutHelpers.FillParent(controls.ReclaimGroup.Debug, controls.ReclaimGroup)

controls.ReclaimGroup.Debug:SetSolidColor('00ffffff')
controls.ReclaimGroup.Debug.Depth:Set(-1000000)

LayoutHelpers.Below(controls.nextVet, controls.vetBar)
controls.nextVet:SetDropShadow(true)
LayoutHelpers.Above(controls.vetTitle, controls.vetBar)
Expand Down

0 comments on commit 28cae22

Please sign in to comment.