From 6b3a9a0bcd13d91b0f0263b0e6f6524d1a2e23cd Mon Sep 17 00:00:00 2001 From: LillyJadeKatrin Date: Tue, 18 Jun 2024 08:19:17 -0400 Subject: [PATCH] Add Sorting to Achievements Dialog rc_client provides basic sorting buckets as a possible option when retrieving the list of achievements or leaderboards; this enables them and labels them in the dialog. --- .../DolphinQt/Achievements/AchievementLeaderboardWidget.cpp | 3 ++- .../Core/DolphinQt/Achievements/AchievementProgressWidget.cpp | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Source/Core/DolphinQt/Achievements/AchievementLeaderboardWidget.cpp b/Source/Core/DolphinQt/Achievements/AchievementLeaderboardWidget.cpp index c3ae860205..7ded150a09 100644 --- a/Source/Core/DolphinQt/Achievements/AchievementLeaderboardWidget.cpp +++ b/Source/Core/DolphinQt/Achievements/AchievementLeaderboardWidget.cpp @@ -44,12 +44,13 @@ void AchievementLeaderboardWidget::UpdateData(bool clean_all) return; auto* client = instance.GetClient(); auto* leaderboard_list = - rc_client_create_leaderboard_list(client, RC_CLIENT_LEADERBOARD_LIST_GROUPING_NONE); + rc_client_create_leaderboard_list(client, RC_CLIENT_LEADERBOARD_LIST_GROUPING_TRACKING); u32 row = 0; for (u32 bucket = 0; bucket < leaderboard_list->num_buckets; bucket++) { const auto& leaderboard_bucket = leaderboard_list->buckets[bucket]; + m_common_layout->addWidget(new QLabel(tr(leaderboard_bucket.label))); for (u32 board = 0; board < leaderboard_bucket.num_leaderboards; board++) { const auto* leaderboard = leaderboard_bucket.leaderboards[board]; diff --git a/Source/Core/DolphinQt/Achievements/AchievementProgressWidget.cpp b/Source/Core/DolphinQt/Achievements/AchievementProgressWidget.cpp index 0164ee6a78..741cb61227 100644 --- a/Source/Core/DolphinQt/Achievements/AchievementProgressWidget.cpp +++ b/Source/Core/DolphinQt/Achievements/AchievementProgressWidget.cpp @@ -49,9 +49,10 @@ void AchievementProgressWidget::UpdateData(bool clean_all) auto* client = instance.GetClient(); auto* achievement_list = rc_client_create_achievement_list( client, RC_CLIENT_ACHIEVEMENT_CATEGORY_CORE_AND_UNOFFICIAL, - RC_CLIENT_ACHIEVEMENT_LIST_GROUPING_LOCK_STATE); + RC_CLIENT_ACHIEVEMENT_LIST_GROUPING_PROGRESS); for (u32 ix = 0; ix < achievement_list->num_buckets; ix++) { + m_common_layout->addWidget(new QLabel(tr(achievement_list->buckets[ix].label))); for (u32 jx = 0; jx < achievement_list->buckets[ix].num_achievements; jx++) { auto* achievement = achievement_list->buckets[ix].achievements[jx];