From 79374d3dd174bbf08520e00b7d9c4ae923ffa79d Mon Sep 17 00:00:00 2001 From: Martin Michelsen Date: Tue, 13 Dec 2022 23:39:23 -0800 Subject: [PATCH] make tournament entry details cleaner --- src/ReceiveCommands.cc | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/src/ReceiveCommands.cc b/src/ReceiveCommands.cc index 60fafbb8..e57ea651 100644 --- a/src/ReceiveCommands.cc +++ b/src/ReceiveCommands.cc @@ -1494,15 +1494,23 @@ static void on_menu_item_info_request(shared_ptr s, shared_ptrget_team(team_index); if (team) { - string team_name = team->name.empty() ? "(Unnamed team)" : team->name; - string message = string_printf("$C7%s\n%zuH/%zuC/%zu players\n%zu %s\n%s", - team_name.c_str(), - team->num_human_players(), - team->num_com_players(), - team->max_players, - team->num_rounds_cleared, - team->num_rounds_cleared == 1 ? "win" : "wins", - team->password.empty() ? "" : "Locked"); + string message; + if (team->name.empty()) { + message = "(No registrant)"; + } else if (team->max_players == 1) { + message = string_printf("$C6%s$C7\n%zu %s", + team->name.c_str(), + team->num_rounds_cleared, + team->num_rounds_cleared == 1 ? "win" : "wins"); + } else { + message = string_printf("$C6%s$C7\n%zuH/%zuC\n%zu %s\n%s", + team->name.c_str(), + team->num_human_players(), + team->num_com_players(), + team->num_rounds_cleared, + team->num_rounds_cleared == 1 ? "win" : "wins", + team->password.empty() ? "" : "Locked"); + } send_ship_info(c, decode_sjis(message)); } else { send_ship_info(c, u"$C7No such team");