api: add new skin system and functions

this is a squash of several commits from `skinframes` branch.
author: @xIGBClutchIx, @shagu
This commit is contained in:
shagu
2017-11-19 12:48:38 +01:00
parent ff060781b6
commit 9cb1cd5fdc
5 changed files with 364 additions and 182 deletions
+21
View File
@@ -37,6 +37,8 @@ pfUI_translation = {}
pfUI.cache = {}
pfUI.module = {}
pfUI.modules = {}
pfUI.skin = {}
pfUI.skins = {}
pfUI.environment = {}
pfUI.movables = {}
pfUI.version = {}
@@ -91,6 +93,14 @@ pfUI:SetScript("OnEvent", function()
pfUI.module[m]()
end
end
-- load skins
for i,s in pairs(this.skins) do
if not ( pfUI_config["disabled"] and pfUI_config["disabled"]["skin_" .. s] == "1" ) then
setfenv(pfUI.skin[s], pfUI:GetEnvironment())
pfUI.skin[s]()
end
end
end
end)
@@ -99,12 +109,23 @@ function pfUI:RegisterModule(n, f)
table.insert(pfUI.modules, n)
end
function pfUI:RegisterSkin(n, f)
pfUI.skin[n] = f
table.insert(pfUI.skins, n)
end
pfUI.backdrop = {
bgFile = "Interface\\AddOns\\pfUI\\img\\col", tile = true, tileSize = 8,
edgeFile = "Interface\\AddOns\\pfUI\\img\\border", edgeSize = 8,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
pfUI.backdrop_no_top = {
bgFile = "Interface\\AddOns\\pfUI\\img\\col", tile = true, tileSize = 8,
edgeFile = "Interface\\AddOns\\pfUI\\img\\border_no_top", edgeSize = 8,
insets = {left = -1, right = -1, top = -1, bottom = -1},
}
pfUI.backdrop_underline = {
edgeFile = "Interface\\AddOns\\pfUI\\img\\underline", edgeSize = 8,
insets = {left = 0, right = 0, top = 0, bottom = 0},