some work on a fix for the missing item in autocomplete issue

This commit is contained in:
Simon Hirsig
2015-11-04 17:27:12 +01:00
parent 2fd9d1b2c4
commit bfedc48475
4 changed files with 37 additions and 3 deletions
+28 -2
View File
@@ -3,6 +3,9 @@ Aux.static = public
aux_auctionable_items = {}
private.last_query_time = 0
private.uncached_item_ids = {}
function public.on_event()
if event == 'VARIABLES_LOADED' then
@@ -14,11 +17,34 @@ function public.on_event()
local name = GetItemInfo(item_id)
if name then
tinsert(Aux.localized_auctionable_items, { name=name, id=item_id })
end
else
tinsert(private.uncached_item_ids, item_id)
end
end
end
end
function public.on_update()
while private.uncached_item_ids[1] do
local name = GetItemInfo(private.uncached_item_ids[1])
if name then
local item_id = tremove(private.uncached_item_ids, 1)
tinsert(Aux.localized_auctionable_items, { name=name, id=item_id })
else
break
end
end
if private.uncached_item_ids[1] then
local now = time()
if now - private.last_query_time > 1 then
private.last_query_time = now
Aux.log('querying data for item id '..private.uncached_item_ids[1])
AuxStaticTooltip:SetHyperlink('item:'..private.uncached_item_ids[1])
end
end
end
function private.find_auctionable_items(i)
for j=i, i+1000 do
local name = GetItemInfo('item:'..j)
@@ -7247,4 +7273,4 @@ private.auctionable_items = {
[7205] = 24281,
[7206] = 24282,
[7207] = 24283,
}
}