Statistics Dialog: keep the same stat selected between scenario selections
Fixes #3223, closes #3226.
(cherry-picked from commit f1d2f85479
)
This commit is contained in:
parent
447e946e86
commit
2ce506604f
1 changed files with 6 additions and 0 deletions
|
@ -169,6 +169,7 @@ void statistics_dialog::update_lists(window& window)
|
|||
// Update primary stats list
|
||||
//
|
||||
listbox& stat_list = find_widget<listbox>(&window, "stats_list_main", false);
|
||||
const int last_selected_stat_row = stat_list.get_selected_row();
|
||||
|
||||
stat_list.clear();
|
||||
main_stat_table_.clear();
|
||||
|
@ -181,6 +182,11 @@ void statistics_dialog::update_lists(window& window)
|
|||
add_stat_row(window, _("Losses"), stats.deaths);
|
||||
add_stat_row(window, _("Kills"), stats.killed);
|
||||
|
||||
// Reselect previously selected row. Do this *before* calling on_primary_list_select.
|
||||
if(last_selected_stat_row != -1) {
|
||||
stat_list.select_row(last_selected_stat_row);
|
||||
}
|
||||
|
||||
// Update unit count list
|
||||
on_primary_list_select(window);
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue