From 1a49bd94b8c3ef9d94973d3fbb2e4b9d40d85774 Mon Sep 17 00:00:00 2001 From: emoose Date: Thu, 26 Dec 2019 01:32:33 +0000 Subject: [PATCH] [XAM/User] ...CreateTitlesPlayedEnumerator: sort titles by date played (thanks Gliniak!) --- src/xenia/kernel/xam/xam_user.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/xenia/kernel/xam/xam_user.cc b/src/xenia/kernel/xam/xam_user.cc index f77d0d1ef..99edf63c5 100644 --- a/src/xenia/kernel/xam/xam_user.cc +++ b/src/xenia/kernel/xam/xam_user.cc @@ -725,6 +725,11 @@ dword_result_t XamUserCreateTitlesPlayedEnumerator( std::vector 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();