Skip to content

Commit

Permalink
Fix unit tooltip docking for non-startup layouts by loading the corre…
Browse files Browse the repository at this point in the history
…ct unitview layout on layout change.
  • Loading branch information
PaletzTheWise committed May 25, 2024
1 parent 0298a8e commit 8ea8456
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lua/ui/game/unitview.lua
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ local Prefs = import("/lua/user/prefs.lua")
local EnhancementCommon = import("/lua/enhancementcommon.lua")
local options = Prefs.GetFromCurrentProfile('options')
local GetUnitRolloverInfo = import("/lua/keymap/selectedinfo.lua").GetUnitRolloverInfo
local unitViewLayout = import(UIUtil.GetLayoutFilename('unitview'))
local unitViewLayout = nil -- Holds the current layout, updated by SetLayout().
local unitviewDetail = import("/lua/ui/game/unitviewdetail.lua")
local Grid = import("/lua/maui/grid.lua").Grid
local Construction = import("/lua/ui/game/construction.lua")
Expand Down Expand Up @@ -739,12 +739,14 @@ function ShowROBox()
end

function SetLayout(layout)
unitViewLayout = import(UIUtil.GetLayoutFilename('unitview'))
unitViewLayout.SetLayout()
end

function SetupUnitViewLayout(mapGroup, orderControl)
controls.parent = mapGroup
controls.orderPanel = orderControl
unitViewLayout = import(UIUtil.GetLayoutFilename('unitview')) -- SetLayout() will set this too but let's make sure CreateUI() does not use nil, even though it only sets up an OnFrame function.
CreateUI()
SetLayout(UIUtil.currentLayout)
end
Expand Down

0 comments on commit 8ea8456

Please sign in to comment.