diff options
author | orwell96 <mono96.mml@gmail.com> | 2017-01-18 17:50:40 +0100 |
---|---|---|
committer | orwell96 <mono96.mml@gmail.com> | 2017-01-18 17:50:40 +0100 |
commit | d73289237e91acb6a55f3b4408649e1076b05a3b (patch) | |
tree | a46d9221337c10b4ded0d98832a15ee216964b94 | |
parent | 4bc5163787c6c4c42fd14016c1c5103529d0e239 (diff) | |
download | advtrains-d73289237e91acb6a55f3b4408649e1076b05a3b.tar.gz advtrains-d73289237e91acb6a55f3b4408649e1076b05a3b.tar.bz2 advtrains-d73289237e91acb6a55f3b4408649e1076b05a3b.zip |
Make 'print debug messages' a setting
-rw-r--r-- | advtrains/advtrains/init.lua | 6 | ||||
-rw-r--r-- | advtrains/advtrains/settingtypes.txt | 2 |
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 |