Quantcast

Initial work on #10 needs locale and some other eyes since its been awhile since I done some lua

Repooc [09-19-17 - 09:28]
Initial work on #10 needs locale and some other eyes since its been awhile since I done some lua
Filename
ElvUI_SLE/defaults/profile.lua
ElvUI_SLE/modules/minimap/locationbar.lua
ElvUI_SLE/options/minimap/locpanel_c.lua
diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua
index f83c4aa..a653db8 100644
--- a/ElvUI_SLE/defaults/profile.lua
+++ b/ElvUI_SLE/defaults/profile.lua
@@ -532,6 +532,7 @@ P["sle"] = {
 			["customColor"] = {r = 1, g = 1, b = 1 },
 			["customColor_Coords"] = {r = 1, g = 1, b = 1 },
 			["combathide"] = false,
+			["orderhallhide"] = false,
 			["portals"] = {
 				["enable"] = true,
 				["HSplace"] = true,
diff --git a/ElvUI_SLE/modules/minimap/locationbar.lua b/ElvUI_SLE/modules/minimap/locationbar.lua
index d0dfa06..2b1dbca 100644
--- a/ElvUI_SLE/modules/minimap/locationbar.lua
+++ b/ElvUI_SLE/modules/minimap/locationbar.lua
@@ -499,6 +499,22 @@ end
 function LP:PLAYER_ENTERING_WORLD()
 	local x, y = T.GetPlayerMapPosition("player")
 	if x then LP.RestrictedArea = false else LP.RestrictedArea = true end
+	LP:OrderHallToggle()
+end
+
+function LP:ZONE_CHANGED_NEW_AREA()
+	if not LP.db.enable then return end
+	LP:OrderHallToggle()
+end
+
+function LP:OrderHallToggle()
+	if (C_Garrison.IsPlayerInGarrison(LE_GARRISON_TYPE_7_0)) and LP.db.orderhallhide then
+		--print("I have entered my class hall")
+		loc_panel:Hide()
+	elseif not loc_panel:IsShown() then
+		--print("I have left my class hall")
+		loc_panel:Show()
+	end
 end

 function LP:Initialize()
@@ -523,6 +539,7 @@ function LP:Initialize()
 	LP:RegisterEvent("PLAYER_REGEN_DISABLED")
  	LP:RegisterEvent("PLAYER_REGEN_ENABLED")
  	LP:RegisterEvent("PLAYER_ENTERING_WORLD")
+	LP:RegisterEvent("ZONE_CHANGED_NEW_AREA")
 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 af8b575..9d0575f 100644
--- a/ElvUI_SLE/options/minimap/locpanel_c.lua
+++ b/ElvUI_SLE/options/minimap/locpanel_c.lua
@@ -71,7 +71,12 @@ local function configTable()
 				name = L["Hide In Combat"],
 				set = function(info, value) E.db.sle.minimap.locPanel[ info[#info] ] = value; end,
 			},
-
+			orderhallhide = {
+				order = 9,
+				type = "toggle",
+				name = L["Hide In Class Hall"],
+				set = function(info, value) E.db.sle.minimap.locPanel[ info[#info] ] = value; LP:OrderHallToggle() end,
+			},
 			location = {
 				order = 20,
 				type = "group",