Fix sorting of units by level in Recall List and Unit List (#3370)

Now the triangle points down when the list is sorted by level descending.
This commit is contained in:
jostephd 2018-07-27 07:26:21 +00:00 committed by Jyrki Vesterinen
parent 96d8ee06b0
commit 6e31c83c64
2 changed files with 2 additions and 2 deletions

View file

@ -155,7 +155,7 @@ void unit_list::pre_show(window& window)
list.register_sorting_option(3, [this](const int i) { return unit_list_[i]->hitpoints(); });
list.register_sorting_option(4, [this](const int i) {
const unit& u = *unit_list_[i];
return std::make_tuple(-u.level(), u.experience_to_advance());
return std::make_tuple(u.level(), -u.experience_to_advance());
});
list.register_sorting_option(5, [this](const int i) { return unit_list_[i]->experience(); });
list.register_translatable_sorting_option(6, [this](const int i) {

View file

@ -228,7 +228,7 @@ void unit_recall::pre_show(window& window)
list.register_translatable_sorting_option(1, [this](const int i) { return recall_list_[i]->name().str(); });
list.register_sorting_option(2, [this](const int i) {
const unit& u = *recall_list_[i];
return std::make_tuple(-u.level(), u.experience_to_advance());
return std::make_tuple(u.level(), -u.experience_to_advance());
});
list.register_sorting_option(3, [this](const int i) { return recall_list_[i]->experience(); });
list.register_translatable_sorting_option(4, [this](const int i) {