1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-13 00:25:19 +02:00

ContentDB: Add overwrite dialog when content is already installed (#10768)

This commit is contained in:
rubenwardy
2021-01-04 15:18:31 +00:00
committed by GitHub
parent dd5a732fa9
commit edd0836011
4 changed files with 84 additions and 5 deletions

View File

@@ -803,6 +803,15 @@ int ModApiMainMenu::l_copy_dir(lua_State *L)
return 1;
}
/******************************************************************************/
int ModApiMainMenu::l_is_dir(lua_State *L)
{
const char *path = luaL_checkstring(L, 1);
lua_pushboolean(L, fs::IsDir(path));
return 1;
}
/******************************************************************************/
int ModApiMainMenu::l_extract_zip(lua_State *L)
{
@@ -1139,6 +1148,7 @@ void ModApiMainMenu::Initialize(lua_State *L, int top)
API_FCT(create_dir);
API_FCT(delete_dir);
API_FCT(copy_dir);
API_FCT(is_dir);
API_FCT(extract_zip);
API_FCT(may_modify_path);
API_FCT(get_mainmenu_path);
@@ -1172,6 +1182,7 @@ void ModApiMainMenu::InitializeAsync(lua_State *L, int top)
API_FCT(create_dir);
API_FCT(delete_dir);
API_FCT(copy_dir);
API_FCT(is_dir);
//API_FCT(extract_zip); //TODO remove dependency to GuiEngine
API_FCT(may_modify_path);
API_FCT(download_file);

View File

@@ -132,6 +132,8 @@ private:
static int l_copy_dir(lua_State *L);
static int l_is_dir(lua_State *L);
static int l_extract_zip(lua_State *L);
static int l_may_modify_path(lua_State *L);