From f6d658a830f3f668204a31f3d048c31a777fb15b Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 3 Nov 2016 04:03:07 +0100 Subject: Allow to show itemstring --- init.lua | 19 +++++++++++++++++++ settingtypes.txt | 4 ++++ 2 files changed, 23 insertions(+) diff --git a/init.lua b/init.lua index 8412174..7c28ef9 100644 --- a/init.lua +++ b/init.lua @@ -24,6 +24,10 @@ local setting = minetest.setting_getbool("doc_items_friendly_group_names") if setting ~= nil then doc.sub.items.settings.friendly_group_names = setting end +setting = minetest.setting_getbool("doc_items_show_itemstrings") +if setting ~= nil then + doc.sub.items.settings.itemstring = setting +end -- Local stuff local groupdefs = {} @@ -720,6 +724,11 @@ doc.new_category("nodes", { datastring = newline2(datastring) datastring = datastring .. fuel_factoid(data.itemstring, "nodes") + if doc.sub.items.settings.itemstring ~= nil then + datastring = newline2(datastring) + datastring = datastring .. string.format(S("Itemstring: \"%s\""), data.itemstring) + end + formstring = formstring .. doc.widgets.text(datastring, 0, 0.5, 10.8, 8) return formstring @@ -791,6 +800,11 @@ doc.new_category("tools", { datastring = newline2(datastring) datastring = datastring .. fuel_factoid(data.itemstring, "tools") + if doc.sub.items.settings.itemstring ~= nil then + datastring = newline2(datastring) + datastring = datastring .. string.format(S("Itemstring: \"%s\""), data.itemstring) + end + formstring = formstring .. doc.widgets.text(datastring, 0, 0.5, 10.8, 8) return formstring @@ -854,6 +868,11 @@ doc.new_category("craftitems", { datastring = newline2(datastring) datastring = datastring .. fuel_factoid(data.itemstring, "craftitems") + if doc.sub.items.settings.itemstring ~= nil then + datastring = newline2(datastring) + datastring = datastring .. string.format(S("Itemstring: \"%s\""), data.itemstring) + end + formstring = formstring .. doc.widgets.text(datastring, 0, 0.5, 10.8, 8) return formstring diff --git a/settingtypes.txt b/settingtypes.txt index ca1adcd..83f940a 100644 --- a/settingtypes.txt +++ b/settingtypes.txt @@ -7,3 +7,7 @@ #understanding, they are not official. #This feature might be removed in later versions if it becomes obsolete. doc_items_friendly_group_names (Show “friendly” group names) bool false + +#If enabled, the mod will show the itemstring of the entry for each item. +#This is mostly for programmers and power users. +doc_items_show_itemstrings (Show itemstrings) bool false -- cgit v1.2.3