chat: use parent to determine docked state

Remove every texture of the chat frame and only restore background
for chat frames that are not docked to the left or the right side.
This commit is contained in:
shagu
2023-10-03 15:11:14 +02:00
parent 866ebdc234
commit 43954c487b
+18 -11
View File
@@ -334,17 +334,6 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
frame.pfCombatLog = nil
end
for _, tex in pairs(CHAT_FRAME_TEXTURES) do
local texture = _G["ChatFrame"..i..tex]
texture.oldTexture = texture.oldTexture or texture:GetTexture()
if i == 3 or frame.isDocked then
texture:SetTexture()
texture:Hide()
else
texture:SetTexture(texture.oldTexture)
end
end
if not frame.pfStartMoving then
frame.pfStartMoving = frame.StartMoving
@@ -408,6 +397,24 @@ pfUI:RegisterModule("chat", "vanilla:tbc", function ()
v:SetHeight(C.global.font_size+default_border*2)
end
-- remove background on docked frames
for _, tex in pairs(CHAT_FRAME_TEXTURES) do
local texture = _G["ChatFrame"..i..tex]
if tex == "Background" then
texture.oldTexture = texture.oldTexture or texture:GetTexture()
if frame:GetParent() == pfUI.chat.left or frame:GetParent() == pfUI.chat.right then
texture:SetTexture()
texture:Hide()
else
texture:SetTexture(texture.oldTexture)
texture:Show()
end
else
texture:SetTexture()
texture:Hide()
end
end
_G["ChatFrame" .. i .. "ResizeBottom"]:Hide()
_G["ChatFrame" .. i .. "TabText"]:SetJustifyV("CENTER")
_G["ChatFrame" .. i .. "TabText"]:SetHeight(C.global.font_size+default_border*2)