diff options
Diffstat (limited to 'src/script/lua_api/l_mainmenu.cpp')
-rw-r--r-- | src/script/lua_api/l_mainmenu.cpp | 11 |
1 files changed, 11 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); |