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
+4
View File
@@ -68,7 +68,11 @@ function wait_for_results(k)
end
function wait_for_owner_data(k)
local t0 = time()
return controller().wait(function()
if time() - t0 > 5 then -- we won't wait longer than 5 seconds
return true
end
local count, _ = GetNumAuctionItems(state.job.type)
for i=1,count do
local auction_info = Aux.info.auction(i, state.job.type)
+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,
}
}
+5 -1
View File
@@ -9,7 +9,11 @@
</OnLoad>
<OnEvent>
Aux.static.on_event()
</OnEvent>
</OnEvent>
<OnUpdate>
Aux.static.on_update()
</OnUpdate>
</Scripts>
</Frame>
<GameTooltip name="AuxStaticTooltip" inherits="GameTooltipTemplate"/>
</Ui>
View File