mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-18 18:40:49 +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"
|
return f:GetRegions():GetTexture() == "Interface\\Tooltips\\ChatBubble-Background"
|
||||||
end
|
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()
|
function pfUI.bubbles:ScanBubbles()
|
||||||
local childs = { WorldFrame:GetChildren() }
|
local childs = { WorldFrame:GetChildren() }
|
||||||
for _, f in pairs(childs) do
|
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("TOPLEFT", f, "TOPLEFT", -10, -10)
|
||||||
f.frame.backdrop:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", 10, 10)
|
f.frame.backdrop:SetPoint("BOTTOMRIGHT", f, "BOTTOMRIGHT", 10, 10)
|
||||||
|
|
||||||
f.text:Hide()
|
pfUI.bubbles:ProcessBubble(f)
|
||||||
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)
|
|
||||||
|
|
||||||
f:SetScript("OnShow", function()
|
f:SetScript("OnShow", function()
|
||||||
this.text:Hide()
|
pfUI.bubbles:ProcessBubble(this)
|
||||||
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)
|
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user