mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Content store: Add setting to filter non-free packages (#7766)
Defaulting to hiding in order to help with Debian/etc distribution. This could be changed at a later date.
This commit is contained in:
parent
bd81b5e4c8
commit
b1112f663b
2 changed files with 5 additions and 2 deletions
|
@ -993,10 +993,12 @@ int ModApiMainMenu::l_get_screen_info(lua_State *L)
|
|||
|
||||
int ModApiMainMenu::l_get_package_list(lua_State *L)
|
||||
{
|
||||
std::string url = g_settings->get("contentdb_url");
|
||||
std::string url = g_settings->get("contentdb_url");
|
||||
bool show_nonfree = g_settings->getBool("show_nonfree_packages");
|
||||
std::vector<Package> packages = getPackagesFromURL(url +
|
||||
"/api/packages/?type=mod&type=game&type=txp&protocol_version="
|
||||
LATEST_PROTOCOL_VERSION_STRING);
|
||||
LATEST_PROTOCOL_VERSION_STRING "&nonfree=" +
|
||||
(show_nonfree ? "true" : "false"));
|
||||
|
||||
// Make table
|
||||
lua_newtable(L);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue