mirror of
				https://github.com/sys4-fr/server-nalc.git
				synced 2025-10-30 20:15:33 +01:00 
			
		
		
		
	[unified_inventory] Don't leave on enter
- Fix #535 - Thanks for @crabman77 for pointing out the code, and @minetest-technic team for making the original changes - Add the necessary flag in the formspec generator code so that we do not leave the formspec upon pressing enter
This commit is contained in:
		| @@ -164,7 +164,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields) | ||||
| 		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.set_inventory_formspec(player, | ||||
| 				unified_inventory.current_page[player_name]) | ||||
|   | ||||
| @@ -189,6 +189,8 @@ function unified_inventory.get_formspec(player, page) | ||||
| 	n = n+1 | ||||
|  | ||||
| 	-- Search box | ||||
| 	formspec[n] = "field_close_on_enter[searchbox;false]" | ||||
| 	n = n+1 | ||||
|  | ||||
| 	if not draw_lite_mode then | ||||
| 		formspec[n] = "field[9.5,8.325;3,1;searchbox;;" | ||||
|   | ||||
		Reference in New Issue
	
	Block a user