From 077da8c80575016226ecade736b1dadf8976004a Mon Sep 17 00:00:00 2001 From: Repooc Date: Tue, 19 Sep 2017 05:28:21 -0400 Subject: [PATCH] Initial work on #10 needs locale and some other eyes since its been awhile since I done some lua --- ElvUI_SLE/defaults/profile.lua | 1 + ElvUI_SLE/modules/minimap/locationbar.lua | 17 +++++++++++++++++ ElvUI_SLE/options/minimap/locpanel_c.lua | 7 ++++++- 3 files changed, 24 insertions(+), 1 deletion(-) 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", -- 1.7.9.5