refactoring
This commit is contained in:
+5
-9
@@ -41,13 +41,13 @@ function LOAD()
|
|||||||
end
|
end
|
||||||
|
|
||||||
do
|
do
|
||||||
local sell_scan_countdown, incomplete_buy_data
|
local sell_scan_queued, incomplete_buy_data
|
||||||
function on_merchant_show()
|
function on_merchant_show()
|
||||||
merchant_sell_scan()
|
merchant_sell_scan()
|
||||||
incomplete_buy_data = not merchant_buy_scan()
|
incomplete_buy_data = not merchant_buy_scan()
|
||||||
end
|
end
|
||||||
function on_merchant_closed()
|
function on_merchant_closed()
|
||||||
sell_scan_countdown = nil
|
sell_scan_queued = nil
|
||||||
incomplete_buy_data = false
|
incomplete_buy_data = false
|
||||||
end
|
end
|
||||||
function on_merchant_update()
|
function on_merchant_update()
|
||||||
@@ -57,15 +57,13 @@ do
|
|||||||
end
|
end
|
||||||
function on_bag_update()
|
function on_bag_update()
|
||||||
if MerchantFrame:IsVisible() then
|
if MerchantFrame:IsVisible() then
|
||||||
sell_scan_countdown = 10
|
sell_scan_queued = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
function merchant_on_update()
|
function merchant_on_update()
|
||||||
if sell_scan_countdown == 0 then
|
if sell_scan_queued then
|
||||||
sell_scan_countdown = nil
|
sell_scan_queued = nil
|
||||||
merchant_sell_scan()
|
merchant_sell_scan()
|
||||||
elseif sell_scan_countdown then
|
|
||||||
sell_scan_countdown = sell_scan_countdown - 1
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -84,7 +82,6 @@ function public.merchant_info(item_id)
|
|||||||
if aux_merchant_buy[item_id] then
|
if aux_merchant_buy[item_id] then
|
||||||
buy_info = persistence.read(merchant_buy_schema, aux_merchant_buy[item_id])
|
buy_info = persistence.read(merchant_buy_schema, aux_merchant_buy[item_id])
|
||||||
end
|
end
|
||||||
|
|
||||||
return aux_merchant_sell[item_id], buy_info and buy_info.unit_price, buy_info and buy_info.limited
|
return aux_merchant_sell[item_id], buy_info and buy_info.unit_price, buy_info and buy_info.limited
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -111,7 +108,6 @@ function public.item_id(item_name)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function merchant_buy_scan()
|
function merchant_buy_scan()
|
||||||
|
|
||||||
local incomplete_data
|
local incomplete_data
|
||||||
for i = 1, GetMerchantNumItems() do
|
for i = 1, GetMerchantNumItems() do
|
||||||
local _, _, price, count, stock = GetMerchantItemInfo(i)
|
local _, _, price, count, stock = GetMerchantItemInfo(i)
|
||||||
|
|||||||
Reference in New Issue
Block a user