mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-30 19:19:59 +00:00
chat: simplify hide mechanism
This commit is contained in:
+28
-2
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user