some work on a fix for the missing item in autocomplete issue
This commit is contained in:
@@ -68,7 +68,11 @@ function wait_for_results(k)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function wait_for_owner_data(k)
|
function wait_for_owner_data(k)
|
||||||
|
local t0 = time()
|
||||||
return controller().wait(function()
|
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)
|
local count, _ = GetNumAuctionItems(state.job.type)
|
||||||
for i=1,count do
|
for i=1,count do
|
||||||
local auction_info = Aux.info.auction(i, state.job.type)
|
local auction_info = Aux.info.auction(i, state.job.type)
|
||||||
|
|||||||
+28
-2
@@ -3,6 +3,9 @@ Aux.static = public
|
|||||||
|
|
||||||
aux_auctionable_items = {}
|
aux_auctionable_items = {}
|
||||||
|
|
||||||
|
private.last_query_time = 0
|
||||||
|
private.uncached_item_ids = {}
|
||||||
|
|
||||||
function public.on_event()
|
function public.on_event()
|
||||||
if event == 'VARIABLES_LOADED' then
|
if event == 'VARIABLES_LOADED' then
|
||||||
|
|
||||||
@@ -14,11 +17,34 @@ function public.on_event()
|
|||||||
local name = GetItemInfo(item_id)
|
local name = GetItemInfo(item_id)
|
||||||
if name then
|
if name then
|
||||||
tinsert(Aux.localized_auctionable_items, { name=name, id=item_id })
|
tinsert(Aux.localized_auctionable_items, { name=name, id=item_id })
|
||||||
end
|
else
|
||||||
|
tinsert(private.uncached_item_ids, item_id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
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)
|
function private.find_auctionable_items(i)
|
||||||
for j=i, i+1000 do
|
for j=i, i+1000 do
|
||||||
local name = GetItemInfo('item:'..j)
|
local name = GetItemInfo('item:'..j)
|
||||||
@@ -7247,4 +7273,4 @@ private.auctionable_items = {
|
|||||||
[7205] = 24281,
|
[7205] = 24281,
|
||||||
[7206] = 24282,
|
[7206] = 24282,
|
||||||
[7207] = 24283,
|
[7207] = 24283,
|
||||||
}
|
}
|
||||||
|
|||||||
+5
-1
@@ -9,7 +9,11 @@
|
|||||||
</OnLoad>
|
</OnLoad>
|
||||||
<OnEvent>
|
<OnEvent>
|
||||||
Aux.static.on_event()
|
Aux.static.on_event()
|
||||||
</OnEvent>
|
</OnEvent>
|
||||||
|
<OnUpdate>
|
||||||
|
Aux.static.on_update()
|
||||||
|
</OnUpdate>
|
||||||
</Scripts>
|
</Scripts>
|
||||||
</Frame>
|
</Frame>
|
||||||
|
<GameTooltip name="AuxStaticTooltip" inherits="GameTooltipTemplate"/>
|
||||||
</Ui>
|
</Ui>
|
||||||
|
|||||||
Reference in New Issue
Block a user