mesecons/mesecons/settings.lua
Jeija f977ac821a Re-implement settings system:
Settings can now be retrieved by mesecon.setting(<name>, <default>) and can be modified without
editing the source code by adding the setting to minetest.conf
For instance, you can add mesecon.blinky_plant_interval = 0.5 to minetest.conf in order to
increase the blinking speed.
Rewrite the blinky plant with nodetimers.
Fixes #161
2014-11-22 22:09:26 +01:00

11 lines
385 B
Lua

-- SETTINGS
function mesecon.setting(setting, default)
if type(default) == "bool" then
return minetest.setting_getbool("mesecon."..setting) or default
elseif type(default) == "string" then
return minetest.setting_get("mesecon."..setting) or default
elseif type(default) == "number" then
return tonumber(minetest.setting_get("mesecon."..setting) or default)
end
end