mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add core.open_url() to main menu API (#8592)
This commit is contained in:
parent
c1ce4be756
commit
a9c3a42323
10 changed files with 98 additions and 96 deletions
|
@ -1063,6 +1063,14 @@ int ModApiMainMenu::l_get_max_supp_proto(lua_State *L)
|
|||
return 1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int ModApiMainMenu::l_open_url(lua_State *L)
|
||||
{
|
||||
std::string url = luaL_checkstring(L, 1);
|
||||
lua_pushboolean(L, porting::openURL(url));
|
||||
return 1;
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
int ModApiMainMenu::l_do_async_callback(lua_State *L)
|
||||
{
|
||||
|
@ -1125,6 +1133,7 @@ void ModApiMainMenu::Initialize(lua_State *L, int top)
|
|||
API_FCT(get_screen_info);
|
||||
API_FCT(get_min_supp_proto);
|
||||
API_FCT(get_max_supp_proto);
|
||||
API_FCT(open_url);
|
||||
API_FCT(do_async_callback);
|
||||
}
|
||||
|
||||
|
|
|
@ -145,6 +145,9 @@ private:
|
|||
|
||||
static int l_get_max_supp_proto(lua_State *L);
|
||||
|
||||
// other
|
||||
static int l_open_url(lua_State *L);
|
||||
|
||||
|
||||
// async
|
||||
static int l_do_async_callback(lua_State *L);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue