mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 02:16:02 +00:00
bubbles: move processing into function
This commit is contained in:
+11
-11
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user