
Untitled
By: a guest on
Jul 11th, 2012 | syntax:
Lua | size: 0.48 KB | hits: 24 | expires: Never
ns.spellbars = setmetatable({}, {
local spellbars = {}
__newindex=function(t,i)
local spellbar = CreateFrame("Frame")
spellbar.spellID = i
function spellbar:Test(test)
print("Spellbar Test: ", self.spellID)
end
print("Spellbar Created: ", i)
table.insert(spellbars, spellbar) -- inserts it into the spellbars table
return spellbar
end,
__index=function(t,i)
for v in ipairs(spellbars) do
if v.spellID = i then return v end
end
end
});