menu.favorites = engine.get_favorites("local")
end
- menu.defaulttexturedir = engine.get_texturepath() .. DIR_DELIM .. "base" ..
+ menu.defaulttexturedir = engine.get_texturepath_share() .. DIR_DELIM .. "base" ..
DIR_DELIM .. "pack" .. DIR_DELIM
end
local no_screenshot = nil
if not file_exists(screenfile) then
screenfile = nil
- no_screenshot = engine.get_texturepath()..DIR_DELIM..
- "base"..DIR_DELIM.."pack"..DIR_DELIM.."no_screenshot.png"
+ no_screenshot = menu.defaulttexturedir .. "no_screenshot.png"
end
return retval ..
return 1;
}
+int ModApiMainMenu::l_get_texturepath_share(lua_State *L)
+{
+ std::string gamepath
+ = fs::RemoveRelativePathComponents(porting::path_share + DIR_DELIM + "textures");
+ lua_pushstring(L, gamepath.c_str());
+ return 1;
+}
+
/******************************************************************************/
int ModApiMainMenu::l_get_dirlist(lua_State *L)
{
API_FCT(get_modpath);
API_FCT(get_gamepath);
API_FCT(get_texturepath);
+ API_FCT(get_texturepath_share);
API_FCT(get_dirlist);
API_FCT(create_dir);
API_FCT(delete_dir);
ASYNC_API_FCT(get_modpath);
ASYNC_API_FCT(get_gamepath);
ASYNC_API_FCT(get_texturepath);
+ ASYNC_API_FCT(get_texturepath_share);
ASYNC_API_FCT(get_dirlist);
ASYNC_API_FCT(create_dir);
ASYNC_API_FCT(delete_dir);
static int l_get_texturepath(lua_State *L);
+ static int l_get_texturepath_share(lua_State *L);
+
static int l_get_dirlist(lua_State *L);
static int l_create_dir(lua_State *L);