/trunk
local name, addon = ... |
local embed = addon:LibInit("zzCommon-Base", 32, {'RegisterFunc','HandleFunclist','round','split','classcolor','colorize','Print','buildMoneyString','RegisterEventThrottle','RGB2Hex','Hex2RGB','sortArray','IsTwink','getItemId','itemInfo','startup'}) |
local embed = addon:LibInit("zzCommon-Base", 33, {'RegisterFunc','HandleFunclist','round','split','classcolor','colorize','Print','buildMoneyString','RegisterEventThrottle','RGB2Hex','Hex2RGB','sortArray','IsTwink','getItemId','itemInfo','startup'}) |
if(type(embed) ~= 'function') then return end |
local table = table |
local lib = {} |
function lib:RegisterFunc(event,typ,func) |
local f = CreateFrame("Frame",nil,self) |
local f = CreateFrame("Frame") |
if(type(event) == "table") then |
for i = 1, #event do |
f:RegisterEvent(event[i]) |
end |
end |
function lib:startup(name, childName, init, default, defaults) |
if(name==childName) then |
if(name==childName) then |
local addon = self |
self['frame'] = self:RegisterFunc({'PLAYER_LOGOUT','ADDON_LOADED','PLAYER_ENTERING_WORLD'},"OnEvent", function(self, event, arg1,...) |
local addon = self:GetParent() |
if(event=='ADDON_LOADED') then |
if(arg1 ~= childName) then return end |
addon['db'] = addon['db'] or LibStub("AceDB-3.0"):New(childName.."DB", nil, default) |