mirror of
https://gitlab.com/4w/mtimer.git
synced 2024-11-25 00:33:47 +01:00
15 lines
451 B
Lua
15 lines
451 B
Lua
local path = minetest.get_modpath(minetest.get_current_modname())
|
|
local file = io.open(path..DIR_DELIM..'settingtypes.txt', 'rb')
|
|
local result = {}
|
|
|
|
for line in file:lines() do
|
|
if line:match("^([a-zA-Z])") then
|
|
local name = line:gsub(' .+', '')
|
|
local default_value = line:gsub('^[^ ]+ %b() %a+ ', '')
|
|
local set_value = minetest.setting_get(name)
|
|
result[name] = set_value or default_value
|
|
end
|
|
end
|
|
|
|
return result
|