Quantcast

loc panel combat hide

Darthpred [08-20-16 - 16:51]
loc panel combat hide
Filename
CHANGELOG.txt
ElvUI_SLE/defaults/profile.lua
ElvUI_SLE/modules/minimap/locationbar.lua
ElvUI_SLE/options/minimap/locpanel_c.lua
diff --git a/CHANGELOG.txt b/CHANGELOG.txt
index 0963e7c..6474c7f 100644
--- a/CHANGELOG.txt
+++ b/CHANGELOG.txt
@@ -8,6 +8,7 @@ Additions:
 - Location panel menu now contains challenge mode teleports
 - UI BUttons and Background panels now have visibility state option. Works like actionbar visibility.
 - Added an option to select background template for vehicle bar.
+- Added an option to hide in combat for location panel
 Fixes:
 - Attempted to fix error with S&L guild dt when one of guild members happen to be in the middle of actual nowhere
 - Fixed error in item level dt cause by empty slots
diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua
index 75ea8a4..b4924b1 100644
--- a/ElvUI_SLE/defaults/profile.lua
+++ b/ElvUI_SLE/defaults/profile.lua
@@ -495,6 +495,7 @@ P["sle"] = {
 			["zoneText"] = true,
 			["colorType"] = "REACTION",
 			["customColor"] = {r = 1, g = 1, b = 1 },
+			["combathide"] = false,
 			["portals"] = {
 				["enable"] = true,
 				["HSplace"] = true,
diff --git a/ElvUI_SLE/modules/minimap/locationbar.lua b/ElvUI_SLE/modules/minimap/locationbar.lua
index 0cab41f..405f8bb 100644
--- a/ElvUI_SLE/modules/minimap/locationbar.lua
+++ b/ElvUI_SLE/modules/minimap/locationbar.lua
@@ -421,6 +421,14 @@ function LP:PopulateDropdown()
 	SLE:DropDown(LP.MainMenu, LP.Menu1, anchor, point, 0, 0, _G["SLE_LocationPanel"], MENU_WIDTH, LP.db.portals.justify)
 end

+function LP:PLAYER_REGEN_DISABLED()
+	if LP.db.combathide then loc_panel:Hide() end
+end
+
+function LP:PLAYER_REGEN_ENABLED()
+	if LP.db.enable then loc_panel:Show() end
+end
+
 function LP:Initialize()
 	LP.db = E.db.sle.minimap.locPanel
 	if not SLE.initialized then return end
@@ -439,6 +447,9 @@ function LP:Initialize()
 		LP:Fonts()
 		LP:Toggle()
 	end
+
+	LP:RegisterEvent("PLAYER_REGEN_DISABLED")
+ 	LP:RegisterEvent("PLAYER_REGEN_ENABLED")
 end

 SLE:RegisterModule(LP:GetName())
\ No newline at end of file
diff --git a/ElvUI_SLE/options/minimap/locpanel_c.lua b/ElvUI_SLE/options/minimap/locpanel_c.lua
index 1ce2363..cb9a91a 100644
--- a/ElvUI_SLE/options/minimap/locpanel_c.lua
+++ b/ElvUI_SLE/options/minimap/locpanel_c.lua
@@ -112,8 +112,14 @@ local function configTable()
 				order = 11,
 				set = function(info, value) E.db.sle.minimap.locPanel[ info[#info] ] = value; end,
 			},
-			portals = {
+			combathide = {
 				order = 12,
+				type = "toggle",
+				name = L["Hide In Combat"],
+				set = function(info, value) E.db.sle.minimap.locPanel[ info[#info] ] = value; end,
+			},
+			portals = {
+				order = 20,
 				type = "group",
 				name = L["Relocation Menu"],
 				guiInline = true,
@@ -168,7 +174,7 @@ local function configTable()
 				},
 			},
 			fontGroup = {
-				order = 13,
+				order = 30,
 				type = "group",
 				name = L["Fonts"],
 				guiInline = true,