introducing the "module-loader"

This commit is contained in:
Eric Mauser
2016-05-16 01:17:55 +02:00
parent 65f2b15627
commit d4a8ef0a90
18 changed files with 2771 additions and 2715 deletions
+26 -1
View File
@@ -13,6 +13,31 @@ function SlashCmdList.PFUI(msg, editbox)
end
pfUI = CreateFrame("Frame",nil,UIParent)
pfUI:RegisterEvent("ADDON_LOADED")
pfUI:SetScript("OnEvent", function()
if arg1 == "pfUI" then
pfUI:Debug("pfUI module loader:")
for i,m in pairs(this.modules) do
pfUI:Debug("=> " .. m)
pfUI.module[m]()
end
end
end)
pfUI.module = {}
pfUI.modules = {}
function pfUI:RegisterModule(n, f)
pfUI.module[n] = f
table.insert(pfUI.modules, n)
end
function pfUI:Debug(msg)
if pfUI_config.debug == 1 then
DEFAULT_CHAT_FRAME:AddMessage(msg)
end
end
pfUI.backdrop = {
bgFile = "Interface\\AddOns\\pfUI\\img\\bg", tile = true, tileSize = 8,
edgeFile = "Interface\\AddOns\\pfUI\\img\\border", edgeSize = 8,
@@ -35,8 +60,8 @@ pfUI.backdrop_underline = {
}
pfUI.playerDB = {}
pfUI_config = {
debug = 1,
["unitframes"] = {
animation_speed = 1,
buff_size = "22",