mirror of
https://github.com/appgurueu/modlib.git
synced 2024-11-22 15:23:48 +01:00
mod.configuration: Return schema
This commit is contained in:
parent
aef7ad5e6e
commit
9d221a890d
@ -66,6 +66,7 @@ function extend_string(modname, string)
|
|||||||
include_env(string, rawget(_G, modname), true)
|
include_env(string, rawget(_G, modname), true)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
--> conf, schema
|
||||||
function configuration(modname)
|
function configuration(modname)
|
||||||
modname = modname or minetest.get_current_modname()
|
modname = modname or minetest.get_current_modname()
|
||||||
local schema = modlib.schema.new(assert(include(modname, "schema.lua")))
|
local schema = modlib.schema.new(assert(include(modname, "schema.lua")))
|
||||||
@ -141,9 +142,9 @@ function configuration(modname)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
if conf == nil then
|
if conf == nil then
|
||||||
return schema:load({}, {error_message = true})
|
return schema:load({}, {error_message = true}), schema
|
||||||
end
|
end
|
||||||
return conf
|
return conf, schema
|
||||||
end
|
end
|
||||||
|
|
||||||
-- Export environment
|
-- Export environment
|
||||||
|
Loading…
Reference in New Issue
Block a user