From ed257b83c3c2d2440eb4e07d9766391eb11a3eff Mon Sep 17 00:00:00 2001 From: Darthpred Date: Fri, 2 Sep 2016 14:39:50 +0300 Subject: [PATCH] Fixed order hall conditional and added a new option --- ElvUI_SLE/defaults/profile.lua | 1 + ElvUI_SLE/modules/quests/quests.lua | 7 ++++--- ElvUI_SLE/options/quests_c.lua | 7 +++++++ 3 files changed, 12 insertions(+), 3 deletions(-) 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", -- 1.7.9.5