PageRenderTime 41ms CodeModel.GetById 20ms app.highlight 1ms RepoModel.GetById 19ms app.codeStats 0ms

/TelUI_AddonSkins/AddonSkins.lua

http://github.com/Asphyxia/Tukui
Lua | 30 lines | 22 code | 4 blank | 4 comment | 4 complexity | ded8e7a5f4a88062d8a4ef0e01d532c5 MD5 | raw file
 1--[[
 2	Mod_AddonSkins - Addon skinning and integration for TelUI
 3]]
 4if not TelUI then return end
 5local TelUI = TelUI
 6local Mod_AddonSkins = TelUI:CreateClass("Mod_AddonSkins")
 7
 8function Mod_AddonSkins.__construct()
 9	local self = super()
10	for name,func in pairs(Mod_AddonSkins:GetSkins()) do
11		if TelUI.addonskins[name] ~= false then
12			TelUI.safecall(func,Skin, TelUI.loadedSkin, Layout, TelUI.loadedLayout, TelUI.skin)
13		end
14	end
15	return self
16end
17
18function Mod_AddonSkins:RegisterSkin(name, initFunc)
19	self = Mod_AddonSkins -- Static function
20	if type(initFunc) ~= "function" then error("initFunc must be a function!",2) end
21	self.skins[name] = initFunc
22	--
23end
24
25function Mod_AddonSkins:GetSkins()
26	self = Mod_AddonSkins -- Static function
27	return self.skins
28end
29
30Mod_AddonSkins.skins = {}