File tree 3 files changed +14
-3
lines changed
3 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -253,7 +253,7 @@ function menu.init()
253
253
menu .favorites = engine .get_favorites (" local" )
254
254
end
255
255
256
- menu .defaulttexturedir = engine .get_texturepath () .. DIR_DELIM .. " base" ..
256
+ menu .defaulttexturedir = engine .get_texturepath_share () .. DIR_DELIM .. " base" ..
257
257
DIR_DELIM .. " pack" .. DIR_DELIM
258
258
end
259
259
@@ -1070,8 +1070,7 @@ function tabbuilder.tab_texture_packs()
1070
1070
local no_screenshot = nil
1071
1071
if not file_exists (screenfile ) then
1072
1072
screenfile = nil
1073
- no_screenshot = engine .get_texturepath ().. DIR_DELIM ..
1074
- " base" .. DIR_DELIM .. " pack" .. DIR_DELIM .. " no_screenshot.png"
1073
+ no_screenshot = menu .defaulttexturedir .. " no_screenshot.png"
1075
1074
end
1076
1075
1077
1076
return retval ..
Original file line number Diff line number Diff line change @@ -704,6 +704,14 @@ int ModApiMainMenu::l_get_texturepath(lua_State *L)
704
704
return 1 ;
705
705
}
706
706
707
+ int ModApiMainMenu::l_get_texturepath_share (lua_State *L)
708
+ {
709
+ std::string gamepath
710
+ = fs::RemoveRelativePathComponents (porting::path_share + DIR_DELIM + " textures" );
711
+ lua_pushstring (L, gamepath.c_str ());
712
+ return 1 ;
713
+ }
714
+
707
715
/* *****************************************************************************/
708
716
int ModApiMainMenu::l_get_dirlist (lua_State *L)
709
717
{
@@ -1032,6 +1040,7 @@ void ModApiMainMenu::Initialize(lua_State *L, int top)
1032
1040
API_FCT (get_modpath);
1033
1041
API_FCT (get_gamepath);
1034
1042
API_FCT (get_texturepath);
1043
+ API_FCT (get_texturepath_share);
1035
1044
API_FCT (get_dirlist);
1036
1045
API_FCT (create_dir);
1037
1046
API_FCT (delete_dir);
@@ -1059,6 +1068,7 @@ void ModApiMainMenu::InitializeAsync(AsyncEngine& engine)
1059
1068
ASYNC_API_FCT (get_modpath);
1060
1069
ASYNC_API_FCT (get_gamepath);
1061
1070
ASYNC_API_FCT (get_texturepath);
1071
+ ASYNC_API_FCT (get_texturepath_share);
1062
1072
ASYNC_API_FCT (get_dirlist);
1063
1073
ASYNC_API_FCT (create_dir);
1064
1074
ASYNC_API_FCT (delete_dir);
Original file line number Diff line number Diff line change @@ -111,6 +111,8 @@ class ModApiMainMenu : public ModApiBase {
111
111
112
112
static int l_get_texturepath (lua_State *L);
113
113
114
+ static int l_get_texturepath_share (lua_State *L);
115
+
114
116
static int l_get_dirlist (lua_State *L);
115
117
116
118
static int l_create_dir (lua_State *L);
You can’t perform that action at this time.
0 commit comments