bubbles: move processing into function

This commit is contained in:
shagu
2018-01-07 14:01:24 +01:00
parent 4c697028ff
commit 97a11f994c
+11 -11
View File
@@ -24,6 +24,15 @@ pfUI:RegisterModule("bubbles", function ()
return f:GetRegions():GetTexture() == "Interface\\Tooltips\\ChatBubble-Background"
end
function pfUI.bubbles:ProcessBubble(f)
f.text:Hide()
f.text:SetFont(pfUI.font_default, tonumber(C.global.font_size) * UIParent:GetScale(), "OUTLINE")
local r,g,b,a = f.text:GetTextColor()
f.frame.text:SetText(f.text:GetText())
f.frame.text:SetTextColor(r,g,b,a)
f.frame.backdrop:SetBackdropBorderColor(r,g,b,a)
end
function pfUI.bubbles:ScanBubbles()
local childs = { WorldFrame:GetChildren() }
for _, f in pairs(childs) do
@@ -51,19 +60,10 @@ pfUI:RegisterModule("bubbles", function ()
f.frame.backdrop:SetPoint("TOPLEFT", f, "TOPLEFT", -10, -10)
f.frame.backdrop:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", 10, 10)
f.text:Hide()
f.text:SetFont(pfUI.font_default, tonumber(C.global.font_size) * UIParent:GetScale(), "OUTLINE")
local r,g,b,a = f.text:GetTextColor()
f.frame.text:SetText(f.text:GetText())
f.frame.text:SetTextColor(r,g,b,a)
f.frame.backdrop:SetBackdropBorderColor(r,g,b,a)
pfUI.bubbles:ProcessBubble(f)
f:SetScript("OnShow", function()
this.text:Hide()
local r,g,b,a = this.text:GetTextColor()
this.frame.text:SetText(this.text:GetText())
this.frame.text:SetTextColor(r,g,b,a)
this.frame.backdrop:SetBackdropBorderColor(r,g,b,a)
pfUI.bubbles:ProcessBubble(this)
end)
end
end