diff --git a/src/types.cc b/src/types.cc index 29d341a..14e115a 100644 --- a/src/types.cc +++ b/src/types.cc @@ -1214,6 +1214,15 @@ namespace ProjectionReg{ namespace ConfigReg { using T = Config; + int raw_make(lua_State *L) { + an config = New(); + if (auto cstr = lua_tostring(L, 1)) { + config->LoadFromFile(path(cstr)); + } + LuaType>::pushdata(L, config); + return 1; + } + optional get_bool(T &t, const string &path) { bool v; if (t.GetBool(path, &v)) @@ -1280,6 +1289,7 @@ namespace ConfigReg { } static const luaL_Reg funcs[] = { + { "Config", (raw_make)}, { NULL, NULL }, };