fixed search again
This commit is contained in:
parent
040bc5a266
commit
352aba2786
@ -381,6 +381,7 @@ local function crafting_callback(state)
|
||||
local search_string = state:get("search"):getText()
|
||||
if search_string ~= "" and search_string ~= state.param.survival_search_string then
|
||||
local filtered_list = ui_tools.search_in_list(cache.get_revealed_items(player), search_string, player)
|
||||
state.param.survival_search_string = search_string
|
||||
state.param.crafting_grouped_items = cache.get_list_grouped(filtered_list)
|
||||
update_group_selection(state, true)
|
||||
end
|
||||
|
@ -115,9 +115,10 @@ local function creative_callback(state)
|
||||
state:onInput(function(state, fields, player)
|
||||
local search_string = state:get("search"):getText()
|
||||
if search_string ~= (state.param.creative_search_string or "") then
|
||||
local filtered_list = ui_tools.search_in_list(state.param.creative_grouped_items_all, search_string, player)
|
||||
local filtered_list = ui_tools.search_in_list(state.param.creative_grouped_items_all, search_string)
|
||||
state.param.creative_grouped_items = cache.get_list_grouped(filtered_list)
|
||||
filtered_list = ui_tools.search_in_list(state.param.creative_grouped_items_material_all, search_string, player)
|
||||
filtered_list = ui_tools.search_in_list(state.param.creative_grouped_items_material_all, search_string)
|
||||
state.param.creative_search_string = search_string
|
||||
state.param.creative_grouped_material_items = filtered_list
|
||||
update_group_selection(state, 0)
|
||||
end
|
||||
|
@ -107,7 +107,7 @@ function ui_tools.search_in_list(list, search_string, playername)
|
||||
end
|
||||
end
|
||||
end
|
||||
if smart_inventory.doc_items_mod then
|
||||
if smart_inventory.doc_items_mod and playername then
|
||||
for _, entry in ipairs(filtered_list) do
|
||||
if entry.recipes then
|
||||
local valid_recipes = {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user