Allow to show itemstring

master
Wuzzy 2016-11-03 04:03:07 +01:00
parent 1be13bdefd
commit f6d658a830
2 changed files with 23 additions and 0 deletions

View File

@ -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

View File

@ -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