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.
This commit is contained in:
LillyJadeKatrin
2024-06-18 08:19:17 -04:00
parent a0d8c1088d
commit 6b3a9a0bcd
2 changed files with 4 additions and 2 deletions

View File

@ -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];