Move configuration to in-game settings

This commit is contained in:
2025-04-29 10:14:20 +02:00
parent 63960f3de1
commit 9b57098fca
17 changed files with 36 additions and 28 deletions

View File

@@ -19,9 +19,11 @@ local modpath=minetest.get_modpath("industrialtest")
-- table with global functions, variables etc
industrialtest={}
-- Initial constants
industrialtest.updateDelay=1 -- Note: Make this value smaller to make machines update more frequently (it may make server more laggy)
industrialtest.developerMode=true -- Enables additional utils useful when developing mod
-- Settings
industrialtest.config={
updateDelay=minetest.settings:get("industrialtest.updateDelay") or 1,
developerMode=minetest.settings:get_bool("industrialtest.developerMode",false)
}
-- Others
industrialtest.random=PseudoRandom(os.time())
@@ -92,7 +94,7 @@ dofile(modpath.."/tools/wrench.lua")
dofile(modpath.."/upgrades.lua")
dofile(modpath.."/craftitems.lua")
dofile(modpath.."/nodes.lua")
if industrialtest.developerMode then
if industrialtest.config.developerMode then
dofile(modpath.."/utils.lua")
end
dofile(modpath.."/cables.lua")