Skip to content

Add RetroAchievements challenge indicators - #817

Open
clintonium-119 wants to merge 2 commits into
LoveRetro:mainfrom
clintonium-119:ra-challenge-indicators
Open

Add RetroAchievements challenge indicators#817
clintonium-119 wants to merge 2 commits into
LoveRetro:mainfrom
clintonium-119:ra-challenge-indicators

Conversation

@clintonium-119

Copy link
Copy Markdown

What

Surfaces RetroAchievements challenge achievements — those with a currently primed trigger, such as a no-damage run already in progress — in two places: a trophy pill in the lower-right corner during gameplay, and pinned-to-top rows with a trophy glyph in the in-game achievement list. Adds a "Show Challenge Indicators" setting, default on, directly below "Show Notifications".

Why

rcheevos already fires RC_CLIENT_EVENT_ACHIEVEMENT_CHALLENGE_INDICATOR_SHOW and ..._HIDE, and NextUI already handles both events — by writing a debug log line that release builds compile out. The data was already arriving and being thrown away. Without an indicator there is no way for a player to tell that a challenge is armed, so a failed no-damage run is only discovered afterwards, which is precisely the feedback the challenge-indicator event exists to provide.

Surfaces

  • During gameplay — a trophy pill in the lower-right while any challenge is active: a trophy alone for one, trophy plus +N for more. The lower-right corner is currently uncontested, with progress indicators rendering top-left and system indicators top-right.
  • In the in-game achievement list — active challenges pinned to the top with a trophy glyph before the title, leaving the remainder of the list in the player's chosen sort order.

Notes for review

  • The achievement list is now built with RC_CLIENT_ACHIEVEMENT_LIST_GROUPING_PROGRESS, which is what surfaces the ACTIVE_CHALLENGE bucket at all. A two-pass flatten pins challenges above the sorted tail, so pinning does not disturb the player's sort setting.
  • Row rendering reads each achievement's own bucket field rather than keeping a snapshot of active ids. The field is already live on every pointer the list hands back, so there is nothing to cache and nothing to bound.
  • HIDE is wired unconditionally, ignoring the setting, so an indicator cannot be left stranded on screen.
  • The atlas gains one glyph. A pixel diff against the previous assets@1x.png confines every difference to the new trophy rect; nothing is re-laid-out and the image dimensions are unchanged.
  • This is independent of the pending hardcore-mode work and carries none of it.

Testing

Tested on a TrimUI Brick running firmware 1.1.0, built for tg5040. Verified: the setting appears and defaults on and survives a reboot; a started challenge draws the pill and ending it removes the pill; two or more active challenges render +N correctly; launching with the setting off suppresses the pill; unloading the game clears it; the list pins challenges first with the glyph; pin order holds across sort changes and the locked-only filter; and the trophy tint matches the sibling mute and wifi-off icons. No new compiler warnings.

Contra 2026-08-19-15-18-18 Contra 2026-08-19-15-24-49

Surface active "challenge" achievements (a primed trigger, e.g. a
no-damage
run in progress) both on-screen during gameplay and in the in-game menu.
rcheevos already fired CHALLENGE_INDICATOR_SHOW/HIDE; these were only
logged.

Asset:
- New ASSET_TROPHY atlas glyph (trophy cup) added to assets@1-4x.png and
  assets.svg, slotted next to the other small icons. White silhouette so
it
  tints via the existing colormod path like ASSET_LOCK.

On-screen indicator:
- New raShowChallengeIndicators setting (default on), mirroring
  raShowNotifications, with a "Show Challenge Indicators" toggle in
Settings.
- notification.c tracks active challenges by id (idempotent show/hide,
so
  duplicate SHOW or out-of-order HIDE are safe) and renders a trophy
pill in
  the lower-right: a single trophy when one challenge is active, trophy
+ "+N"
  when more. Mutex-guarded to match the progress-indicator pattern;
cleared on
  game unload via Notification_clear/quit.
- ra_integration.c wires the SHOW/HIDE events to the new API (SHOW
honors the
  setting; HIDE always fires so an indicator can't get stuck on screen).

In-game menu:
- Achievement list now groups by PROGRESS so the ACTIVE_CHALLENGE bucket
is
  surfaced. Active challenges are pinned to the top (unsorted); only the
  remaining tail is sorted by the user's chosen order. Pinned rows get a
  trophy glyph before the title. Empty challenge bucket leaves the menu
  unchanged; challenges survive the locked-only filter.
The in-game achievement list recorded active-challenge ids into a
fixed 16-entry snapshot at menu open and consulted it per row, so
rows past the sixteenth lost their trophy glyph even though they
still pinned to the top correctly.

Every achievement pointer the list hands back already carries a
live bucket field, so the snapshot, its cap, and its lookup helper
are all redundant. Rows now test bucket directly.
@clintonium-119
clintonium-119 force-pushed the ra-challenge-indicators branch from d68751e to 2124726 Compare August 19, 2026 19:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant