GUI2/Game Stats: take team reference instead of team index
This commit is contained in:
parent
fc514ccefb
commit
99f5cfacfb
3 changed files with 5 additions and 5 deletions
|
@ -39,10 +39,10 @@ namespace gui2::dialogs
|
|||
|
||||
REGISTER_DIALOG(game_stats)
|
||||
|
||||
game_stats::game_stats(const display_context& board, const int viewing_team, int& selected_side_number)
|
||||
game_stats::game_stats(const display_context& board, const team& viewing_team, int& selected_side_number)
|
||||
: modal_dialog(window_id())
|
||||
, board_(board)
|
||||
, viewing_team_(board_.teams()[viewing_team])
|
||||
, viewing_team_(viewing_team)
|
||||
, selected_side_number_(selected_side_number)
|
||||
{
|
||||
}
|
||||
|
|
|
@ -30,9 +30,9 @@ namespace gui2::dialogs
|
|||
class game_stats : public modal_dialog
|
||||
{
|
||||
public:
|
||||
game_stats(const display_context& board, const int viewing_team, int& selected_side_number);
|
||||
game_stats(const display_context& board, const team& viewing_team, int& selected_side_number);
|
||||
|
||||
static bool execute(game_board& board, const int viewing_team, int& selected_side_number)
|
||||
static bool execute(game_board& board, const team viewing_team, int& selected_side_number)
|
||||
{
|
||||
if(std::all_of(board.teams().begin(), board.teams().end(), [](team& team) { return team.hidden(); })) {
|
||||
show_transient_message("", _("No visible sides found."));
|
||||
|
|
|
@ -142,7 +142,7 @@ void menu_handler::status_table()
|
|||
{
|
||||
int selected_side;
|
||||
|
||||
if(gui2::dialogs::game_stats::execute(board(), gui_->viewing_team_index(), selected_side)) {
|
||||
if(gui2::dialogs::game_stats::execute(board(), gui_->viewing_team(), selected_side)) {
|
||||
gui_->scroll_to_leader(selected_side);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue