chat: simplify hide mechanism

This commit is contained in:
shagu
2017-09-20 12:53:31 +02:00
parent 90f3ec7467
commit ae6c8f0025
+28 -2
View File
@@ -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