--amend
This commit is contained in:
+23
-24
@@ -24,22 +24,22 @@ function m:complete()
|
|||||||
|
|
||||||
local completed_filter_string = ({strfind(filter_string, '([^;]*)/[^/;]*$')})[3]
|
local completed_filter_string = ({strfind(filter_string, '([^;]*)/[^/;]*$')})[3]
|
||||||
local current_filter = completed_filter_string and Aux.scan_util.filter_from_string(completed_filter_string)
|
local current_filter = completed_filter_string and Aux.scan_util.filter_from_string(completed_filter_string)
|
||||||
|
local current_query = current_filter and current_filter.blizzard_query
|
||||||
|
|
||||||
local options = {}
|
local options = {}
|
||||||
|
|
||||||
if current_filter or not completed_filter_string then
|
if current_query or not completed_filter_string then
|
||||||
current_filter = current_filter or {}
|
current_query = current_query or {}
|
||||||
|
|
||||||
if current_filter.name
|
if current_query.name
|
||||||
and Aux.static.item_id(strupper(current_filter.name))
|
and Aux.static.item_id(strupper(current_query.name))
|
||||||
and not current_filter.min_level
|
and not current_query.min_level
|
||||||
and not current_filter.max_level
|
and not current_query.max_level
|
||||||
and not current_filter.class
|
and not current_query.class
|
||||||
and not current_filter.subclass
|
and not current_query.subclass
|
||||||
and not current_filter.slot
|
and not current_query.slot
|
||||||
and not current_filter.quality
|
and not current_query.quality
|
||||||
and not current_filter.usable
|
and not current_query.usable
|
||||||
and not current_filter.exact
|
|
||||||
then
|
then
|
||||||
tinsert(options, 'exact')
|
tinsert(options, 'exact')
|
||||||
end
|
end
|
||||||
@@ -49,44 +49,43 @@ function m:complete()
|
|||||||
tinsert(options, 'not')
|
tinsert(options, 'not')
|
||||||
tinsert(options, 'tt')
|
tinsert(options, 'tt')
|
||||||
|
|
||||||
|
for filter, _ in pairs(Aux.scan_util.filters) do
|
||||||
|
tinsert(options, strlower(filter))
|
||||||
|
end
|
||||||
|
|
||||||
-- classes
|
-- classes
|
||||||
if not current_filter.class and not current_filter.exact then
|
if not current_query.class then
|
||||||
for _, class in ipairs({ GetAuctionItemClasses() }) do
|
for _, class in ipairs({ GetAuctionItemClasses() }) do
|
||||||
tinsert(options, class)
|
tinsert(options, class)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- subclasses
|
-- subclasses
|
||||||
if current_filter.class and not current_filter.subclass then
|
if current_query.class and not current_query.subclass then
|
||||||
for _, subclass in ipairs({ GetAuctionItemSubClasses(current_filter.class) }) do
|
for _, subclass in ipairs({ GetAuctionItemSubClasses(current_query.class) }) do
|
||||||
tinsert(options, subclass)
|
tinsert(options, subclass)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- slots
|
-- slots
|
||||||
if current_filter.class and current_filter.subclass and not current_filter.slot then
|
if current_query.class and current_query.subclass and not current_query.slot then
|
||||||
for _, invtype in ipairs({ GetAuctionInvTypes(current_filter.class, current_filter.subclass) }) do
|
for _, invtype in ipairs({ GetAuctionInvTypes(current_query.class, current_query.subclass) }) do
|
||||||
tinsert(options, getglobal(invtype))
|
tinsert(options, getglobal(invtype))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- usable
|
-- usable
|
||||||
if not current_filter.usable and not current_filter.exact then
|
if not current_query.usable then
|
||||||
tinsert(options, 'usable')
|
tinsert(options, 'usable')
|
||||||
end
|
end
|
||||||
|
|
||||||
-- rarities
|
-- rarities
|
||||||
if not current_filter.quality and not current_filter.exact then
|
if not current_query.quality then
|
||||||
for i=0,4 do
|
for i=0,4 do
|
||||||
tinsert(options, getglobal('ITEM_QUALITY'..i..'_DESC'))
|
tinsert(options, getglobal('ITEM_QUALITY'..i..'_DESC'))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
-- discard
|
|
||||||
if not current_filter.discard then
|
|
||||||
tinsert(options, 'discard')
|
|
||||||
end
|
|
||||||
|
|
||||||
-- item names
|
-- item names
|
||||||
if not completed_filter_string then
|
if not completed_filter_string then
|
||||||
for _, name in ipairs(m.sorted_item_names()) do
|
for _, name in ipairs(m.sorted_item_names()) do
|
||||||
|
|||||||
+4
-2
@@ -164,13 +164,15 @@ function private.prettify_search(search)
|
|||||||
return NORMAL_FONT_COLOR_CODE..'No filter'..FONT_COLOR_CODE_CLOSE
|
return NORMAL_FONT_COLOR_CODE..'No filter'..FONT_COLOR_CODE_CLOSE
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local default_color = Aux.gui.inline_color({216, 225, 211, 1})
|
||||||
|
|
||||||
local item_pattern = '([^/;]+)([^;]*)/exact'
|
local item_pattern = '([^/;]+)([^;]*)/exact'
|
||||||
while true do
|
while true do
|
||||||
local _, _, name, in_between = strfind(search, item_pattern)
|
local _, _, name, in_between = strfind(search, item_pattern)
|
||||||
if name then
|
if name then
|
||||||
search = gsub(search, item_pattern, private.display_name(Aux.static.item_id(strupper(name)))..in_between, 1)
|
search = gsub(search, item_pattern, private.display_name(Aux.static.item_id(strupper(name)))..default_color..in_between, 1)
|
||||||
else
|
else
|
||||||
return Aux.gui.inline_color({216, 225, 211, 1})..search..'|r'
|
return default_color..search..'|r'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user