Skip to content

[PL-78] - Fix issue#57

Merged
kzryzstof merged 4 commits intomainfrom
features/pl-78/fix-retro-achievements
Apr 12, 2026
Merged

[PL-78] - Fix issue#57
kzryzstof merged 4 commits intomainfrom
features/pl-78/fix-retro-achievements

Conversation

@kzryzstof
Copy link
Copy Markdown
Collaborator

This pull request adds support for tracking and displaying "measured progress" (such as "5/10") for achievements, improves the handling of achievement unlock timestamps, and refines the achievement display cycle to ensure the UI is never blank at session start. It also enhances session and achievement state management to avoid race conditions and stale data.

Achievement structure and progress tracking:

  • Added a measured_progress field to achievement_t and retro_achievement_t structs, along with support for copying, freeing, and parsing this field from JSON messages. This allows achievements with partial progress to display their current state (e.g., "5/10"). [1] [2] [3] [4] [5] [6] [7]

  • Updated the JSON protocol and documentation to include measured_progress and unlock_time for achievements. [1] [2]

Achievement unlock timestamp improvements:

  • Improved handling of achievement unlock timestamps by using the real unlock_time when available, or a sentinel value when not, ensuring accurate and consistent unlock tracking. [1] [2]

Achievement display cycle and UI experience:

  • Enhanced the achievement display cycle so that if there are no unlocked achievements, a random locked achievement is shown immediately, preventing the display from being blank at session start. [1] [2]

  • Ensured proper freeing of the last unlocked achievement when the game changes, preventing memory leaks and dangling pointers.

Session and achievement state management:

  • Refined the order of notifications and state changes when games or connections change, preventing race conditions where UI could be blanked out or left in a stale state. This includes firing notify_game_played and notify_active_identity before clearing achievements, and only firing notify_session_ready when a game is active. [1] [2]

@kzryzstof kzryzstof marked this pull request as ready for review April 12, 2026 13:54
@kzryzstof kzryzstof merged commit 4643ed7 into main Apr 12, 2026
7 checks passed
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