diff options
author | sapier <Sapier at GMX dot net> | 2013-12-11 23:07:38 +0100 |
---|---|---|
committer | sapier <Sapier at GMX dot net> | 2013-12-11 23:07:38 +0100 |
commit | 4ccaa6d0af852d0aada01f341a61290a3760cffa (patch) | |
tree | 2fe3ee091345d154eb173223fc332754734e7a0c /src/script | |
parent | dfd1f87762ca17b4839f87ab62a53fa2f64cf2c8 (diff) | |
download | minetest-4ccaa6d0af852d0aada01f341a61290a3760cffa.tar.gz minetest-4ccaa6d0af852d0aada01f341a61290a3760cffa.tar.bz2 minetest-4ccaa6d0af852d0aada01f341a61290a3760cffa.zip |
Implement search tab and version picker
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/lua_api/l_mainmenu.cpp | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index 42ddd0b14..ba8a09747 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -336,6 +336,26 @@ int ModApiMainMenu::l_get_modstore_details(lua_State *L) lua_pushstring(L,current_mod.versions[0].file.c_str()); lua_settable(L, top); + lua_pushstring(L,"versions"); + lua_newtable(L); + int versionstop = lua_gettop(L); + for (unsigned int i=0;i < current_mod.versions.size(); i++) { + lua_pushnumber(L,i+1); + lua_newtable(L); + int current_element = lua_gettop(L); + + lua_pushstring(L,"date"); + lua_pushstring(L,current_mod.versions[i].date.c_str()); + lua_settable(L,current_element); + + lua_pushstring(L,"download_url"); + lua_pushstring(L,current_mod.versions[i].file.c_str()); + lua_settable(L,current_element); + + lua_settable(L,versionstop); + } + lua_settable(L, top); + lua_pushstring(L,"screenshot_url"); lua_pushstring(L,current_mod.titlepic.file.c_str()); lua_settable(L, top); @@ -782,7 +802,10 @@ int ModApiMainMenu::l_extract_zip(lua_State *L) io::IFileSystem* fs = engine->m_device->getFileSystem(); - fs->addFileArchive(zipfile,true,false,io::EFAT_ZIP); + if (!fs->addFileArchive(zipfile,true,false,io::EFAT_ZIP)) { + lua_pushboolean(L,false); + return 1; + } assert(fs->getFileArchiveCount() > 0); |