mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
add config/defaults.toml
This commit is contained in:
parent
de00414456
commit
04e490c896
9 changed files with 21 additions and 16 deletions
|
|
@ -173,12 +173,6 @@ static int l_quit(lua::State*) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
/// @brief Get the default world generator
|
||||
/// @return The ID of the default world generator
|
||||
static int l_get_default_generator(lua::State* L) {
|
||||
return lua::pushstring(L, WorldGenerator::DEFAULT);
|
||||
}
|
||||
|
||||
const luaL_Reg corelib[] = {
|
||||
{"new_world", lua::wrap<l_new_world>},
|
||||
{"open_world", lua::wrap<l_open_world>},
|
||||
|
|
@ -191,5 +185,4 @@ const luaL_Reg corelib[] = {
|
|||
{"str_setting", lua::wrap<l_str_setting>},
|
||||
{"get_setting_info", lua::wrap<l_get_setting_info>},
|
||||
{"quit", lua::wrap<l_quit>},
|
||||
{"get_default_generator", lua::wrap<l_get_default_generator>},
|
||||
{NULL, NULL}};
|
||||
|
|
|
|||
|
|
@ -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}};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue