summaryrefslogtreecommitdiff
path: root/src/guiLuaApi.cpp
diff options
context:
space:
mode:
authorNovatux <nathanael.courant@laposte.net>2013-08-02 15:18:48 +0200
committerPilzAdam <pilzadam@minetest.net>2013-08-04 16:52:30 +0200
commit383153419bef744af4bfa5f5d54c4bee663a5ce6 (patch)
tree6630c6c9075246991d2575b1631205097e2591c5 /src/guiLuaApi.cpp
parentfe1fe1b1e42d24dc87a75ef8cc27c5c1dd1cfa4d (diff)
downloadminetest-383153419bef744af4bfa5f5d54c4bee663a5ce6.tar.gz
minetest-383153419bef744af4bfa5f5d54c4bee663a5ce6.tar.bz2
minetest-383153419bef744af4bfa5f5d54c4bee663a5ce6.zip
Add texture pack selection to main menu
Diffstat (limited to 'src/guiLuaApi.cpp')
-rw-r--r--src/guiLuaApi.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/guiLuaApi.cpp b/src/guiLuaApi.cpp
index 485cab883..5d3e9dc12 100644
--- a/src/guiLuaApi.cpp
+++ b/src/guiLuaApi.cpp
@@ -82,6 +82,7 @@ void guiLuaApi::initialize(lua_State* L,GUIEngine* engine)
retval &= API_FCT(set_topleft_text);
retval &= API_FCT(get_modpath);
retval &= API_FCT(get_gamepath);
+ retval &= API_FCT(get_texturepath);
retval &= API_FCT(get_dirlist);
retval &= API_FCT(create_dir);
retval &= API_FCT(delete_dir);
@@ -830,6 +831,15 @@ int guiLuaApi::l_get_gamepath(lua_State *L)
}
/******************************************************************************/
+int guiLuaApi::l_get_texturepath(lua_State *L)
+{
+ std::string gamepath
+ = fs::RemoveRelativePathComponents(porting::path_user + DIR_DELIM + "textures");
+ lua_pushstring(L, gamepath.c_str());
+ return 1;
+}
+
+/******************************************************************************/
int guiLuaApi::l_get_dirlist(lua_State *L) {
const char *path = luaL_checkstring(L, 1);
bool dironly = lua_toboolean(L, 2);