Basic groundwork (logger, load settings)

master
octacian 2017-02-04 16:14:47 -08:00
parent 15b91afb54
commit 72c7788e95
3 changed files with 24 additions and 1 deletions

View File

@ -3,6 +3,8 @@ Debug Tools for Mod Developers [debugger]
This is meant to be a simple tool for developers to use while attempting to debug issues in mods. See below for planned features. This README will be updated as features are added.
Future tools and/or buttons are hidden from the creative inventory by default. To allow access in creative rather than just via `/giveme`, set `not_in_creative` to `0` in the `config.txt`.
### Planned Features
* Meta/Inv Editor
* Run Lua Code Under Environment (server won't crash)

View File

@ -1 +1 @@
not_in_creative_inventory = 1
not_in_creative = 1

View File

@ -1 +1,22 @@
-- debugger/init.lua
debugger = {}
debugger.modpath = minetest.get_modpath("debugger")
local modpath = debugger.modpath
-- Logger
function debugger.log(content, log_type)
assert(content, "debugger.log: content nil")
if log_type == nil then log_type = "action" end
minetest.log(log_type, "[debugger] "..content)
end
-- Load Settings
local Settings = Settings(modpath.."/config.txt"):to_table()
if Settings then
debugger.CREATIVE = Settings.not_in_creative or 1
else
debugger.CREATIVE = 1
end