2016-02-15 23:05:21 +01:00
|
|
|
-- SETTINGS
|
|
|
|
function mesecon.setting(setting, default)
|
|
|
|
if type(default) == "boolean" then
|
2017-05-13 08:08:05 +02:00
|
|
|
local read = minetest.settings:get_bool("mesecon."..setting)
|
2016-02-15 23:05:21 +01:00
|
|
|
if read == nil then
|
|
|
|
return default
|
|
|
|
else
|
|
|
|
return read
|
|
|
|
end
|
|
|
|
elseif type(default) == "string" then
|
2017-05-13 08:08:05 +02:00
|
|
|
return minetest.settings:get("mesecon."..setting) or default
|
2016-02-15 23:05:21 +01:00
|
|
|
elseif type(default) == "number" then
|
2017-05-13 08:08:05 +02:00
|
|
|
return tonumber(minetest.settings:get("mesecon."..setting) or default)
|
2016-02-15 23:05:21 +01:00
|
|
|
end
|
|
|
|
end
|