mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 02:51:49 +00:00
settings page completely moved to xml
This commit is contained in:
parent
9cdf3ff016
commit
b9ea88b988
15 changed files with 111 additions and 107 deletions
|
|
@ -133,8 +133,8 @@ static int l_str_setting(lua_State* L) {
|
|||
static int l_get_setting_info(lua_State* L) {
|
||||
auto name = lua_tostring(L, 1);
|
||||
auto setting = scripting::engine->getSettingsHandler().getSetting(name);
|
||||
lua_createtable(L, 0, 1);
|
||||
if (auto number = dynamic_cast<NumberSetting*>(setting)) {
|
||||
lua_createtable(L, 0, 1);
|
||||
lua_pushnumber(L, number->getMin());
|
||||
lua_setfield(L, -2, "min");
|
||||
lua_pushnumber(L, number->getMax());
|
||||
|
|
@ -142,13 +142,13 @@ static int l_get_setting_info(lua_State* L) {
|
|||
return 1;
|
||||
}
|
||||
if (auto integer = dynamic_cast<IntegerSetting*>(setting)) {
|
||||
lua_createtable(L, 0, 1);
|
||||
lua_pushinteger(L, integer->getMin());
|
||||
lua_setfield(L, -2, "min");
|
||||
lua_pushinteger(L, integer->getMax());
|
||||
lua_setfield(L, -2, "max");
|
||||
return 1;
|
||||
}
|
||||
lua_pop(L, 1);
|
||||
luaL_error(L, "unsupported setting type");
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue