diff options
author | Wuzzy <almikes@aol.com> | 2016-11-03 02:39:30 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-11-03 02:39:30 +0100 |
commit | 825d0cd20ea1a6f4302214782d4e8437d0ef411c (patch) | |
tree | b86c05234b3833ae40e8cd40a5e04a34fdb1a6ef /init.lua | |
parent | 6bb96be16e87621b56371f087d6551b40620b4f7 (diff) |
Make group name rendering a setting
Diffstat (limited to 'init.lua')
-rw-r--r-- | init.lua | 15 |
1 files changed, 13 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 |