Skip to content

Commit b8c3221

Browse files
Ilya Zhuravlevceleron55
Ilya Zhuravlev
authored andcommittedJan 5, 2014
Fix absence of images when compiled with RUN_IN_PLACE=0.
1 parent 4d22977 commit b8c3221

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed
 

‎builtin/mainmenu.lua

+2-3
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ function menu.init()
253253
menu.favorites = engine.get_favorites("local")
254254
end
255255

256-
menu.defaulttexturedir = engine.get_texturepath() .. DIR_DELIM .. "base" ..
256+
menu.defaulttexturedir = engine.get_texturepath_share() .. DIR_DELIM .. "base" ..
257257
DIR_DELIM .. "pack" .. DIR_DELIM
258258
end
259259

@@ -1070,8 +1070,7 @@ function tabbuilder.tab_texture_packs()
10701070
local no_screenshot = nil
10711071
if not file_exists(screenfile) then
10721072
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"
10751074
end
10761075

10771076
return retval ..

‎src/script/lua_api/l_mainmenu.cpp

+10
Original file line numberDiff line numberDiff line change
@@ -704,6 +704,14 @@ int ModApiMainMenu::l_get_texturepath(lua_State *L)
704704
return 1;
705705
}
706706

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+
707715
/******************************************************************************/
708716
int ModApiMainMenu::l_get_dirlist(lua_State *L)
709717
{
@@ -1032,6 +1040,7 @@ void ModApiMainMenu::Initialize(lua_State *L, int top)
10321040
API_FCT(get_modpath);
10331041
API_FCT(get_gamepath);
10341042
API_FCT(get_texturepath);
1043+
API_FCT(get_texturepath_share);
10351044
API_FCT(get_dirlist);
10361045
API_FCT(create_dir);
10371046
API_FCT(delete_dir);
@@ -1059,6 +1068,7 @@ void ModApiMainMenu::InitializeAsync(AsyncEngine& engine)
10591068
ASYNC_API_FCT(get_modpath);
10601069
ASYNC_API_FCT(get_gamepath);
10611070
ASYNC_API_FCT(get_texturepath);
1071+
ASYNC_API_FCT(get_texturepath_share);
10621072
ASYNC_API_FCT(get_dirlist);
10631073
ASYNC_API_FCT(create_dir);
10641074
ASYNC_API_FCT(delete_dir);

‎src/script/lua_api/l_mainmenu.h

+2
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,8 @@ class ModApiMainMenu : public ModApiBase {
111111

112112
static int l_get_texturepath(lua_State *L);
113113

114+
static int l_get_texturepath_share(lua_State *L);
115+
114116
static int l_get_dirlist(lua_State *L);
115117

116118
static int l_create_dir(lua_State *L);

0 commit comments

Comments
 (0)
Please sign in to comment.