mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 19:41:51 +00:00
add 'def' to settings info
This commit is contained in:
parent
edad594101
commit
a43002cf54
4 changed files with 39 additions and 0 deletions
|
|
@ -154,6 +154,8 @@ static int l_get_setting_info(lua::State* L) {
|
|||
lua::setfield(L, "min");
|
||||
lua::pushnumber(L, number->getMax());
|
||||
lua::setfield(L, "max");
|
||||
lua::pushnumber(L, number->getDefault());
|
||||
lua::setfield(L, "def");
|
||||
return 1;
|
||||
}
|
||||
if (auto integer = dynamic_cast<IntegerSetting*>(setting)) {
|
||||
|
|
@ -161,6 +163,18 @@ static int l_get_setting_info(lua::State* L) {
|
|||
lua::setfield(L, "min");
|
||||
lua::pushinteger(L, integer->getMax());
|
||||
lua::setfield(L, "max");
|
||||
lua::pushinteger(L, integer->getDefault());
|
||||
lua::setfield(L, "def");
|
||||
return 1;
|
||||
}
|
||||
if (auto boolean = dynamic_cast<FlagSetting*>(setting)) {
|
||||
lua::pushboolean(L, boolean->getDefault());
|
||||
lua::setfield(L, "def");
|
||||
return 1;
|
||||
}
|
||||
if (auto string = dynamic_cast<StringSetting*>(setting)) {
|
||||
lua::pushstring(L, string->getDefault());
|
||||
lua::setfield(L, "def");
|
||||
return 1;
|
||||
}
|
||||
lua::pop(L);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue