mirror of
https://github.com/minetest-mods/digtron.git
synced 2024-12-22 20:32:22 +01:00
Fixed deprecated calls.
This commit is contained in:
parent
2b84b4a3da
commit
f2826937ba
10
config.lua
10
config.lua
@ -7,20 +7,20 @@ local print_settingtypes = false
|
|||||||
local function setting(stype, name, default, description)
|
local function setting(stype, name, default, description)
|
||||||
local value
|
local value
|
||||||
if stype == "bool" then
|
if stype == "bool" then
|
||||||
value = minetest.setting_getbool(CONFIG_FILE_PREFIX..name)
|
value = minetest.settings:get_bool(CONFIG_FILE_PREFIX..name)
|
||||||
elseif stype == "string" then
|
elseif stype == "string" then
|
||||||
value = minetest.setting_get(CONFIG_FILE_PREFIX..name)
|
value = minetest.settings:get(CONFIG_FILE_PREFIX..name)
|
||||||
elseif stype == "int" or stype == "float" then
|
elseif stype == "int" or stype == "float" then
|
||||||
value = tonumber(minetest.setting_get(CONFIG_FILE_PREFIX..name))
|
value = tonumber(minetest.settings:get(CONFIG_FILE_PREFIX..name))
|
||||||
end
|
end
|
||||||
if value == nil then
|
if value == nil then
|
||||||
value = default
|
value = default
|
||||||
end
|
end
|
||||||
digtron.config[name] = value
|
digtron.config[name] = value
|
||||||
|
|
||||||
if print_settingtypes then
|
if print_settingtypes then
|
||||||
minetest.debug(CONFIG_FILE_PREFIX..name.." ("..description..") "..stype.." "..tostring(default))
|
minetest.debug(CONFIG_FILE_PREFIX..name.." ("..description..") "..stype.." "..tostring(default))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
setting("bool", "uses_resources", true, "Digtron uses resources when active")
|
setting("bool", "uses_resources", true, "Digtron uses resources when active")
|
||||||
|
Loading…
Reference in New Issue
Block a user