gui: option to hide incompatible config entries

This commit is contained in:
shagu
2020-01-01 09:42:38 +01:00
parent 25245d0c4e
commit ab2976b56e
2 changed files with 16 additions and 1 deletions
+2
View File
@@ -50,7 +50,9 @@ function pfUI:LoadConfig()
pfUI:UpdateConfig("global", nil, "servertime", "0")
pfUI:UpdateConfig("global", nil, "autosell", "0")
pfUI:UpdateConfig("global", nil, "autorepair", "0")
pfUI:UpdateConfig("gui", nil, "reloadmarker", "0")
pfUI:UpdateConfig("gui", nil, "showdisabled", "0")
pfUI:UpdateConfig("buffs", nil, "buffs", "1")
pfUI:UpdateConfig("buffs", nil, "debuffs", "1")
+14 -1
View File
@@ -51,7 +51,10 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
end
end
function CreateConfig(ufunc, caption, category, config, widget, values, skip, named, type)
function CreateConfig(ufunc, caption, category, config, widget, values, skip, named, type, expansion)
local disabled = expansion and not strfind(expansion, pfUI.expansion)
if disabled and pfUI_config.gui.showdisabled == "0" then return end
-- this object placement
if this.objectCount == nil then
this.objectCount = 0
@@ -118,6 +121,15 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
frame.caption:SetText(caption)
end
if disabled then
if frame.caption then
frame.caption:SetText(caption .. " |cffff5555[" .. T["Only"] .. " " .. string.gsub(expansion, ":", "&") .. "]")
end
frame:SetAlpha(.5)
return
end
if category == "CVAR" then
category = {}
category[config] = tostring(GetCVar(config))
@@ -1349,6 +1361,7 @@ pfUI:RegisterModule("gui", "vanilla:tbc", function ()
CreateConfig(nil, T["Enable Single Line UIErrors"], C.global, "errors_limit", "checkbox")
CreateConfig(nil, T["Disable All UIErrors"], C.global, "errors_hide", "checkbox")
CreateConfig(nil, T["Highlight Settings That Require Reload"], C.gui, "reloadmarker", "checkbox")
CreateConfig(nil, T["Show Incompatible Config Entries"], C.gui, "showdisabled", "checkbox")
-- Delete / Reset
CreateConfig(nil, T["Delete / Reset"], nil, nil, "header")