mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add screenshots to online content browser
This commit is contained in:
parent
8295f9f89b
commit
122eed7a34
4 changed files with 74 additions and 4 deletions
|
@ -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++;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue