aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp11
-rw-r--r--src/script/lua_api/l_mainmenu.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp
index 0b0b2de3b..5070ec7d4 100644
--- a/src/script/lua_api/l_mainmenu.cpp
+++ b/src/script/lua_api/l_mainmenu.cpp
@@ -804,6 +804,15 @@ int ModApiMainMenu::l_copy_dir(lua_State *L)
}
/******************************************************************************/
+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)
{
const char *zipfile = luaL_checkstring(L, 1);
@@ -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);
diff --git a/src/script/lua_api/l_mainmenu.h b/src/script/lua_api/l_mainmenu.h
index faa2bf273..0b02ed892 100644
--- a/src/script/lua_api/l_mainmenu.h
+++ b/src/script/lua_api/l_mainmenu.h
@@ -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);