aboutsummaryrefslogtreecommitdiff
path: root/src/script
diff options
context:
space:
mode:
authorrubenwardy <rw@rubenwardy.com>2018-05-20 00:25:17 +0100
committerGitHub <noreply@github.com>2018-05-20 00:25:17 +0100
commit122eed7a3449eead6f87f45f2eb55c11c3cf171e (patch)
tree52b222a10b5489626c64417105f0ebb39e7e6d84 /src/script
parent8295f9f89b7e800fe39c2bc9b5638b1fed2c30d8 (diff)
downloadminetest-122eed7a3449eead6f87f45f2eb55c11c3cf171e.tar.gz
minetest-122eed7a3449eead6f87f45f2eb55c11c3cf171e.tar.bz2
minetest-122eed7a3449eead6f87f45f2eb55c11c3cf171e.zip
Add screenshots to online content browser
Diffstat (limited to 'src/script')
-rw-r--r--src/script/lua_api/l_mainmenu.cpp16
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++;