refactoring and some work on the buy tab backend

This commit is contained in:
Manuel Simon Hirsig
2015-09-08 22:11:48 +02:00
parent 21ab9ac4a7
commit 0217ac7088
9 changed files with 189 additions and 79 deletions
+14 -11
View File
@@ -26,7 +26,7 @@ end
function Auctionator_Scan_Complete()
if currentQuery.onComplete then
currentQuery.onComplete(scanData);
currentQuery.onComplete(scanData)
end
currentQuery = nil
@@ -40,7 +40,7 @@ end
function Auctionator_Scan_Abort()
if currentQuery and currentQuery.onAbort then
currentQuery.onAbort();
currentQuery.onAbort()
end
currentQuery = nil
@@ -158,8 +158,17 @@ end
-----------------------------------------
local eventFrame = CreateFrame("Frame")
eventFrame:SetScript("OnUpdate", function()
function Auctionator_Scan_OnEvent()
if event == "AUCTION_ITEM_LIST_UPDATE" then
if state == STATE_POSTQUERY then
processQueryResults()
end
end
end
-----------------------------------------
function Auctionator_Scan_OnUpdate()
if state == STATE_PREQUERY and GetTime() - timeOfLastUpdate > 0.5 then
timeOfLastUpdate = GetTime()
@@ -168,10 +177,4 @@ eventFrame:SetScript("OnUpdate", function()
submitQuery()
end
end
end)
eventFrame:RegisterEvent("AUCTION_ITEM_LIST_UPDATE")
eventFrame:SetScript("OnEvent", function(event)
if state == STATE_POSTQUERY then
processQueryResults()
end
end)
end