mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-01 17:38:41 +00:00
Settings: Proper priority hierarchy
Remove old defaults system Introduce priority-based fallback list Use new functions for map_meta special functions Change groups to use end tags Unittest changes: * Adapt unittest to the new code * Compare Settings objects
This commit is contained in:
parent
5e9dd1667b
commit
37a05ec8d6
21 changed files with 358 additions and 298 deletions
|
@ -982,7 +982,7 @@ int ModApiMapgen::l_set_noiseparams(lua_State *L)
|
|||
|
||||
bool set_default = !lua_isboolean(L, 3) || readParam<bool>(L, 3);
|
||||
|
||||
g_settings->setNoiseParams(name, np, set_default);
|
||||
Settings::getLayer(set_default ? SL_DEFAULTS : SL_GLOBAL)->setNoiseParams(name, np);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ int LuaSettings::l_set_np_group(lua_State *L)
|
|||
|
||||
SET_SECURITY_CHECK(L, key);
|
||||
|
||||
o->m_settings->setNoiseParams(key, value, false);
|
||||
o->m_settings->setNoiseParams(key, value);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ with this program; if not, write to the Free Software Foundation, Inc.,
|
|||
extern "C" {
|
||||
#include "lualib.h"
|
||||
}
|
||||
|
||||
#include "settings.h"
|
||||
#define MAINMENU_NUM_ASYNC_THREADS 4
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue