Skip to content

Commit

Permalink
add rarity and points to achievement unlock widget
Browse files Browse the repository at this point in the history
  • Loading branch information
Jamiras committed Jun 11, 2024
1 parent 6e057ab commit c9eee46
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions cheevos/cheevos.c
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,15 @@ static void rcheevos_award_achievement(const rc_client_achievement_t* cheevo)
#if defined(HAVE_GFX_WIDGETS)
if (gfx_widgets_ready())
{
gfx_widgets_push_achievement(msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED),
cheevo->title, cheevo->badge_name);
char title[128], subtitle[96];
snprintf(title, sizeof(title), "%s - %0.2f%%",
msg_hash_to_str(MSG_ACHIEVEMENT_UNLOCKED),
rc_client_get_hardcore_enabled(rcheevos_locals.client) ?
cheevo->rarity_hardcore : cheevo->rarity);

snprintf(subtitle, sizeof(subtitle), "%s (%d)", cheevo->title, cheevo->points);

gfx_widgets_push_achievement(title, subtitle, cheevo->badge_name);
}
else
#endif
Expand Down

0 comments on commit c9eee46

Please sign in to comment.