mirror of
https://github.com/brues-code/pfUI.git
synced 2026-09-28 02:16:02 +00:00
config: every module can now be disabled
Note: This is experimental at the moment, many modules still have an dependency to each other. Expect errors when using this...
This commit is contained in:
@@ -42,6 +42,7 @@ function pfUI:LoadConfig()
|
||||
pfUI:UpdateConfig("thirdparty", "wim", "enable", "1")
|
||||
pfUI:UpdateConfig("thirdparty", "healcomm","enable", "1")
|
||||
pfUI:UpdateConfig("position", nil, nil, nil)
|
||||
pfUI:UpdateConfig("disabled", nil, nil, nil)
|
||||
end
|
||||
|
||||
function pfUI:UpdateConfig(group, subgroup, entry, value)
|
||||
|
||||
+10
-2
@@ -184,8 +184,8 @@ pfUI:RegisterModule("gui", function ()
|
||||
end
|
||||
|
||||
function pfUI.gui:SwitchTab(frame)
|
||||
local elements = { pfUI.gui.global, pfUI.gui.uf , pfUI.gui.bar, pfUI.gui.panel, pfUI.gui.tooltip,
|
||||
pfUI.gui.castbar, pfUI.gui.thirdparty, pfUI.gui.chat, pfUI.gui.nameplates }
|
||||
local elements = { pfUI.gui.global, pfUI.gui.modules, pfUI.gui.uf , pfUI.gui.bar, pfUI.gui.panel,
|
||||
pfUI.gui.tooltip, pfUI.gui.castbar, pfUI.gui.thirdparty, pfUI.gui.chat, pfUI.gui.nameplates }
|
||||
|
||||
for _, hide in pairs(elements) do
|
||||
hide:Hide()
|
||||
@@ -414,6 +414,14 @@ pfUI:RegisterModule("gui", function ()
|
||||
pfUI.gui.global = pfUI.gui:CreateConfigTab("Global Settings")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.global, "Fontsize", pfUI_config.global, "font_size")
|
||||
|
||||
-- modules
|
||||
pfUI.gui.modules = pfUI.gui:CreateConfigTab("Modules")
|
||||
for i,m in pairs(pfUI.modules) do
|
||||
-- create disabled entry if not existing and display
|
||||
pfUI:UpdateConfig("disabled", nil, m, "0")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.modules, "Disable " .. m, pfUI_config.disabled, m)
|
||||
end
|
||||
|
||||
-- unitframes
|
||||
pfUI.gui.uf = pfUI.gui:CreateConfigTab("UnitFrames")
|
||||
pfUI.gui:CreateConfig(pfUI.gui.uf, "Animation speed", pfUI_config.unitframes, "animation_speed")
|
||||
|
||||
@@ -37,7 +37,12 @@ pfUI:SetScript("OnEvent", function()
|
||||
pfUI:LoadConfig()
|
||||
if arg1 == "pfUI" then
|
||||
for i,m in pairs(this.modules) do
|
||||
pfUI.module[m]()
|
||||
-- do not load disabled modules
|
||||
if pfUI_config["disabled"] and pfUI_config["disabled"][m] == "1" then
|
||||
-- message("DEBUG: module " .. m .. " has been disabled")
|
||||
else
|
||||
pfUI.module[m]()
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
Reference in New Issue
Block a user