From 122eed7a3449eead6f87f45f2eb55c11c3cf171e Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sun, 20 May 2018 00:25:17 +0100 Subject: Add screenshots to online content browser --- src/script/lua_api/l_mainmenu.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'src/script/lua_api') 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++; -- cgit v1.2.3