From b1f47646848a83bc6319908fa2836d24648a40dc Mon Sep 17 00:00:00 2001 From: Adrian L Lange Date: Tue, 6 Nov 2012 20:47:32 +0100 Subject: [PATCH] Better logic for reverse behavior --- Monomyth.lua | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/Monomyth.lua b/Monomyth.lua index aa0239f..f8fa3a0 100644 --- a/Monomyth.lua +++ b/Monomyth.lua @@ -3,11 +3,11 @@ Monomyth:SetScript('OnEvent', function(self, event, ...) self[event](...) end) local atBank, atMail, atMerchant -local modifier +local modifier = false function Monomyth:Register(event, func, override) self:RegisterEvent(event) self[event] = function(...) - if(MonomythDB.toggle and (override or not modifier)) then + if(override or MonomythDB.toggle and MonomythDB.reverse == modifier) then func(...) end end @@ -119,7 +119,7 @@ Monomyth:Register('QUEST_DETAIL', function() QuestFrame_OnEvent(QuestFrame, 'QUEST_DETAIL') -- We do this check again instead of improving the event handler - if(MonomythDB.toggle and not modifier) then + if(MonomythDB.toggle and MonomythDB.reverse == modifier) then AcceptQuest() end end @@ -230,11 +230,7 @@ end) local sub = string.sub Monomyth:Register('MODIFIER_STATE_CHANGED', function(key, state) if(sub(key, 2) == MonomythDB.modifier) then - if(MonomythDB.reverse) then - modifier = state ~= 1 - else - modifier = state == 1 - end + modifier = state == 1 end end, true) -- 1.7.9.5