diff --git a/modules/chat.lua b/modules/chat.lua index 5e976bb4..0c9fb676 100644 --- a/modules/chat.lua +++ b/modules/chat.lua @@ -304,6 +304,23 @@ pfUI:RegisterModule("chat", function () local frame = _G["ChatFrame"..i] local tab = _G["ChatFrame"..i.."Tab"] + if not frame.pfStartMoving then + frame.pfStartMoving = frame.StartMoving + frame.StartMoving = function(a1) + pfUI.chat.hideLock = true + frame.pfStartMoving(a1) + end + end + + if not frame.pfStopMovingOrSizing then + frame.pfStopMovingOrSizing = frame.StopMovingOrSizing + frame.StopMovingOrSizing = function(a1) + frame.pfStopMovingOrSizing(a1) + pfUI.chat.RefreshChat() + pfUI.chat.hideLock = false + end + end + if C.chat.global.fadeout == "1" then frame:SetFading(true) frame:SetTimeVisible(tonumber(C.chat.global.fadetime)) @@ -385,12 +402,20 @@ pfUI:RegisterModule("chat", function () end end + hooksecurefunc("FCF_SaveDock", pfUI.chat.RefreshChat) + if C.chat.global.tabmouse == "1" then pfUI.chat.mouseovertab = CreateFrame("Frame") pfUI.chat.mouseovertab:SetScript("OnUpdate", function() - if MouseIsOver(pfUI.chat.left) or MouseIsOver(pfUI.chat.right) then + + if pfUI.chat.hideLock then return end + + if MouseIsOver(pfUI.chat.left, 10, -10, -10, 10) then pfUI.chat.left.panelTop:Show() + FCF_DockUpdate() + elseif MouseIsOver(pfUI.chat.right, 10, -10, -10, 10) then pfUI.chat.right.panelTop:Show() + FCF_DockUpdate() else pfUI.chat.left.panelTop:Hide() pfUI.chat.right.panelTop:Hide() @@ -451,8 +476,8 @@ pfUI:RegisterModule("chat", function () ChatFrame3:SetUserPlaced(1) end - FCF_DockUpdate() pfUI.chat:RefreshChat() + FCF_DockUpdate() end function pfUI.chat.SetupChannels() @@ -491,6 +516,7 @@ pfUI:RegisterModule("chat", function () pfUI.chat:SetScript("OnEvent", function() if event == "PLAYER_ENTERING_WORLD" or event == "UI_SCALE_CHANGED" then pfUI.chat:RefreshChat() + FCF_DockUpdate() if C.chat.right.enable == "0" and C.chat.right.alwaysshow == "0" then pfUI.chat.right:Hide() end