Skip to content

Commit

Permalink
Sorting by first played now pushes never played to the end
Browse files Browse the repository at this point in the history
  • Loading branch information
tallbl0nde committed Oct 5, 2019
1 parent 8d3733c commit cfeef28
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion source/menus/Stats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ void Menu_Stats::sortTitles(){
std::sort(this->titles.begin(), this->titles.end(), [](Title * lhs, Title * rhs){
return lhs->getFirstPlayed() < rhs->getFirstPlayed();
});
while (this->titles[0]->getFirstPlayed() == 0){
std::rotate(this->titles.begin(), this->titles.begin()+1, this->titles.end());
}
break;
case LastPlayed:
std::sort(this->titles.begin(), this->titles.end(), [](Title * lhs, Title * rhs){
Expand All @@ -42,7 +45,7 @@ Menu_Stats::Menu_Stats(std::vector<Title *> titles){
this->sort = HoursAsc;
this->sortTitles();
this->page = 1;
this->pages = (int)ceil(titles.size()/(float)GAMES_PER_PAGE);
this->pages = (int)ceil(this->titles.size()/(float)GAMES_PER_PAGE);
}

MenuType Menu_Stats::draw(u64 kDown){
Expand Down

0 comments on commit cfeef28

Please sign in to comment.