refactoring
This commit is contained in:
+1
-1
@@ -8,7 +8,7 @@ function public:complete_filter()
|
|||||||
local filter_string = this:GetText()
|
local filter_string = this:GetText()
|
||||||
|
|
||||||
local completed_filter_string = select(3, strfind(filter_string, '([^;]*)/[^/;]*$'))
|
local completed_filter_string = select(3, strfind(filter_string, '([^;]*)/[^/;]*$'))
|
||||||
local _, suggestions = filter_util.query(completed_filter_string or '')
|
local _, suggestions = filter_util.query(completed_filter_string)
|
||||||
|
|
||||||
local start_index, _, current_modifier = strfind(filter_string, '([^/;]*)$')
|
local start_index, _, current_modifier = strfind(filter_string, '([^/;]*)$')
|
||||||
current_modifier = current_modifier or ''
|
current_modifier = current_modifier or ''
|
||||||
|
|||||||
+3
-2
@@ -278,7 +278,8 @@ end
|
|||||||
function public.parse_filter_string(str)
|
function public.parse_filter_string(str)
|
||||||
local filter, post_filter = t, t
|
local filter, post_filter = t, t
|
||||||
local blizzard_filter_parser = blizzard_filter_parser()
|
local blizzard_filter_parser = blizzard_filter_parser()
|
||||||
local parts = map(split(str, '/'), function(part) return strlower(trim(part)) end)
|
|
||||||
|
local parts = str and map(split(str, '/'), function(part) return strlower(trim(part)) end) or t
|
||||||
|
|
||||||
local i = 1
|
local i = 1
|
||||||
while parts[i] do
|
while parts[i] do
|
||||||
@@ -409,7 +410,7 @@ function suggestions(filter)
|
|||||||
end
|
end
|
||||||
|
|
||||||
-- item names
|
-- item names
|
||||||
if getn(filter.components) == 1 then
|
if getn(filter.components) == 0 then
|
||||||
for _, name in _G.aux_auctionable_items do
|
for _, name in _G.aux_auctionable_items do
|
||||||
tinsert(suggestions, name..'/exact')
|
tinsert(suggestions, name..'/exact')
|
||||||
end
|
end
|
||||||
|
|||||||
+1
-1
@@ -367,7 +367,7 @@ function public.item(item_id, suffix_id)
|
|||||||
slot = slot,
|
slot = slot,
|
||||||
max_stack = max_stack,
|
max_stack = max_stack,
|
||||||
texture = texture,
|
texture = texture,
|
||||||
} or cache.item_info(item_id)
|
} or aux.cache.item_info(item_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
function public.item_class_index(item_class)
|
function public.item_class_index(item_class)
|
||||||
|
|||||||
Reference in New Issue
Block a user