mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-13 08:35:20 +02:00
Add core.open_url() to main menu API (#8592)
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user