This way. This closes #10
Darth Predator [09-19-17 - 14:37]
This way. This closes #10
diff --git a/ElvUI_SLE/locales/english.lua b/ElvUI_SLE/locales/english.lua
index ba939c0..9e84723 100644
--- a/ElvUI_SLE/locales/english.lua
+++ b/ElvUI_SLE/locales/english.lua
@@ -604,6 +604,7 @@ L["Automatic Width"] = true
L["Change width based on the zone name length."] = true
L["Update Throttle"] = true
L["The frequency of coordinates and zonetext updates. Check will be done more often with lower values."] = true
+L["Hide In Class Hall"] = true
L["Full Location"] = true
L["Color Type"] = true
L["Custom Color"] = true
diff --git a/ElvUI_SLE/locales/german.lua b/ElvUI_SLE/locales/german.lua
index 5f8207e..23ad43c 100644
--- a/ElvUI_SLE/locales/german.lua
+++ b/ElvUI_SLE/locales/german.lua
@@ -595,6 +595,7 @@ L["Automatic Width"] = true
L["Change width based on the zone name length."] = true
L["Update Throttle"] = true
L["The frequency of coordinates and zonetext updates. Check will be done more often with lower values."] = true
+L["Hide In Class Hall"] = true
L["Full Location"] = true
L["Color Type"] = true
L["Custom Color"] = true
diff --git a/ElvUI_SLE/locales/russian.lua b/ElvUI_SLE/locales/russian.lua
index aa85a87..efc589a 100644
--- a/ElvUI_SLE/locales/russian.lua
+++ b/ElvUI_SLE/locales/russian.lua
@@ -601,6 +601,7 @@ L["Automatic Width"] = "Автоматическая ширина"
L["Change width based on the zone name length."] = "Изменять ширину в зависимости от длины текста."
L["Update Throttle"] = "Частота обновления"
L["The frequency of coordinates and zonetext updates. Check will be done more often with lower values."] = "Частота обновления координат и текста локации. Проверка проводится чаще с более низким значением."
+L["Hide In Class Hall"] = "Скрывать в оплоте"
L["Full Location"] = "Полный текст"
L["Color Type"] = "Тип окрашивания"
L["Custom Color"] = "Свой цвет"
diff --git a/ElvUI_SLE/modules/minimap/locationbar.lua b/ElvUI_SLE/modules/minimap/locationbar.lua
index 78cb0a0..b4389c0 100644
--- a/ElvUI_SLE/modules/minimap/locationbar.lua
+++ b/ElvUI_SLE/modules/minimap/locationbar.lua
@@ -366,6 +366,7 @@ function LP:Toggle()
loc_panel:Hide()
E:DisableMover(loc_panel.mover:GetName())
end
+ LP:UNIT_AURA(nil, "player")
end
function LP:PopulateItems()
@@ -499,23 +500,14 @@ 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()
+ LP:UNIT_AURA(nil, "player")
end
-function LP:ZONE_CHANGED_NEW_AREA()
- --if not LP.db.enable then return end
- LP:OrderHallToggle()
-end
-
-function LP:OrderHallToggle()
- if LP.db.enable then
- 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
+function LP:UNIT_AURA(event, unit)
+ if unit ~= "player" then return end
+ if LP.db.enable and LP.db.orderhallhide then
+ local inOrderHall = C_Garrison.IsPlayerInGarrison(LE_GARRISON_TYPE_7_0);
+ loc_panel:SetShown(not inOrderHall);
end
end
@@ -541,7 +533,8 @@ function LP:Initialize()
LP:RegisterEvent("PLAYER_REGEN_DISABLED")
LP:RegisterEvent("PLAYER_REGEN_ENABLED")
LP:RegisterEvent("PLAYER_ENTERING_WORLD")
- LP:RegisterEvent("ZONE_CHANGED_NEW_AREA")
+ LP:RegisterEvent("UNIT_AURA")
+
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 b2a458a..892b3c3 100644
--- a/ElvUI_SLE/options/minimap/locpanel_c.lua
+++ b/ElvUI_SLE/options/minimap/locpanel_c.lua
@@ -13,7 +13,7 @@ local function configTable()
type = "toggle",
name = L["Enable"],
order = 1,
- set = function(info, value) E.db.sle.minimap.locPanel[ info[#info] ] = value; LP:Toggle(); LP:OrderHallToggle() end,
+ set = function(info, value) E.db.sle.minimap.locPanel[ info[#info] ] = value; LP:Toggle(); end,
},
linkcoords = {
type = "toggle",
@@ -75,7 +75,7 @@ local function configTable()
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,
+ set = function(info, value) E.db.sle.minimap.locPanel[ info[#info] ] = value; LP:Toggle(); end,
},
location = {
order = 20,