Skip to content

Commit

Permalink
Sort game list alphabetically (at least in ASCII)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ghabry committed Aug 11, 2016
1 parent aa39f2c commit 3efb6c7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/window_gamelist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,13 @@ void Window_GameList::Refresh() {
game_directories.push_back(dir.second);
}
}


// Sort game list in place
std::sort(game_directories.begin(), game_directories.end(),
[](const std::string& s, const std::string& s2) {
return strcmp(Utils::LowerCase(s).c_str(), Utils::LowerCase(s2).c_str()) <= 0;
});

if (HasValidGames()) {
item_max = game_directories.size();

Expand Down

0 comments on commit 3efb6c7

Please sign in to comment.