diff --git a/api/config.lua b/api/config.lua index f0c2bbcf..bb240e9e 100644 --- a/api/config.lua +++ b/api/config.lua @@ -464,6 +464,10 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("bars", "pet", "formfactor", "10 x 1") pfUI:UpdateConfig("panel", nil, "use_unitfonts", "0") + pfUI:UpdateConfig("panel", nil, "hide_leftchat", "0") + pfUI:UpdateConfig("panel", nil, "hide_rightchat", "0") + pfUI:UpdateConfig("panel", nil, "hide_minimap", "0") + pfUI:UpdateConfig("panel", nil, "hide_microbar", "0") pfUI:UpdateConfig("panel", "left", "left", "guild") pfUI:UpdateConfig("panel", "left", "center", "durability") pfUI:UpdateConfig("panel", "left", "right", "friends") @@ -474,6 +478,7 @@ function pfUI:LoadConfig() pfUI:UpdateConfig("panel", "micro", "enable", "0") pfUI:UpdateConfig("panel", "xp", "showalways", "0") pfUI:UpdateConfig("panel", "bag", "ignorespecial", "1") + pfUI:UpdateConfig("castbar", "player", "hide_blizz", "1") pfUI:UpdateConfig("castbar", "player", "hide_pfui", "0") pfUI:UpdateConfig("castbar", "target", "hide_pfui", "0") diff --git a/modules/gui.lua b/modules/gui.lua index 9132bd3e..05c3cae6 100644 --- a/modules/gui.lua +++ b/modules/gui.lua @@ -1262,6 +1262,18 @@ pfUI:RegisterModule("gui", function () end end) + -- >> Autohide + pfUI.gui.tabs.panel.tabs.autohide = pfUI.gui.tabs.panel.tabs:CreateTabChild(T["Autohide"], true) + pfUI.gui.tabs.panel.tabs.autohide:SetScript("OnShow", function() + if not this.setup then + CreateConfig(this, T["Enable Autohide For Left Chat Panel"], C.panel, "hide_leftchat", "checkbox") + CreateConfig(this, T["Enable Autohide For Right Chat Panel"], C.panel, "hide_rightchat", "checkbox") + CreateConfig(this, T["Enable Autohide For Minimap Panel"], C.panel, "hide_minimap", "checkbox") + CreateConfig(this, T["Enable Autohide For Microbar Panel"], C.panel, "hide_microbar", "checkbox") + this.setup = true + end + end) + -- [[ Tooltip ]] pfUI.gui.tabs.tooltip = pfUI.gui.tabs:CreateTabChild(T["Tooltip"], nil, nil, nil, true) diff --git a/modules/panel.lua b/modules/panel.lua index 5c319eeb..0b0b7e13 100644 --- a/modules/panel.lua +++ b/modules/panel.lua @@ -704,4 +704,22 @@ pfUI:RegisterModule("panel", function () button:Show() end end + + + pfUI.panel.autohide = CreateFrame("Frame", nil, UIParent) + pfUI.panel.autohide:RegisterEvent("PLAYER_ENTERING_WORLD") + pfUI.panel.autohide:SetScript("OnEvent", function() + if C.panel.hide_leftchat == "1" then + CreateAutohide(pfUI.panel.left) + end + if C.panel.hide_rightchat == "1" then + CreateAutohide(pfUI.panel.right) + end + if C.panel.hide_minimap == "1" then + CreateAutohide(pfUI.panel.minimap) + end + if C.panel.hide_microbar == "1" then + CreateAutohide(pfUI.panel.microbutton) + end + end) end)