mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-12 06:21:50 +00:00
extremelly complex feature
This commit is contained in:
parent
7374013eeb
commit
d47193cbb3
1 changed files with 8 additions and 0 deletions
|
|
@ -77,6 +77,13 @@ static int l_get_setting(lua_State* L) {
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int l_set_setting(lua_State* L) {
|
||||||
|
auto name = lua_tostring(L, 1);
|
||||||
|
const auto value = scripting::state->tovalue(2);
|
||||||
|
scripting::engine->getSettingsHandler().setValue(name, value);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
static int l_quit(lua_State* L) {
|
static int l_quit(lua_State* L) {
|
||||||
Window::setShouldClose(true);
|
Window::setShouldClose(true);
|
||||||
return 0;
|
return 0;
|
||||||
|
|
@ -89,6 +96,7 @@ const luaL_Reg corelib [] = {
|
||||||
{"delete_world", lua_wrap_errors<l_delete_world>},
|
{"delete_world", lua_wrap_errors<l_delete_world>},
|
||||||
{"get_bindings", lua_wrap_errors<l_get_bindings>},
|
{"get_bindings", lua_wrap_errors<l_get_bindings>},
|
||||||
{"get_setting", lua_wrap_errors<l_get_setting>},
|
{"get_setting", lua_wrap_errors<l_get_setting>},
|
||||||
|
{"set_setting", lua_wrap_errors<l_set_setting>},
|
||||||
{"quit", lua_wrap_errors<l_quit>},
|
{"quit", lua_wrap_errors<l_quit>},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue