mirror of
https://github.com/brues-code/pfUI.git
synced 2026-10-25 21:40:49 +00:00
nameplates: satisfy outdated versions of omnicc
Old versions of OmniCC doesn't check the existance of frame names of unknown
foreign objects before accessing them:
cooldown.textFrame.icon =
--standard action button icon, $parentIcon
getglobal(cooldown:GetParent():GetName() .. "Icon") or
--standard item button icon, $parentIconTexture
getglobal(cooldown:GetParent():GetName() .. "IconTexture") or
--discord action button, $parent_Icon
getglobal(cooldown:GetParent():GetName() .. "_Icon");
Code like this leads to errors such as: 'attempt to concatenate a nil value'.
By this commit every single debuff icon of the pfUI nameplates will now have
a frame name. That doesn't fix the OmniCC root cause, but makes at least the
pfUI/ShaguPlates no longer responsible for showing it up...
This commit is contained in:
+11
-8
@@ -20,7 +20,8 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
|
|||||||
-- catch all nameplates
|
-- catch all nameplates
|
||||||
local childs, regions, plate
|
local childs, regions, plate
|
||||||
local initialized = 0
|
local initialized = 0
|
||||||
local parentCount = 0
|
local parentcount = 0
|
||||||
|
local platecount = 0
|
||||||
local registry = {}
|
local registry = {}
|
||||||
|
|
||||||
-- cache default border color
|
-- cache default border color
|
||||||
@@ -174,10 +175,10 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
|
|||||||
end)
|
end)
|
||||||
|
|
||||||
nameplates:SetScript("OnUpdate", function()
|
nameplates:SetScript("OnUpdate", function()
|
||||||
parentCount = WorldFrame:GetNumChildren()
|
parentcount = WorldFrame:GetNumChildren()
|
||||||
if initialized < parentCount then
|
if initialized < parentcount then
|
||||||
childs = { WorldFrame:GetChildren() }
|
childs = { WorldFrame:GetChildren() }
|
||||||
for i = initialized + 1, parentCount do
|
for i = initialized + 1, parentcount do
|
||||||
plate = childs[i]
|
plate = childs[i]
|
||||||
if IsNamePlate(plate) and not registry[plate] then
|
if IsNamePlate(plate) and not registry[plate] then
|
||||||
nameplates.OnCreate(plate)
|
nameplates.OnCreate(plate)
|
||||||
@@ -185,7 +186,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
initialized = parentCount
|
initialized = parentcount
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
||||||
@@ -205,9 +206,11 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
|
|||||||
|
|
||||||
nameplates.OnCreate = function(frame)
|
nameplates.OnCreate = function(frame)
|
||||||
local parent = frame or this
|
local parent = frame or this
|
||||||
|
platecount = platecount + 1
|
||||||
|
platename = "pfNamePlate" .. platecount
|
||||||
|
|
||||||
-- create pfUI nameplate overlay
|
-- create pfUI nameplate overlay
|
||||||
local nameplate = CreateFrame("Button", nil, parent)
|
local nameplate = CreateFrame("Button", platename, parent)
|
||||||
nameplate:EnableMouse(0)
|
nameplate:EnableMouse(0)
|
||||||
nameplate.parent = parent
|
nameplate.parent = parent
|
||||||
nameplate.cache = {}
|
nameplate.cache = {}
|
||||||
@@ -269,7 +272,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
|
|||||||
do -- debuffs
|
do -- debuffs
|
||||||
local debuffs = {}
|
local debuffs = {}
|
||||||
for i=1, 16, 1 do
|
for i=1, 16, 1 do
|
||||||
debuffs[i] = CreateFrame("Frame", nil, nameplate)
|
debuffs[i] = CreateFrame("Frame", platename.."Debuff"..i, nameplate)
|
||||||
debuffs[i]:Hide()
|
debuffs[i]:Hide()
|
||||||
debuffs[i]:SetFrameLevel(1)
|
debuffs[i]:SetFrameLevel(1)
|
||||||
|
|
||||||
@@ -283,7 +286,7 @@ pfUI:RegisterModule("nameplates", "vanilla:tbc", function ()
|
|||||||
debuffs[i].stacks:SetJustifyV("BOTTOM")
|
debuffs[i].stacks:SetJustifyV("BOTTOM")
|
||||||
debuffs[i].stacks:SetTextColor(1,1,0)
|
debuffs[i].stacks:SetTextColor(1,1,0)
|
||||||
|
|
||||||
debuffs[i].cd = CreateFrame(COOLDOWN_FRAME_TYPE, nil, debuffs[i], "CooldownFrameTemplate")
|
debuffs[i].cd = CreateFrame(COOLDOWN_FRAME_TYPE, platename.."Debuff"..i.."Cooldown", debuffs[i], "CooldownFrameTemplate")
|
||||||
debuffs[i].cd.pfCooldownStyleAnimation = 0
|
debuffs[i].cd.pfCooldownStyleAnimation = 0
|
||||||
debuffs[i].cd.pfCooldownType = "ALL"
|
debuffs[i].cd.pfCooldownType = "ALL"
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user