diff options
author | Wuzzy <almikes@aol.com> | 2016-08-10 07:47:39 +0200 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-08-10 07:47:39 +0200 |
commit | 8ca3fae3589e73c90377eefabd01d9a2c89c3d10 (patch) | |
tree | 6b82b479f7999f1c3416ae1591d7d84bcab9ea45 /init.lua | |
parent | 21f5ddc650bb5f1faa2daa297fc25979f9652e02 (diff) |
Function: add_suppressed_item_entries
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -13,6 +13,7 @@ doc.sub.items.temp.eat_bad = "Hold it in your hand, then leftclick to eat it. Bu local groupdefs = {} local mininggroups = {} local miscgroups = {} +-- List of forcefully added (true) and hidden (false) items local forced_items = { ["air"] = true, } @@ -710,7 +711,7 @@ function doc.sub.items.add_notable_groups(groupnames) end end --- Add item which will be forced to be added to the item list, +-- Add items which will be forced to be added to the item list, -- even if the item is not in creative inventory function doc.sub.items.add_forced_item_entries(itemstrings) for i=1,#itemstrings do @@ -718,6 +719,13 @@ function doc.sub.items.add_forced_item_entries(itemstrings) end end +-- Add items which will be forced *not* to be added to the item list +function doc.sub.items.add_suppressed_item_entries(itemstrings) + for i=1,#itemstrings do + forced_items[itemstrings[i]] = false + end +end + -- Register a list of entry names where the entry name should differ -- from the original item description function doc.sub.items.add_item_name_overrides(itemstrings) @@ -748,7 +756,7 @@ 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 then + 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 help.longdesc[id] ~= nil then ld = help.longdesc[id] end @@ -793,7 +801,7 @@ 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 then + 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 help.longdesc[id] ~= nil then ld = help.longdesc[id] end @@ -824,7 +832,7 @@ 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 then + 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 help.longdesc[id] ~= nil then ld = help.longdesc[id] end |