Skip to content

rc_client_create_leaderboard_list

Jamiras edited this page Sep 16, 2023 · 3 revisions

Creates a new list of leaderboards matching the specified grouping.

Syntax

rc_client_leaderboard_list_t* rc_client_create_leaderboard_list(
    rc_client_t* client,
    int grouping
);

Parameters

client

The rc_client_t containing a loaded game.

grouping

How the leaderboards should be grouped within the list.

grouping description
RC_CLIENT_LEADERBOARD_LIST_GROUPING_NONE Separates achievements into All and Unsupported buckets.
RC_CLIENT_LEADERBOARD_LIST_GROUPING_TRACKING Separates achievements into Active, Inactive, and Unsupported buckets.

Return value

Pointer to a rc_client_leaderboard_list_t object containing the leaderboards for the game, grouped as requested.

It must be released by calling rc_client_destroy_leaderboard_list.


rc_client_leaderboard_list_t

typedef struct rc_client_leaderboard_list_t
{
  rc_client_leaderboard_bucket_t* buckets;
  uint32_t num_buckets;
} rc_client_achievement_list_t;

buckets

An array of buckets each containing 1 or more leaderboards.

num_buckets

The number of elements in the buckets array.


rc_client_leaderboard_bucket_t

typedef struct rc_client_leaderboard_bucket_t {
  rc_client_leaderboard_t** leaderboards;
  uint32_t num_leaderboards;

  const char* label;
  uint32_t subset_id;
  uint8_t id;
} rc_client_leaderboard_bucket_t;

leaderboards

An array of pointers to leaderboard information. Each item is the same data returned by rc_client_get_leaderboard_info.

num_leaderboards

The number of elements in the leaderboards array.

label

A label for the bucket. This is automatically generated and always in English. If you want to support other languages, you should build the label yourself using the subset_id and id fields.

subset_id

A unique identifier for a subset prefix. If 0, no prefix should be used.

id

A unique identifier for the bucket.

id label description
RC_CLIENT_LEADERBOARD_BUCKET_ALL All All leaderboards.
RC_CLIENT_LEADERBOARD_BUCKET_INACTIVE Inactive Leaderboards that are not currently being attempted.
RC_CLIENT_LEADERBOARD_BUCKET_ACTIVE Active Leaderboards that are currently being attempted.
RC_CLIENT_LEADERBOARD_BUCKET_UNSUPPORTED Unsupported Leaderboards that cannot be earned due to incompatibility with the current client.

Remarks

The rc_client_leaderboard_list_t instance created by this function must be released by calling rc_client_destroy_leaderboard_list.

The individual leaderboards in the list are owned by the loaded game and will be valid as long as the game remains loaded. They are the same pointers returned by rc_client_get_leaderboard_info. The data in each leaderboard will be updated dynamically.

Minimum version: 11.0.0

See also

rc_client_get_leaderboard_info

rc_client_destroy_leaderboard_list

rc_client_has_leaderboards

rcheevos

rc_client

Integration guide

client

user

game

processing

rc_client_raintegration

Integration guide

rc_runtime

rhash

rapi

common

user

runtime

info

Clone this wiki locally