Make 'print debug messages' a setting

This commit is contained in:
orwell96 2017-01-18 17:50:40 +01:00
parent 4bc5163787
commit d73289237e
2 changed files with 6 additions and 2 deletions

View File

@ -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");

View File

@ -0,0 +1,2 @@
# Whether to print debug information on advtrains to chat and debug.txt
advtrains_debug (Print advtrains debug messages) bool false