From fa819462bdd665e3b26f2a644b68bd8989b1f5c3 Mon Sep 17 00:00:00 2001 From: Dusk-92 Date: Sun, 30 Aug 2026 10:34:37 +0200 Subject: [PATCH] Make chat input layout hook deterministic --- mods/chat-input-center.lua | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/mods/chat-input-center.lua b/mods/chat-input-center.lua index 70028f2..e523f42 100644 --- a/mods/chat-input-center.lua +++ b/mods/chat-input-center.lua @@ -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