Skip to content

Commit b1112f6

Browse files
rubenwardyparamat
authored andcommittedNov 8, 2018
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.
1 parent bd81b5e commit b1112f6

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
 

Diff for: ‎src/defaultsettings.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -285,6 +285,7 @@ void set_default_settings(Settings *settings)
285285
settings->setDefault("font_size", font_size_str);
286286
settings->setDefault("mono_font_size", font_size_str);
287287
settings->setDefault("contentdb_url", "https://content.minetest.net");
288+
settings->setDefault("show_nonfree_packages", "false");
288289

289290

290291
// Server

Diff for: ‎src/script/lua_api/l_mainmenu.cpp

+4-2
Original file line numberDiff line numberDiff line change
@@ -993,10 +993,12 @@ int ModApiMainMenu::l_get_screen_info(lua_State *L)
993993

994994
int ModApiMainMenu::l_get_package_list(lua_State *L)
995995
{
996-
std::string url = g_settings->get("contentdb_url");
996+
std::string url = g_settings->get("contentdb_url");
997+
bool show_nonfree = g_settings->getBool("show_nonfree_packages");
997998
std::vector<Package> packages = getPackagesFromURL(url +
998999
"/api/packages/?type=mod&type=game&type=txp&protocol_version="
999-
LATEST_PROTOCOL_VERSION_STRING);
1000+
LATEST_PROTOCOL_VERSION_STRING "&nonfree=" +
1001+
(show_nonfree ? "true" : "false"));
10001002

10011003
// Make table
10021004
lua_newtable(L);

0 commit comments

Comments
 (0)
Please sign in to comment.