From 383153419bef744af4bfa5f5d54c4bee663a5ce6 Mon Sep 17 00:00:00 2001 From: Novatux Date: Fri, 2 Aug 2013 15:18:48 +0200 Subject: Add texture pack selection to main menu --- src/guiLuaApi.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/guiLuaApi.cpp') 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); @@ -829,6 +830,15 @@ int guiLuaApi::l_get_gamepath(lua_State *L) return 1; } +/******************************************************************************/ +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); -- cgit v1.2.3