mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Settings: Add get_flags API for mapgen flags (mg_flags, mgv6_spflags, ...) (#9284)
Unified flags handling in C++ and Lua Settings API -> Reading only, for now. Writing can be implemented later, if needed. API function to read the currently active flags -> was impossible from Lua Co-authored-by: Wuzzy <wuzzy2@mail.ru>
This commit is contained in:
parent
9cb3219f34
commit
cde2a7f6f2
23 changed files with 222 additions and 39 deletions
|
@ -129,7 +129,7 @@ void MapgenV5Params::readParams(const Settings *settings)
|
|||
|
||||
void MapgenV5Params::writeParams(Settings *settings) const
|
||||
{
|
||||
settings->setFlagStr("mgv5_spflags", spflags, flagdesc_mapgen_v5, U32_MAX);
|
||||
settings->setFlagStr("mgv5_spflags", spflags, flagdesc_mapgen_v5);
|
||||
settings->setFloat("mgv5_cave_width", cave_width);
|
||||
settings->setS16("mgv5_large_cave_depth", large_cave_depth);
|
||||
settings->setU16("mgv5_small_cave_num_min", small_cave_num_min);
|
||||
|
@ -154,6 +154,15 @@ void MapgenV5Params::writeParams(Settings *settings) const
|
|||
}
|
||||
|
||||
|
||||
void MapgenV5Params::setDefaultSettings(Settings *settings)
|
||||
{
|
||||
settings->setDefault("mgv5_spflags", flagdesc_mapgen_v5, MGV5_CAVERNS);
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
int MapgenV5::getSpawnLevelAtPoint(v2s16 p)
|
||||
{
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue