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

This commit is contained in:
emoose 2019-12-26 01:32:33 +00:00
parent c44bc45d2e
commit 1a49bd94b8
1 changed files with 5 additions and 0 deletions

View File

@ -725,6 +725,11 @@ dword_result_t XamUserCreateTitlesPlayedEnumerator(
std::vector<xdbf::TitlePlayed> titles; std::vector<xdbf::TitlePlayed> titles;
kernel_state()->user_profile()->GetDashboardGpd()->GetTitles(&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); auto e = new XStaticEnumerator(kernel_state(), games_count, kEntrySize);
e->Initialize(); e->Initialize();