summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-11-03 04:03:07 +0100
committerWuzzy <almikes@aol.com>2016-11-03 04:03:07 +0100
commitf6d658a830f3f668204a31f3d048c31a777fb15b (patch)
treea38c5a809b7db6e1fa8d37b6a083d6ab62ef8974
parent1be13bdefd002cc12852ecfb959218d1af5c6bfd (diff)
Allow to show itemstring
-rw-r--r--init.lua19
-rw-r--r--settingtypes.txt4
2 files changed, 23 insertions, 0 deletions
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