From 1ba1e41dcd89576208570bea82e3d6b6c982e1ed Mon Sep 17 00:00:00 2001 From: Jean-Patrick Guerrero Date: Mon, 11 Feb 2019 00:30:06 +0100 Subject: [PATCH] Progressive: Add a better error message for empty items list --- init.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/init.lua b/init.lua index 6986265..3000398 100644 --- a/init.lua +++ b/init.lua @@ -520,10 +520,15 @@ local function make_formspec(name) fs[#fs + 1] = "field[0.3,0.32;2.5,1;filter;;" .. fs_esc(data.filter) .. "]" if #data.items == 0 then - fs[#fs + 1] = fmt(fmt_label, - (data.iX / 2) - 1, - 2, - fs_esc(S("No item to show"))) + local no_item = S("No item to show") + local pos = (data.iX / 2) - 1 + + if next(recipe_filters) and #init_items > 0 and data.filter == "" then + no_item = S("Collect items to reveal more recipes") + pos = pos - 1 + end + + fs[#fs + 1] = fmt(fmt_label, pos, 2, fs_esc(no_item)) end local first_item = (data.pagenum - 1) * ipp