mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-12-29 04:00:24 +01:00
Search items by English and translated description (#156)
This works only with Minetest version >= 5.3.0, nothing is changed for older versions.
This commit is contained in:
parent
d86592841e
commit
341a438267
@ -290,10 +290,14 @@ function unified_inventory.apply_filter(player, filter, search_dir)
|
||||
return true
|
||||
end
|
||||
else
|
||||
local lang = minetest.get_player_information(player_name).lang_code
|
||||
ffilter = function(name, def)
|
||||
local lname = string.lower(name)
|
||||
local ldesc = string.lower(def.description)
|
||||
local llocaldesc = minetest.get_translated_string
|
||||
and string.lower(minetest.get_translated_string(lang, def.description))
|
||||
return string.find(lname, lfilter, 1, true) or string.find(ldesc, lfilter, 1, true)
|
||||
or llocaldesc and string.find(llocaldesc, lfilter, 1, true)
|
||||
end
|
||||
end
|
||||
unified_inventory.filtered_items_list[player_name]={}
|
||||
|
Loading…
Reference in New Issue
Block a user