mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-27 01:46:03 +00:00
gui: option to hide incompatible config entries
This commit is contained in:
@@ -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
@@ -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")
|
||||
|
||||
Reference in New Issue
Block a user