Quantcast

Fixed order hall conditional and added a new option

Darthpred [09-02-16 - 11:39]
Fixed order hall conditional and added a new option
Filename
ElvUI_SLE/defaults/profile.lua
ElvUI_SLE/modules/quests/quests.lua
ElvUI_SLE/options/quests_c.lua
diff --git a/ElvUI_SLE/defaults/profile.lua b/ElvUI_SLE/defaults/profile.lua
index 3ed1a77..7769ba6 100644
--- a/ElvUI_SLE/defaults/profile.lua
+++ b/ElvUI_SLE/defaults/profile.lua
@@ -549,6 +549,7 @@ P["sle"] = {
 	--Quests
 	["quests"] = {
 		["visibility"] = {
+			["enable"] = false,
 			["bg"] = "COLLAPSED",
 			["arena"] = "COLLAPSED",
 			["dungeon"] = "FULL",
diff --git a/ElvUI_SLE/modules/quests/quests.lua b/ElvUI_SLE/modules/quests/quests.lua
index 6b540ad..ef7fe3f 100644
--- a/ElvUI_SLE/modules/quests/quests.lua
+++ b/ElvUI_SLE/modules/quests/quests.lua
@@ -19,15 +19,16 @@ local statedriver = {
 }

 function Q:ChangeState(event)
-	if T.InCombatLockdown() then self:RegisterEvent("PLAYER_REGEN_ENABLED", "ChangeState") return end
-	if event == "PLAYER_REGEN_ENABLED" then self:UnregisterEvent("PLAYER_REGEN_ENABLED") end
 	if not Q.db then return end
 	if not Q.db.visibility then return end
+	if not Q.db.visibility.enable then return end
+	if T.InCombatLockdown() then self:RegisterEvent("PLAYER_REGEN_ENABLED", "ChangeState") return end
+	if event == "PLAYER_REGEN_ENABLED" then self:UnregisterEvent("PLAYER_REGEN_ENABLED") end

 	if T.GetZoneText() == BL.Frostwall or T.GetZoneText() == BL.Lunarfall then
 		statedriver[Q.db.visibility.garrison](Q.frame)
 	--here be order halls
-	elseif T.GetRealZoneText() ~= _G["ORDER_HALL_"..E.myclass] then
+	elseif T.GetRealZoneText() == _G["ORDER_HALL_"..E.myclass] then
 		statedriver[Q.db.visibility.orderhall](Q.frame)
 	elseif IsResting() then
 		statedriver[Q.db.visibility.rested](Q.frame)
diff --git a/ElvUI_SLE/options/quests_c.lua b/ElvUI_SLE/options/quests_c.lua
index 020d785..0c15ada 100644
--- a/ElvUI_SLE/options/quests_c.lua
+++ b/ElvUI_SLE/options/quests_c.lua
@@ -38,9 +38,16 @@ local function configTable()
 				order = 10,
 				guiInline = true,
 				name = L["Quest Log Toggle"],
+				disabled = function() return not E.db.sle.quests.visibility.enable end,
 				get = function(info) return E.db.sle.quests.visibility[ info[#info] ] end,
 				set = function(info, value) E.db.sle.quests.visibility[ info[#info] ] = value; Q:ChangeState() end,
 				args = {
+					enable = {
+						order = 1,
+						type = "toggle",
+						name = L["Enable"],
+						disabled = false,
+					},
 					rested = {
 						order = 2,
 						type = "select",