[XAM/User] ...CreateTitlesPlayedEnumerator: sort titles by date played (thanks Gliniak!)

This commit is contained in:
emoose 2019-12-26 01:32:33 +00:00 committed by Gliniak
parent 74ca77a5a3
commit 75d52e7a43
1 changed files with 5 additions and 0 deletions

View File

@ -730,6 +730,11 @@ dword_result_t XamUserCreateTitlesPlayedEnumerator(
std::vector<xdbf::TitlePlayed> titles;
kernel_state()->user_profile()->GetDashboardGpd()->GetTitles(&titles);
// Sort titles by date played
std::sort(titles.begin(), titles.end(),
[](const xdbf::TitlePlayed& first, const xdbf::TitlePlayed& second)
-> bool { return first.last_played > second.last_played; });
auto e = new XStaticEnumerator(kernel_state(), games_count, kEntrySize);
e->Initialize();