aboutsummaryrefslogtreecommitdiff
path: root/advtrains
diff options
context:
space:
mode:
authororwell96 <mono96.mml@gmail.com>2017-01-18 17:50:40 +0100
committerorwell96 <mono96.mml@gmail.com>2017-01-18 17:50:40 +0100
commitd73289237e91acb6a55f3b4408649e1076b05a3b (patch)
treea46d9221337c10b4ded0d98832a15ee216964b94 /advtrains
parent4bc5163787c6c4c42fd14016c1c5103529d0e239 (diff)
downloadadvtrains-d73289237e91acb6a55f3b4408649e1076b05a3b.tar.gz
advtrains-d73289237e91acb6a55f3b4408649e1076b05a3b.tar.bz2
advtrains-d73289237e91acb6a55f3b4408649e1076b05a3b.zip
Make 'print debug messages' a setting
Diffstat (limited to 'advtrains')
-rw-r--r--advtrains/advtrains/init.lua6
-rw-r--r--advtrains/advtrains/settingtypes.txt2
2 files changed, 6 insertions, 2 deletions
diff --git a/advtrains/advtrains/init.lua b/advtrains/advtrains/init.lua
index c8c4b56..11824f7 100644
--- a/advtrains/advtrains/init.lua
+++ b/advtrains/advtrains/init.lua
@@ -34,8 +34,10 @@ local function print_concat_table(a)
end
return str
end
---atprint=function() end
-atprint=function(t, ...) minetest.log("action", "[advtrains]"..print_concat_table({t, ...})) minetest.chat_send_all("[advtrains]"..print_concat_table({t, ...})) end
+atprint=function() end
+if minetest.setting_getbool("advtrains_debug") then
+ atprint=function(t, ...) minetest.log("action", "[advtrains]"..print_concat_table({t, ...})) minetest.chat_send_all("[advtrains]"..print_concat_table({t, ...})) end
+end
sid=function(id) return string.sub(id, -4) end
dofile(advtrains.modpath.."/helpers.lua");
diff --git a/advtrains/advtrains/settingtypes.txt b/advtrains/advtrains/settingtypes.txt
new file mode 100644
index 0000000..74a775e
--- /dev/null
+++ b/advtrains/advtrains/settingtypes.txt
@@ -0,0 +1,2 @@
+# Whether to print debug information on advtrains to chat and debug.txt
+advtrains_debug (Print advtrains debug messages) bool false \ No newline at end of file