diff options
Diffstat (limited to 'src/script')
-rw-r--r-- | src/script/lua_api/l_mainmenu.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/script/lua_api/l_mainmenu.cpp b/src/script/lua_api/l_mainmenu.cpp index 812fdffe7..1f49fc211 100644 --- a/src/script/lua_api/l_mainmenu.cpp +++ b/src/script/lua_api/l_mainmenu.cpp @@ -1043,9 +1043,21 @@ int ModApiMainMenu::l_get_package_list(lua_State *L) lua_pushstring(L, package.url.c_str()); lua_settable (L, top_lvl2); - lua_pushstring(L, "release"); + lua_pushstring (L, "release"); lua_pushinteger(L, package.release); - lua_settable (L, top_lvl2); + lua_settable (L, top_lvl2); + + lua_pushstring(L, "screenshots"); + lua_newtable(L); + { + int top_screenshots = lua_gettop(L); + for (size_t i = 0; i < package.screenshots.size(); ++i) { + lua_pushnumber(L, i + 1); + lua_pushstring(L, package.screenshots[i].c_str()); + lua_settable(L, top_screenshots); + } + } + lua_settable(L, top_lvl2); lua_settable(L, top); index++; |