summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWuzzy <almikes@aol.com>2016-08-05 02:43:12 +0200
committerWuzzy <almikes@aol.com>2016-08-05 02:43:12 +0200
commit0dcfcba9269f5eec9d59c7b2877f35cc0a4aca7f (patch)
treeec38269d6fba79c219bbbd71ba66b91557ecd8a2
parent82b77ebc0ff07c92e133c054a50d46a8b99f5395 (diff)
Move yesno function to top hierarchy
-rw-r--r--init.lua25
1 files changed, 7 insertions, 18 deletions
diff --git a/init.lua b/init.lua
index 38609e5..1e14158 100644
--- a/init.lua
+++ b/init.lua
@@ -22,6 +22,13 @@ local item_name_overrides = {
}
-- Helper functions
+local yesno = function(bool)
+ if bool==true then return "Yes"
+ elseif bool==false then return "No"
+ else return "N/A" end
+end
+
+
local groups_to_string = function(grouptable, filter)
local gstring = ""
local groups_count = 0
@@ -204,12 +211,6 @@ doc.new_category("nodes", {
formstring = formstring .. "\n"
- local yesno = function(bool)
- if bool==true then return "Yes"
- elseif bool==false then return "No"
- else return "N/A" end
- end
-
formstring = formstring .. "Collidable: "..yesno(data.def.walkable).. "\n"
local liquid
if data.def.liquidtype ~= "none" then liquid = true else liquid = false end
@@ -536,12 +537,6 @@ doc.new_category("tools", {
formstring = formstring .. "Maximum stack size: "..data.def.stack_max.. "\n"
end
- local yesno = function(bool)
- if bool==true then return "Yes"
- elseif bool==false then return "No"
- else return "N/A" end
- end
-
formstring = formstring .. range_factoid(data.itemstring, data.def) .. "\n"
formstring = formstring .. "\n"
@@ -595,12 +590,6 @@ doc.new_category("craftitems", {
end
formstring = formstring .. "Maximum stack size: "..data.def.stack_max.. "\n"
- local yesno = function(bool)
- if bool==true then return "Yes"
- elseif bool==false then return "No"
- else return "N/A" end
- end
-
formstring = formstring .. range_factoid(data.itemstring, data.def) .. "\n"
formstring = formstring .. "\n"