post rework complete

This commit is contained in:
Manuel Simon Hirsig
2016-02-05 01:15:51 +01:00
parent 36533f67a3
commit 0284a07a09
5 changed files with 101 additions and 92 deletions
+6 -8
View File
@@ -219,13 +219,11 @@ function public.set_shopping_tooltip(slot)
end
end
function public.tooltip_match(patterns, tooltip)
return Aux.util.all(patterns, function(pattern)
return Aux.util.any(tooltip, function(line)
local left_match = line[1].text and strfind(strupper(line[1].text), strupper(pattern), 1, true)
local right_match = line[2].text and strfind(strupper(line[2].text), strupper(pattern), 1, true)
return left_match or right_match
end)
function public.tooltip_match(pattern, tooltip)
return Aux.util.any(tooltip, function(line)
local left_match = line[1].text and strupper(line[1].text) == strupper(pattern)
local right_match = line[2].text and strupper(line[2].text) == strupper(pattern)
return left_match or right_match
end)
end
@@ -299,4 +297,4 @@ function public.item(item_id, suffix_id, unique_id, enchant_id)
subclass = subclass,
max_stack = max_stack,
}
end
end