Originally Posted by Fizzlemizz
Being a custom panel builder KG won't actually create panels until some deferred time (probably at PLAYER_ENTRING_WOLRD or possibly PLAYER_LOGIN)
ADDON_LOADED will fire for your addon and every addon that loads after that and well before PLAYER_ENTRING_WOLRD so KG is unlikely to have created any panels by then. VARIABLES_LOADED falls into the same early call problem and will add to the error count.
Your KG panels are most likely being skinned because your frame receives its PLAYER_ENTRING_WOLRD event after KG has done initial setup so it actually works that time.
|
Thank you for the excellent explanation Fizzlemizz!
I removed the lines below and I am left with beautifully bordered frames, as well as no errors. Thanks!
What I removed:
Lua Code:
f:RegisterEvent("VARIABLES_LOADED")
f:RegisterEvent("ADDON_LOADED")
My code as of now for future reference to anyone searching for the same thing:
Lua Code:
local f = CreateFrame("Frame")
f:RegisterEvent("PLAYER_ENTERING_WORLD")
f:SetScript("OnEvent", function(self)
-- Pitbull4 borders --
if IsAddOnLoaded("Pitbull4") then
f:SetScript("OnUpdate", function(self)
for _, pitframes in pairs({
PitBull4_Frames_Player,
PitBull4_Frames_Target,
}) do
if pitframes:IsShown() then
pitframes:CreateBeautyBorder(14)
pitframes:SetBeautyBorderPadding(3)
end
end
end)
end
-- kgPanels borders --
if IsAddOnLoaded("kgPanels") then
kgPanel1:CreateBeautyBorder(14)
kgPanel1:SetBeautyBorderPadding(0)
kgPanel2:CreateBeautyBorder(14)
kgPanel2:SetBeautyBorderPadding(0)
kgPanel3:CreateBeautyBorder(14)
kgPanel3:SetBeautyBorderPadding(0)
kgPanel4:CreateBeautyBorder(14)
kgPanel4:SetBeautyBorderPadding(0)
end
end)