Make chat input layout hook deterministic
This commit is contained in:
@@ -16,12 +16,11 @@ local dodge_frames = {
|
||||
}
|
||||
|
||||
module.enable = function(self)
|
||||
ChatFrameEditBox:ClearAllPoints()
|
||||
ChatFrameEditBox:SetWidth(300)
|
||||
|
||||
local function UpdateInputPosition()
|
||||
local top = 0
|
||||
for _, frame in pairs(dodge_frames) do
|
||||
for _, frame in ipairs(dodge_frames) do
|
||||
if frame and frame:IsVisible() and frame:GetTop() then
|
||||
top = math.max(top, frame:GetTop())
|
||||
end
|
||||
@@ -31,6 +30,16 @@ module.enable = function(self)
|
||||
ChatFrameEditBox:SetPoint("BOTTOM", UIParent, "BOTTOM", 0, top)
|
||||
end
|
||||
|
||||
hooksecurefunc("UIParent_ManageFramePositions", UpdateInputPosition)
|
||||
UpdateInputPosition()
|
||||
-- Other ShaguTweaks modules also post-hook UIParent_ManageFramePositions.
|
||||
-- Module enable order is intentionally unordered, so install this layout
|
||||
-- hook at PLAYER_ENTERING_WORLD after the normal module pass. This makes
|
||||
-- the edit box position use the final actionbar/pet/stance positions.
|
||||
local installer = CreateFrame("Frame", nil, UIParent)
|
||||
installer:RegisterEvent("PLAYER_ENTERING_WORLD")
|
||||
installer:SetScript("OnEvent", function()
|
||||
hooksecurefunc("UIParent_ManageFramePositions", UpdateInputPosition)
|
||||
UpdateInputPosition()
|
||||
this:UnregisterAllEvents()
|
||||
this:Hide()
|
||||
end)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user