]> git.lizzy.rs Git - dragonfireclient.git/blobdiff - src/script/lua_api/l_mainmenu.cpp
Android: Add support for sharing debug.txt (#12370)
[dragonfireclient.git] / src / script / lua_api / l_mainmenu.cpp
index f7b2393fb0b98cbc087236b139dc5bc9bf141b6e..4a847ed6ded83dba815c6abe6ecb1ac6950d824c 100644 (file)
@@ -876,6 +876,19 @@ int ModApiMainMenu::l_open_dir(lua_State *L)
        return 1;
 }
 
+/******************************************************************************/
+int ModApiMainMenu::l_share_file(lua_State *L)
+{
+#ifdef __ANDROID__
+       std::string path = luaL_checkstring(L, 1);
+       porting::shareFileAndroid(path);
+       lua_pushboolean(L, true);
+#else
+       lua_pushboolean(L, false);
+#endif
+       return 1;
+}
+
 /******************************************************************************/
 int ModApiMainMenu::l_do_async_callback(lua_State *L)
 {
@@ -941,6 +954,7 @@ void ModApiMainMenu::Initialize(lua_State *L, int top)
        API_FCT(get_max_supp_proto);
        API_FCT(open_url);
        API_FCT(open_dir);
+       API_FCT(share_file);
        API_FCT(do_async_callback);
 }