diff options
author | kilbith <kilbith@users.noreply.github.com> | 2016-02-22 14:01:40 +0100 |
---|---|---|
committer | kilbith <kilbith@users.noreply.github.com> | 2016-02-22 14:01:40 +0100 |
commit | bbd687b77ba37cf311158c1be8767913de719ba8 (patch) | |
tree | 3d587eeb7c8bc54fc9dfbcbc766a6f26d9c6e005 | |
parent | a3aac0b3c6d02b57addcec93591683532d898d87 (diff) |
Revert "Search using [?] button or pressing <Return>"origin/revert-2-patch-2
-rw-r--r-- | init.lua | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -116,26 +116,23 @@ minetest.register_on_player_receive_fields(function(player, listname, fields) if fields.clear then craftguide:get_items(nil, player_name) craftguide:get_formspec(stack, 1, nil, 1, "", player_name) - return elseif fields.alternate then local item = formspec:match("item_image_button%[.*;([%w_:]+);.*%]") or 1 local recipe_num = tonumber(formspec:match("Recipe%s(%d+)")) or 1 recipe_num = recipe_num + 1 craftguide:get_formspec(stack, pagenum, item, recipe_num, filter, player_name) - return + elseif fields.search then + craftguide:get_items(fields.filter:lower(), player_name) + craftguide:get_formspec(stack, 1, nil, 1, fields.filter:lower(), player_name) elseif fields.prev or fields.next then if fields.prev then pagenum = pagenum - 1 else pagenum = pagenum + 1 end craftguide:get_formspec(stack, pagenum, nil, 1, filter, player_name) - return - elseif fields.search or fields.filter then - craftguide:get_items(fields.filter:lower(), player_name) - craftguide:get_formspec(stack, 1, nil, 1, fields.filter:lower(), player_name) - end - for item in pairs(fields) do + else for item in pairs(fields) do if minetest.get_craft_recipe(item).items then craftguide:get_formspec(stack, pagenum, item, 1, filter, player_name) end + end end end) |