Skip to content

rc_client_create_achievement_list

Jamiras edited this page Sep 16, 2023 · 5 revisions

Creates a new list of achievements matching the specified category and grouping.

Syntax

rc_client_achievement_list_t* rc_client_create_achievement_list(
    rc_client_t* client,
    int category,
    int grouping
);

Parameters

client

The rc_client_t containing a loaded game.

category

The category of achievements to retrieve.

Valid values are RC_CLIENT_ACHIEVEMENT_CATEGORY_CORE, RC_CLIENT_ACHIEVEMENT_CATEGORY_UNOFFICIAL, and RC_CLIENT_ACHIEVEMENT_CATEGORY_CORE_AND_UNOFFICIAL.

grouping

How the achievements should be grouped within the list.

grouping description
RC_CLIENT_ACHIEVEMENT_LIST_GROUPING_LOCK_STATE Separates achievements into Locked, Unofficial, Unsupported, and Unlocked buckets.
RC_CLIENT_ACHIEVEMENT_LIST_GROUPING_PROGRESS Separates achievements into Active Challenges, Recently Unlocked, Almost There, Locked, Unofficial, Unsupported, and Unlocked buckets.

Return value

Pointer to a rc_client_achievement_list_t object containing the achievements for the game, grouped as requested.

It must be released by calling rc_client_destroy_achievement_list.


rc_client_achievement_list_t

typedef struct rc_client_achievement_list_t
{
  rc_client_achievement_bucket_t* buckets;
  uint32_t num_buckets;
} rc_client_achievement_list_t;

buckets

An array of buckets each containing 1 or more achievements.

num_buckets

The number of elements in the buckets array.


rc_client_achievement_bucket_t

typedef struct rc_client_achievement_bucket_t {
  rc_client_achievement_t** achievements;
  uint32_t num_achievements;

  const char* label;
  uint32_t subset_id;
  uint8_t bucket_type;
} rc_client_achievement_bucket_t;

achievements

An array of pointers to achievement information. Each item is the same data returned by rc_client_get_achievement_info.

num_achievements

The number of elements in the achievements 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.

bucket_type

A unique identifier for the bucket.

id label description
RC_CLIENT_ACHIEVEMENT_BUCKET_ACTIVE_CHALLENGE Active Challenges If implemented, a challenge indicator for the achievement is visible.
RC_CLIENT_ACHIEVEMENT_BUCKET_RECENTLY_UNLOCKED Recently Unlocked Any achievements unlocked in the last ten minutes.
RC_CLIENT_ACHIEVEMENT_BUCKET_ALMOST_THERE Almost There Any achievements that track progress where the progress percentage is 80% or more.
RC_CLIENT_ACHIEVEMENT_BUCKET_LOCKED Locked Achievements the player has not yet earned (if not present in the Active Challenge, Almost There, or Unofficial buckets).
RC_CLIENT_ACHIEVEMENT_BUCKET_UNOFFICIAL Unofficial Achievements that are not eligible to be earned at this time.
RC_CLIENT_ACHIEVEMENT_BUCKET_UNSUPPORTED Unsupported Achievements that cannot be earned due to incompatibility with the current client.
RC_CLIENT_ACHIEVEMENT_BUCKET_UNLOCKED Unlocked Achievements the player has previously earned (if not present in the Recently Unlocked bucket).

Remarks

The rc_client_achievement_list_t instance created by this function must be released by calling rc_client_destroy_achievement_list.

The individual achievements 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_achievement_info. Most of the data in each achievement will be updated dynamically. See rc_client_get_achievement_info for fields that are only updated on demand.

Minimum version: 11.0.0

See also

rc_client_get_achievement_info

rc_client_destroy_achievement_list

rc_client_has_achievements

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