Skip to content

Commit

Permalink
chat: use parent to determine docked state
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
shagu committed Oct 3, 2023
1 parent 866ebdc commit 43954c4
Showing 1 changed file with 18 additions and 11 deletions.
29 changes: 18 additions & 11 deletions modules/chat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 43954c4

Please sign in to comment.