Add core.sleep_ms to async main menu API

master
luk3yx 2021-06-21 17:20:18 +12:00 committed by MoNTE48
parent 9bd686216a
commit c0f4228096
2 changed files with 11 additions and 0 deletions

View File

@ -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);
}

View File

@ -158,6 +158,8 @@ private:
// async
static int l_do_async_callback(lua_State *L);
static int l_sleep_ms(lua_State *L);
public:
/**