View Single Post
07-11-12, 03:48 AM   #1
Miiru
A Flamescale Wyrmkin
 
Miiru's Avatar
AddOn Author - Click to view addons
Join Date: Dec 2008
Posts: 138
Weird parenting Problem

Code:
local function Border(arg1,arg2,arg3,arg4,arg5,arg6)
local f = CreateFrame("Frame", "nil", arg1)
f:SetSize(arg2, arg3)
f:SetPoint(arg4,arg5,arg6 )
f:SetBackdrop({
bgFile = "",
edgeFile = "Interface\\Tooltips\\UI-Tooltip-Border_blue.blp",
edgeSize = 14,
})
f:SetBackdropColor(0, 0, 0, 0)
f:SetBackdropBorderColor(1, 1, 1)	
end


local frame = CreateFrame("FRAME");
frame:RegisterEvent("ADDON_LOADED")
function frame:OnEvent(event, arg1)

if event == "ADDON_LOADED" and arg1 == "Blizzard_TalentUI" then
child1,child2 = PlayerTalentFrameSpecializationSpellScrollFrameScrollChildAbility1:GetRegions();
child1:Hide()
child2:SetTexCoord(0.85, 0.15, 0.15, 0.85)
Border(PlayerTalentFrameSpecializationSpellScrollFrameScrollChildAbility1,58,58,"Center",0,0)
		
end
end


frame:SetScript("OnEvent", frame.OnEvent);
works just fine, however if i try to do the same with PlayerTalentFrameSpecializationSpellScrollFrameScrollChildAbility2, 3 or 4 it throws me a attempt to index global error.

I took a look at the Blizzard-TalentUi.lua but couldnt find anything that makes those different from the first one :S

After opening the window, i can hide that specific frame just fine with /run :Hide() so i guess it's registered after the first one?
__________________
◘◘ Author of MiirGui Texture Pack - [Core] [Blue] [Grey] ◘◘

Last edited by Miiru : 09-23-14 at 02:43 AM.