diff options
-rw-r--r-- | init.lua | 15 | ||||
-rw-r--r-- | settingtypes.txt | 9 |
2 files changed, 22 insertions, 2 deletions
@@ -18,6 +18,13 @@ doc.sub.items.temp.craftitem = S("This item is primarily used for crafting other doc.sub.items.temp.eat = S("Hold it in your hand, then leftclick to eat it.") doc.sub.items.temp.eat_bad = S("Hold it in your hand, then leftclick to eat it. But why would you want to do this?") +doc.sub.items.settings = {} +doc.sub.items.settings.friendly_group_names = false +local setting = minetest.setting_getbool("doc_items_friendly_group_names") +if setting ~= nil then + doc.sub.items.settings.friendly_group_names = setting +end + -- Local stuff local groupdefs = {} local mininggroups = {} @@ -49,7 +56,11 @@ local groups_to_string = function(grouptable, filter) -- List seperator gstring = gstring .. S(", ") end - gstring = gstring .. groupdefs[id] + if groupdefs[id] ~= nil and doc.sub.items.settings.friendly_group_names == true then + gstring = gstring .. groupdefs[id] + else + gstring = gstring .. id + end groups_count = groups_count + 1 end end @@ -99,7 +110,7 @@ local description_for_formspec = function(itemstring) end local group_to_string = function(groupname) - if groupdefs[groupname] ~= nil then + if groupdefs[groupname] ~= nil and doc.sub.items.settings.friendly_group_names == true then return groupdefs[groupname] else return groupname diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..ca1adcd --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1,9 @@ +#This feature is experimental! +#If enabled, the mod will show alternative group names which are a bit +#more readable than the internally used (but canonical) group names. For +#example, the group “wood” may be rendered as “Wood”, “leaves” as +#“Leaves and Needles”, “oddly_breakable_by_hand” as “Hand-breakable”, +#and so on. Note that these alternative names are only used for better +#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 |