summaryrefslogtreecommitdiff
path: root/callbacks.lua
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-06 23:31:53 +0200
committerWuzzy <almikes@aol.com>2016-08-14 23:35:12 +0200
commit2a516ac22b2ee4381404870950492be83d7ebe5e (patch)
tree367aff6d30610d974bc9ffd8719a35329cf2beae /callbacks.lua
parentdba69b1f7116bdb0f4c9be3dafd411db757e14ec (diff)
Add seperate button for resetting search
Diffstat (limited to 'callbacks.lua')
-rw-r--r--callbacks.lua8
1 files changed, 7 insertions, 1 deletions
diff --git a/callbacks.lua b/callbacks.lua
index e86cac6..be5c055 100644
--- a/callbacks.lua
+++ b/callbacks.lua
@@ -153,11 +153,17 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
if fields.searchbutton then
unified_inventory.apply_filter(player, unified_inventory.current_searchbox[player_name], "nochange")
- unified_inventory.current_searchbox[player_name] = ""
unified_inventory.set_inventory_formspec(player,
unified_inventory.current_page[player_name])
minetest.sound_play("paperflip2",
{to_player=player_name, gain = 1.0})
+ elseif fields.searchresetbutton then
+ unified_inventory.apply_filter(player, "", "nochange")
+ unified_inventory.current_searchbox[player_name] = ""
+ unified_inventory.set_inventory_formspec(player,
+ unified_inventory.current_page[player_name])
+ minetest.sound_play("click",
+ {to_player=player_name, gain = 0.1})
end
-- alternate buttons