Quantcast

Kill the delay option

Adrian L Lange [10-23-14 - 19:26]
Kill the delay option
Filename
Config.lua
QuickQuest.lua
diff --git a/Config.lua b/Config.lua
index f3060c1..7494477 100644
--- a/Config.lua
+++ b/Config.lua
@@ -11,7 +11,6 @@ local defaults = {
 	gossipraid = true,
 	modifier = 'SHIFT',
 	reverse = false,
-	delay = false,
 	itemBlacklist = {
 		-- Inscription weapons
 		[31690] = 79343, -- Inscribed Tiger Staff
@@ -305,12 +304,8 @@ Panel:SetScript('OnShow', function(self)
 	Toggle:HookScript('OnClick', ToggleAll)
 	Toggle.Text:SetText(L['Enable automating'])

-	local Delay = CreateCheckButton(self, 'delay')
-	Delay:SetPoint('TOPLEFT', Toggle, 'BOTTOMLEFT', 24, -8)
-	Delay.Text:SetText(L['Slow down the automating'])
-
 	local Items = CreateCheckButton(self, 'items')
-	Items:SetPoint('TOPLEFT', Delay, 'BOTTOMLEFT', -24, -8)
+	Items:SetPoint('TOPLEFT', Toggle, 'BOTTOMLEFT', 0, -8)
 	Items.Text:SetText(L['Start quests from items'])

 	local Gossip = CreateCheckButton(self, 'gossip')
diff --git a/QuickQuest.lua b/QuickQuest.lua
index 8e87632..9459e39 100644
--- a/QuickQuest.lua
+++ b/QuickQuest.lua
@@ -1,57 +1,15 @@
 local QuickQuest = CreateFrame('Frame')
 QuickQuest:SetScript('OnEvent', function(self, event, ...) self[event](...) end)

-local DelayHandler
-do
-	local currentInfo = {}
-	local function TimerCallback()
-		DelayHandler(unpack(currentInfo))
-	end
-
-	local delayed = true
-	function DelayHandler(func, ...)
-		if(delayed) then
-			delayed = false
-
-			table.wipe(currentInfo)
-			table.insert(currentInfo, func)
-
-			for index = 1, select('#', ...) do
-				local argument = select(index, ...)
-				table.insert(currentInfo, argument)
-			end
-
-			C_Timer.After(1, TimerCallback)
-		else
-			delayed = true
-			func(...)
-		end
-	end
-end
-
 local atBank, atMail, atMerchant
 local choiceQueue, autoCompleteIndex

-local delayEvent = {
-	GOSSIP_SHOW = true,
-	GOSSIP_CONFIRM = true,
-	QUEST_GREETING = true,
-	QUEST_DETAIL = true,
-	QUEST_ACCEPT_CONFIRM = true,
-	QUEST_PROGRESS = true,
-	QUEST_AUTOCOMPLETE = true
-}
-
 local modifier = false
 function QuickQuest:Register(event, func, override)
 	self:RegisterEvent(event)
 	self[event] = function(...)
 		if(override or QuickQuestDB.toggle and QuickQuestDB.reverse == modifier) then
-			if(QuickQuestDB.delay and delayEvent[event]) then
-				DelayHandler(func, ...)
-			else
-				func(...)
-			end
+			func(...)
 		end
 	end
 end