From 621b998c5a1e6c779d0cff35e99aa93437ef9bf2 Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Mon, 15 Aug 2016 19:01:21 +0200 Subject: Add minimal support for hidden entries --- init.lua | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/init.lua b/init.lua index 47193ab..5e6d799 100644 --- a/init.lua +++ b/init.lua @@ -766,15 +766,20 @@ local function gather_descs() else name = def.description end - if not (name == nil or name == "" or def.groups.not_in_creative_inventory or def.groups.not_in_doc or forced_items[id] == false) or forced then + if not (name == nil or name == "" or def.groups.not_in_doc or forced_items[id] == false) or forced then if help.longdesc[id] ~= nil then ld = help.longdesc[id] end if help.usagehelp[id] ~= nil then uh = help.usagehelp[id] end + local hide = false + if def.groups.not_in_creative_inventory ~= nil and not forced then + hide = true + end local infotable = { name = name, + hidden = hide, data = { longdesc = ld, usagehelp = uh, @@ -811,15 +816,20 @@ local function gather_descs() else name = def.description end - if not (name == nil or name == "" or def.groups.not_in_creative_inventory or def.groups.not_in_doc or forced_items[id] == false) or forced then + if not (name == nil or name == "" or def.groups.not_in_doc or forced_items[id] == false) or forced then if help.longdesc[id] ~= nil then ld = help.longdesc[id] end if help.usagehelp[id] ~= nil then uh = help.usagehelp[id] end + local hide = false + if def.groups.not_in_creative_inventory ~= nil and not forced then + hide = true + end local infotable = { name = name, + hidden = hide, data = { longdesc = ld, usagehelp = uh, @@ -842,15 +852,20 @@ local function gather_descs() else name = def.description end - if not (name == nil or name == "" or def.groups.not_in_creative_inventory or def.groups.not_in_doc or forced_items[id] == false) or forced then + if not (name == nil or name == "" or def.groups.not_in_doc or forced_items[id] == false) or forced then if help.longdesc[id] ~= nil then ld = help.longdesc[id] end if help.usagehelp[id] ~= nil then uh = help.usagehelp[id] end + local hide = false + if def.groups.not_in_creative_inventory ~= nil and not forced then + hide = true + end local infotable = { name = name, + hidden = hide, data = { longdesc = ld, usagehelp = uh, -- cgit v1.2.3