mirror of
https://github.com/minetest-mods/unified_inventory.git
synced 2024-08-20 13:24:10 +02:00
Search when ENTER is pressed on the search field.
This commit is contained in:
parent
be00ffe913
commit
2ea417fad0
@ -154,7 +154,8 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
if fields.searchbutton then
|
if fields.searchbutton
|
||||||
|
or fields.key_enter_field == "searchbox" then
|
||||||
unified_inventory.apply_filter(player, unified_inventory.current_searchbox[player_name], "nochange")
|
unified_inventory.apply_filter(player, unified_inventory.current_searchbox[player_name], "nochange")
|
||||||
unified_inventory.set_inventory_formspec(player,
|
unified_inventory.set_inventory_formspec(player,
|
||||||
unified_inventory.current_page[player_name])
|
unified_inventory.current_page[player_name])
|
||||||
|
@ -182,6 +182,8 @@ function unified_inventory.get_formspec(player, page)
|
|||||||
n = n+1
|
n = n+1
|
||||||
|
|
||||||
-- Search box
|
-- Search box
|
||||||
|
formspec[n] = "field_close_on_enter[searchbox;false]"
|
||||||
|
n = n+1
|
||||||
|
|
||||||
if not draw_lite_mode then
|
if not draw_lite_mode then
|
||||||
formspec[n] = "field[9.5,8.325;3,1;searchbox;;"
|
formspec[n] = "field[9.5,8.325;3,1;searchbox;;"
|
||||||
|
Loading…
Reference in New Issue
Block a user