unitframes: add custom frame configurations

This commit is contained in:
shagu
2017-06-02 18:01:50 +02:00
parent dc2da15551
commit 3c95c2339e
3 changed files with 40 additions and 19 deletions
+19
View File
@@ -271,6 +271,25 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("unitframes", "pet", "txtcenter", "name")
pfUI:UpdateConfig("unitframes", "pet", "txtright", "none")
pfUI:UpdateConfig("unitframes", "fallback", "visible", "1")
pfUI:UpdateConfig("unitframes", "fallback", "portrait", "bar")
pfUI:UpdateConfig("unitframes", "fallback", "width", "200")
pfUI:UpdateConfig("unitframes", "fallback", "height", "50")
pfUI:UpdateConfig("unitframes", "fallback", "pheight", "10")
pfUI:UpdateConfig("unitframes", "fallback", "pspace", "-3")
pfUI:UpdateConfig("unitframes", "fallback", "buffs", "top")
pfUI:UpdateConfig("unitframes", "fallback", "buffsize", "20")
pfUI:UpdateConfig("unitframes", "fallback", "debuffs", "top")
pfUI:UpdateConfig("unitframes", "fallback", "debuffsize", "20")
pfUI:UpdateConfig("unitframes", "fallback", "invert_healthbar", "0")
pfUI:UpdateConfig("unitframes", "fallback", "buff_indicator", "0")
pfUI:UpdateConfig("unitframes", "fallback", "debuff_indicator", "0")
pfUI:UpdateConfig("unitframes", "fallback", "clickcast", "0")
pfUI:UpdateConfig("unitframes", "fallback", "faderange", "0")
pfUI:UpdateConfig("unitframes", "fallback", "txtleft", "unit")
pfUI:UpdateConfig("unitframes", "fallback", "txtcenter", "none")
pfUI:UpdateConfig("unitframes", "fallback", "txtright", "healthdyn")
pfUI:UpdateConfig("bars", nil, "icon_size", "20")
pfUI:UpdateConfig("bars", nil, "background", "1")
pfUI:UpdateConfig("bars", nil, "glowrange", "1")
+1 -19
View File
@@ -1,23 +1,5 @@
pfUI.uf = CreateFrame("Frame",nil,UIParent)
local uf_defaults = {
visible = "1",
portrait = "bar",
width = "200",
height = "50",
pheight = "10",
pspace = "-3",
buffs = "top",
buffsize = "20",
debuffs = "top",
debuffsize = "20",
invert_healthbar = "0",
buff_indicator = "0",
debuff_indicator = "0",
clickcast = "0",
faderange = "0",
}
local pfValidUnits = {}
pfValidUnits["player"] = true
pfValidUnits["target"] = true
@@ -68,7 +50,7 @@ function pfUI.uf:CreateUnitFrame(unit, id, config, tick)
f.label = unit
f.id = id
f.config = config or uf_defaults
f.config = config or pfUI_config.unitframes.fallback
f.tick = tick
if f.config.visible ~= "1" then
+20
View File
@@ -1066,6 +1066,26 @@ pfUI:RegisterModule("gui", function ()
pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.pet, "txtcenter", "dropdown", txtValues)
pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.pet, "txtright", "dropdown", txtValues)
pfUI.gui:CreateConfig(pfUI.gui.uf, "Custom Units", nil, nil, "header")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Display Custom Frames", C.unitframes.fallback, "visible", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Portrait Position", C.unitframes.fallback, "portrait", "dropdown", { "bar", "left", "right", "off" })
pfUI.gui:CreateConfig(pfUI.gui.uf, "Health Bar Width", C.unitframes.fallback, "width")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Health Bar Height", C.unitframes.fallback, "height")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Power Bar Height", C.unitframes.fallback, "pheight")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Spacing", C.unitframes.fallback, "pspace")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Buff Position", C.unitframes.fallback, "buffs", "dropdown", { "top", "bottom", "hide"})
pfUI.gui:CreateConfig(pfUI.gui.uf, "Buff Size", C.unitframes.fallback, "buffsize")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Debuff Position", C.unitframes.fallback, "debuffs", "dropdown", { "top", "bottom", "hide"})
pfUI.gui:CreateConfig(pfUI.gui.uf, "Debuff Size", C.unitframes.fallback, "debuffsize")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Invert Health Bar", C.unitframes.fallback, "invert_healthbar", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Buff Indicators", C.unitframes.fallback, "buff_indicator", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Debuff Indicators", C.unitframes.fallback, "debuff_indicator", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Clickcast", C.unitframes.fallback, "clickcast", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Enable Range Fading", C.unitframes.fallback, "faderange", "checkbox")
pfUI.gui:CreateConfig(pfUI.gui.uf, "Left Text", C.unitframes.fallback, "txtleft", "dropdown", txtValues)
pfUI.gui:CreateConfig(pfUI.gui.uf, "Center Text", C.unitframes.fallback, "txtcenter", "dropdown", txtValues)
pfUI.gui:CreateConfig(pfUI.gui.uf, "Right Text", C.unitframes.fallback, "txtright", "dropdown", txtValues)
-- action bar
pfUI.gui.bar = pfUI.gui:CreateConfigTab("Action Bar")
pfUI.gui:CreateConfig(pfUI.gui.bar, "Icon Size", C.bars, "icon_size")