MP/Lobby: flipped blocked players filter

Now it's an inclusion filter (false by default) rather than an inclusion filter.
This commit is contained in:
Charles Dang 2020-12-23 19:28:07 +11:00
parent d80eaafe15
commit 8afe3f595c
3 changed files with 7 additions and 5 deletions

View file

@ -357,8 +357,8 @@
[toggle_button]
definition = "default"
id = "filter_without_ignored"
label = _ "Exclude blocked players"
id = "filter_with_ignored"
label = _ "Include blocked players"
[/toggle_button]
[/column]

View file

@ -133,7 +133,7 @@ mp_lobby::mp_lobby(mp::lobby_info& info, wesnothd_connection& connection, int& j
preferences::fi_friends_in_game,
preferences::set_fi_friends_in_game,
std::bind(&mp_lobby::game_filter_change_callback, this)))
, filter_ignored_(register_bool("filter_without_ignored",
, filter_ignored_(register_bool("filter_with_ignored",
true,
preferences::fi_blocked_in_game,
preferences::set_fi_blocked_in_game,
@ -1103,7 +1103,10 @@ void mp_lobby::game_filter_reload()
});
}
if(filter_ignored_->get_widget_value(window)) {
// Unlike the friends filter, this is an inclusion filter (do we want to also show
// games with blocked players) rather than an exclusion filter (do we want to show
// only games with friends).
if(filter_ignored_->get_widget_value(window) == false) {
lobby_info_.add_game_filter([](const mp::game_info& info)->bool {
return info.has_ignored == false;
});

View file

@ -69,7 +69,6 @@ void set_fi_friends_in_game(bool value)
bool fi_blocked_in_game()
{
// FIXME: still sorting out defaults and behavior for this...
return preferences::get("fi_blocked_in_game", false);
}