Optimize search result validation polling
This commit is contained in:
@@ -364,6 +364,7 @@ do
|
|||||||
local IDLE, SEARCHING, FOUND = aux.enum(3)
|
local IDLE, SEARCHING, FOUND = aux.enum(3)
|
||||||
local state = IDLE
|
local state = IDLE
|
||||||
local found_index
|
local found_index
|
||||||
|
local update_elapsed = 0
|
||||||
|
|
||||||
function find_auction(record)
|
function find_auction(record)
|
||||||
local search = current_search()
|
local search = current_search()
|
||||||
@@ -421,6 +422,10 @@ do
|
|||||||
end
|
end
|
||||||
|
|
||||||
function on_update()
|
function on_update()
|
||||||
|
update_elapsed = update_elapsed + (arg1 or 0)
|
||||||
|
if update_elapsed < .1 then return end
|
||||||
|
update_elapsed = 0
|
||||||
|
|
||||||
if state == IDLE or state == SEARCHING then
|
if state == IDLE or state == SEARCHING then
|
||||||
buyout_button:Disable()
|
buyout_button:Disable()
|
||||||
bid_button:Disable()
|
bid_button:Disable()
|
||||||
|
|||||||
Reference in New Issue
Block a user