mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-11 14:01:49 +00:00
lua: core.quit()
This commit is contained in:
parent
567c8a365f
commit
a94f949be6
1 changed files with 7 additions and 0 deletions
|
|
@ -4,6 +4,7 @@
|
||||||
#include "../../../engine.h"
|
#include "../../../engine.h"
|
||||||
#include "../../../files/engine_paths.h"
|
#include "../../../files/engine_paths.h"
|
||||||
#include "../../../frontend/menu/menu.h"
|
#include "../../../frontend/menu/menu.h"
|
||||||
|
#include "../../../window/Window.h"
|
||||||
#include "../scripting.h"
|
#include "../scripting.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
@ -27,8 +28,14 @@ static int l_open_world(lua_State* L) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static int l_quit(lua_State* L) {
|
||||||
|
Window::setShouldClose(true);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
const luaL_Reg corelib [] = {
|
const luaL_Reg corelib [] = {
|
||||||
{"get_worlds_list", lua_wrap_errors<l_get_worlds_list>},
|
{"get_worlds_list", lua_wrap_errors<l_get_worlds_list>},
|
||||||
{"open_world", lua_wrap_errors<l_open_world>},
|
{"open_world", lua_wrap_errors<l_open_world>},
|
||||||
|
{"quit", lua_wrap_errors<l_quit>},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue