diff --git a/src/menu_events.cpp b/src/menu_events.cpp index f5a68a2dd9db..532761c9488d 100644 --- a/src/menu_events.cpp +++ b/src/menu_events.cpp @@ -34,6 +34,7 @@ #include "formatter.hpp" #include "formula_string_utils.hpp" #include "game_board.hpp" +#include "game_config_manager.hpp" #include "game_end_exceptions.hpp" #include "game_events/manager.hpp" #include "game_events/pump.hpp" @@ -1770,9 +1771,6 @@ class chat_command_handler : public map_command_handler _("Add a nickname to your friends list."), _("")); register_command("remove", &chat_command_handler::do_remove, _("Remove a nickname from your ignores or friends list."), _("")); - register_command("list", &chat_command_handler::do_display, - _("Show your ignores and friends list.")); - register_alias("list", "display"); register_command("version", &chat_command_handler::do_version, _("Display version information.")); register_command("register", &chat_command_handler::do_register, @@ -1934,7 +1932,6 @@ class console_handler : public map_command_handler, private cha chmap::get_command("version")->flags = ""; //clear network-only flag chmap::get_command("ignore")->flags = ""; //clear network-only flag chmap::get_command("friend")->flags = ""; //clear network-only flag - chmap::get_command("list")->flags = ""; //clear network-only flag chmap::get_command("remove")->flags = ""; //clear network-only flag chmap::set_cmd_prefix(":"); register_command("refresh", &console_handler::do_refresh, @@ -2271,8 +2268,7 @@ void chat_command_handler::do_log() void chat_command_handler::do_ignore() { if (get_arg(1).empty()) { - const std::map& tmp = preferences::get_acquaintances_nice("ignore"); - print(_("ignores list"), tmp.empty() ? _("(empty)") : utils::join_map(tmp, ")\n", " (") + ")"); + do_display(); } else { utils::string_map symbols; symbols["nick"] = get_arg(1); @@ -2289,8 +2285,7 @@ void chat_command_handler::do_ignore() void chat_command_handler::do_friend() { if (get_arg(1).empty()) { - const std::map& tmp = preferences::get_acquaintances_nice("friend"); - print(_("friends list"), tmp.empty() ? _("(empty)") : utils::join_map(tmp, ")\n", " (") + ")"); + do_display(); } else { utils::string_map symbols; symbols["nick"] = get_arg(1); @@ -2317,20 +2312,9 @@ void chat_command_handler::do_remove() void chat_command_handler::do_display() { - const std::map& friends = preferences::get_acquaintances_nice("friend"); - const std::map& ignores = preferences::get_acquaintances_nice("ignore"); - - if (!friends.empty()) { - print(_("friends list"), utils::join_map(friends, ")\n", " (") + ")"); - } - - if (!ignores.empty()) { - print(_("ignores list"), utils::join_map(ignores, ")\n", " (") + ")"); - } - - if (friends.empty() && ignores.empty()) { - print(_("friends and ignores list"), _("There are no players on your friends or ignore list.")); - } + // TODO: add video and game config argument to chat_command_handler? + preferences::show_preferences_dialog(CVideo::get_singleton(), + game_config_manager::get()->game_config(), preferences::VIEW_FRIENDS); } void chat_command_handler::do_version() {