forked from minetest-mods/mesecons
f977ac821a
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
11 lines
385 B
Lua
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
|