scan api refactoring
This commit is contained in:
@@ -28,9 +28,9 @@ function AuxBuySearchButton_OnClick()
|
|||||||
|
|
||||||
search_query = Aux.scan.create_query{
|
search_query = Aux.scan.create_query{
|
||||||
name = AuxBuySearchBox:GetText(),
|
name = AuxBuySearchBox:GetText(),
|
||||||
invTypeIndex = category and category.type,
|
slot = category and category.slot,
|
||||||
classIndex = category and category.class,
|
class = category and category.class,
|
||||||
subclassIndex = category and category.subclass,
|
subclass = category and category.subclass,
|
||||||
}
|
}
|
||||||
|
|
||||||
set_message('Scanning auctions ...')
|
set_message('Scanning auctions ...')
|
||||||
@@ -136,10 +136,6 @@ function AuxBuyBuySelectedButton_OnClick()
|
|||||||
else
|
else
|
||||||
order[key] = nil
|
order[key] = nil
|
||||||
end
|
end
|
||||||
else
|
|
||||||
if auction_item.name == search_query.name then
|
|
||||||
record_auction(auction_item.name, auction_item.tooltip, stack_size, auction_item.buyout_price, auction_item.quality, auction_item.owner, auction_item.hyperlink, auction_item.itemstring)
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
on_complete = function()
|
on_complete = function()
|
||||||
@@ -364,13 +360,13 @@ function AuxBuyCategoryDropDown_Initialize(arg1)
|
|||||||
|
|
||||||
if level == 3 then
|
if level == 3 then
|
||||||
local menu_value = UIDROPDOWNMENU_MENU_VALUE
|
local menu_value = UIDROPDOWNMENU_MENU_VALUE
|
||||||
for i, type in pairs({ GetAuctionInvTypes(menu_value.class, menu_value.subclass) }) do
|
for i, slot in pairs({ GetAuctionInvTypes(menu_value.class, menu_value.subclass) }) do
|
||||||
local type_name = getglobal(type)
|
local slot_name = getglobal(slot)
|
||||||
local value = { class = menu_value.class, subclass = menu_value.subclass, type = i }
|
local value = { class = menu_value.class, subclass = menu_value.subclass, slot = i }
|
||||||
UIDropDownMenu_AddButton({
|
UIDropDownMenu_AddButton({
|
||||||
text = type_name,
|
text = slot_name,
|
||||||
value = value,
|
value = value,
|
||||||
func = AuxBuyCategoryDropDown_OnClick(type_name, value),
|
func = AuxBuyCategoryDropDown_OnClick(slot_name, value),
|
||||||
}, 3)
|
}, 3)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
@@ -443,4 +439,4 @@ end
|
|||||||
|
|
||||||
function Aux.buy.toggle_tooltip_dropdown()
|
function Aux.buy.toggle_tooltip_dropdown()
|
||||||
ToggleDropDownMenu(1, nil, AuxBuyTooltipDropDown, AuxBuyTooltipEdit, -12, 4)
|
ToggleDropDownMenu(1, nil, AuxBuyTooltipDropDown, AuxBuyTooltipEdit, -12, 4)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -101,37 +101,16 @@ end
|
|||||||
|
|
||||||
-----------------------------------------
|
-----------------------------------------
|
||||||
|
|
||||||
function Aux.scan.create_query(parameterMap)
|
|
||||||
local query = {
|
|
||||||
name = nil,
|
|
||||||
minLevel = "",
|
|
||||||
maxLevel = "",
|
|
||||||
invTypeIndex = nil,
|
|
||||||
classIndex = nil,
|
|
||||||
subclassIndex = nil,
|
|
||||||
isUsable = nil,
|
|
||||||
qualityIndex = nil
|
|
||||||
}
|
|
||||||
|
|
||||||
for k,v in pairs(parameterMap) do
|
|
||||||
query[k] = v
|
|
||||||
end
|
|
||||||
|
|
||||||
return query
|
|
||||||
end
|
|
||||||
|
|
||||||
-----------------------------------------
|
|
||||||
|
|
||||||
function submit_query()
|
function submit_query()
|
||||||
QueryAuctionItems(
|
QueryAuctionItems(
|
||||||
current_job.query.name,
|
current_job.query.name,
|
||||||
current_job.query.minLevel,
|
current_job.query.min_level,
|
||||||
current_job.query.maxLevel,
|
current_job.query.max_level,
|
||||||
current_job.query.invTypeIndex,
|
current_job.query.slot,
|
||||||
current_job.query.classIndex,
|
current_job.query.class,
|
||||||
current_job.query.subclassIndex,
|
current_job.query.subclass,
|
||||||
current_page,
|
current_page,
|
||||||
current_job.query.isUsable,
|
current_job.query.usable,
|
||||||
current_job.query.qualityIndex
|
current_job.query.quality
|
||||||
)
|
)
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -302,8 +302,8 @@ function Aux_RefreshEntries()
|
|||||||
Aux.scan.start{
|
Aux.scan.start{
|
||||||
query = Aux.scan.create_query{
|
query = Aux.scan.create_query{
|
||||||
name = name,
|
name = name,
|
||||||
classIndex = class_index,
|
class = class_index,
|
||||||
subclassIndex = subclass_index,
|
subclass = subclass_index,
|
||||||
},
|
},
|
||||||
on_start_page = function(i)
|
on_start_page = function(i)
|
||||||
set_message('Scanning auctions: page ' .. i + 1 .. ' ...')
|
set_message('Scanning auctions: page ' .. i + 1 .. ' ...')
|
||||||
|
|||||||
Reference in New Issue
Block a user