From c054915521fa1c66cdb990c6892499efa0a7ecfb Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Sun, 5 Feb 2017 22:53:08 +0100 Subject: [PATCH] Better grammar for group tooltips in craftguide --- mods/craftguide/init.lua | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/mods/craftguide/init.lua b/mods/craftguide/init.lua index 064dad7a..769f1c95 100644 --- a/mods/craftguide/init.lua +++ b/mods/craftguide/init.lua @@ -67,12 +67,17 @@ function craftguide:get_tooltip(item, recipe_type, cooktime, groups) return tooltip.."Unknown Item ("..item..")]" end if groups then - local groupstr = "Any item belonging to the " - for i=1, #groups do - groupstr = groupstr..colorize(groups[i]).. + local groupstr + if #groups == 1 then + groupstr = "Any item belonging to the " .. colorize(groups[1]) .. " group" + else + groupstr = "Any item belonging to the following groups: " + for i=1, #groups do + groupstr = groupstr .. colorize(groups[i]).. (groups[i+1] and " and " or "") + end end - tooltip = tooltip..groupstr.." group(s)" + tooltip = tooltip..groupstr end if recipe_type == "cooking" then tooltip = tooltip..item_desc.."\nCooking time: "..