add settings
This commit is contained in:
parent
458bfc24fc
commit
d65fcf565f
10
init.lua
10
init.lua
@ -1,5 +1,13 @@
|
||||
local MP = minetest.get_modpath("mtinfo")
|
||||
|
||||
local mtinfo_enabled = minetest.settings:get_bool("mtinfo.enabled")
|
||||
local autoshutdown = minetest.settings:get_bool("mtinfo.autoshutdown")
|
||||
|
||||
if not mtinfo_enabled then
|
||||
-- skip everything
|
||||
return
|
||||
end
|
||||
|
||||
mtinfo = {
|
||||
basepath = minetest.get_worldpath() .. "/mtinfo",
|
||||
settings = {
|
||||
@ -46,7 +54,7 @@ minetest.register_on_mods_loaded(function()
|
||||
local diff = minetest.get_us_time() - start
|
||||
print("[mtinfo] export took " .. diff .. " us")
|
||||
|
||||
if minetest.settings:get_bool("mtinfo.autoshutdown") then
|
||||
if autoshutdown then
|
||||
minetest.request_shutdown("autoshutdown")
|
||||
end
|
||||
end)
|
||||
|
@ -27,6 +27,11 @@ Generates a static info-page about the world, stats include:
|
||||
* Start the world
|
||||
* Open the generated `index.html` in the world-folder `mtinfo` with a web-browser
|
||||
|
||||
## Settings
|
||||
|
||||
* **mtinfo.enabled** Enables the info-page generation (default `false`)
|
||||
* **mtinfo.autoshutdown** Shuts down after info-page generation (default `false`)
|
||||
|
||||
# Contributors
|
||||
|
||||
* https://github.com/BuckarooBanzay
|
||||
|
@ -1,3 +1,4 @@
|
||||
|
||||
# shutdown after generating
|
||||
mtinfo.autoshutdown = true
|
||||
mtinfo.enabled = true
|
Loading…
x
Reference in New Issue
Block a user