autocomplete of item names and exact match in buy tab

This commit is contained in:
Manuel Simon Hirsig
2015-09-27 15:16:16 +02:00
parent ffa66d9d03
commit 87d434aa4a
4 changed files with 24 additions and 5 deletions
+12 -1
View File
@@ -8,5 +8,16 @@ function Aux.util.iter(array)
end
end
function Aux.util.dummy()
function Aux.util.item_name_autocomplete()
local text = this:GetText()
local textlen = strlen(text)
local name
for item_id=1,40000 do
name = GetItemInfo(item_id)
if name and strfind(strupper(name), '^' .. strupper(text)) then
this:SetText(name)
this:HighlightText(textlen, -1)
return
end
end
end