diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index af27ade49..1c3172f59 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -938,6 +938,14 @@ int ModApiMainMenu::l_do_async_callback(lua_State *L) return 1; } +/******************************************************************************/ +int ModApiMainMenu::l_sleep_ms(lua_State *L) +{ + int delay = luaL_checkinteger(L, 1); + sleep_ms(delay); + return 0; +} + /******************************************************************************/ void ModApiMainMenu::Initialize(lua_State *L, int top) { @@ -1011,4 +1019,5 @@ void ModApiMainMenu::InitializeAsync(lua_State *L, int top) API_FCT(get_min_supp_proto); API_FCT(get_max_supp_proto); //API_FCT(gettext); (gettext lib isn't threadsafe) + API_FCT(sleep_ms); } diff --git a/src/script/lua_api/l_mainmenu.h b/src/script/lua_api/l_mainmenu.h index f69f032bb..ddc450062 100644 --- a/src/script/lua_api/l_mainmenu.h +++ b/src/script/lua_api/l_mainmenu.h @@ -158,6 +158,8 @@ private: // async static int l_do_async_callback(lua_State *L); + static int l_sleep_ms(lua_State *L); + public: /**