summaryrefslogtreecommitdiff
path: root/mesecons/settings.lua
blob: 1ebbfde4004ad78f192655f5b2f58f1e296167e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
-- SETTINGS
function mesecon.setting(setting, default)
	if type(default) == "boolean" then
		local read = minetest.setting_getbool("mesecon."..setting)
		if read == nil then
			return default
		else
			return read
		end
	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