lua: core.open_world
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
|
||||
#include "../../../engine.h"
|
||||
#include "../../../files/engine_paths.h"
|
||||
#include "../../../frontend/menu/menu.h"
|
||||
#include "../scripting.h"
|
||||
|
||||
#include <vector>
|
||||
@@ -19,7 +20,15 @@ static int l_get_worlds_list(lua_State* L) {
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int l_open_world(lua_State* L) {
|
||||
auto name = lua_tostring(L, 1);
|
||||
scripting::engine->setScreen(nullptr);
|
||||
menus::open_world(name, scripting::engine, false);
|
||||
return 0;
|
||||
}
|
||||
|
||||
const luaL_Reg corelib [] = {
|
||||
{"get_worlds_list", lua_wrap_errors<l_get_worlds_list>},
|
||||
{"open_world", lua_wrap_errors<l_open_world>},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user