add config/defaults.toml

This commit is contained in:
MihailRis
2024-10-14 02:56:33 +03:00
parent de00414456
commit 04e490c896
9 changed files with 21 additions and 16 deletions
@@ -62,8 +62,18 @@ static int l_get_generators(lua::State* L) {
return 1;
}
/// @brief Get the default world generator
/// @return The ID of the default world generator
static int l_get_default_generator(lua::State* L) {
auto combined = engine->getResPaths()->readCombinedObject(
EnginePaths::CONFIG_DEFAULTS.u8string()
);
return lua::pushstring(L, combined["generator"].asString());
}
const luaL_Reg generationlib[] = {
{"save_structure", lua::wrap<l_save_structure>},
{"load_structure", lua::wrap<l_load_structure>},
{"get_generators", lua::wrap<l_get_generators>},
{"get_default_generator", lua::wrap<l_get_default_generator>},
{NULL, NULL}};