From a8587b670a92c57fd277091dc0d208ca6ddafe0b Mon Sep 17 00:00:00 2001 From: Vitaliy Olkhin Date: Mon, 28 Oct 2024 16:35:16 +0500 Subject: [PATCH] added debug enable setting --- function.lua | 5 ++++- init.lua | 3 ++- settingtypes.txt | 1 + 3 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 settingtypes.txt diff --git a/function.lua b/function.lua index eb193fd..a15eaba 100644 --- a/function.lua +++ b/function.lua @@ -23,7 +23,10 @@ surface_effect.setHud = function(player) id_mask = false, id_status_chemical = false, } - minetest.log("action", "Load nplayer: " .. surface_effect.dump(surface_effect.nplayer)) + + if surface_effect.debug then + minetest.log("action", "Load nplayer: " .. surface_effect.dump(surface_effect.nplayer)) + end end end diff --git a/init.lua b/init.lua index 37de52f..26d298e 100644 --- a/init.lua +++ b/init.lua @@ -1,6 +1,7 @@ su = {} surface_effect = { - nplayer = {} + nplayer = {}, + debug = minetest.settings:get_bool('surface_effect.debug') or false } local timer = 0 diff --git a/settingtypes.txt b/settingtypes.txt new file mode 100644 index 0000000..b95bcc1 --- /dev/null +++ b/settingtypes.txt @@ -0,0 +1 @@ +surface_effect.debug (debug) bool false \ No newline at end of file