1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Improvements/fixes for noise parameter input in advanced settings

Formspec input for each individual noise parameter and flag.
Allow noise flags to be set in advanced settings, previously only settable
in minetest.conf.

Standardise 'group format' for noise parameters set in minetest.conf, as
only these support noise flags. However the older 'single line' format is
still accepted to support existing minetest.conf files.
Therefore auto-generate minetest.conf.example with noise parameters in
'group format'.

Setting 'type' in settingtypes.txt is now either 'noise_params_2D' or
'noise_params_3D', the dimension number is displayed in the advanced
settings edit page.
This commit is contained in:
Muhammad Rifqi Priyo Susanto 2017-09-10 00:49:12 +07:00 committed by paramat
parent c60abb2aec
commit a1e1a19ac3
9 changed files with 476 additions and 145 deletions

View file

@ -51,6 +51,15 @@ if (value < F1000_MIN || value > F1000_MAX) { \
#define CHECK_POS_TAB(index) CHECK_TYPE(index, "position", LUA_TTABLE)
void push_float_string(lua_State *L, float value)
{
std::stringstream ss;
std::string str;
ss << value;
str = ss.str();
lua_pushstring(L, str.c_str());
}
void push_v3f(lua_State *L, v3f p)
{
lua_newtable(L);
@ -71,6 +80,26 @@ void push_v2f(lua_State *L, v2f p)
lua_setfield(L, -2, "y");
}
void push_v3_float_string(lua_State *L, v3f p)
{
lua_newtable(L);
push_float_string(L, p.X);
lua_setfield(L, -2, "x");
push_float_string(L, p.Y);
lua_setfield(L, -2, "y");
push_float_string(L, p.Z);
lua_setfield(L, -2, "z");
}
void push_v2_float_string(lua_State *L, v2f p)
{
lua_newtable(L);
push_float_string(L, p.X);
lua_setfield(L, -2, "x");
push_float_string(L, p.Y);
lua_setfield(L, -2, "y");
}
v2s16 read_v2s16(lua_State *L, int index)
{
v2s16 p;