Skip to content

feat(achievements): persist unlocked achievements in settings.properties#423

Open
GVolquartsen wants to merge 1 commit into
jvondermarck:mainfrom
GVolquartsen:feature/achievement-persistence
Open

feat(achievements): persist unlocked achievements in settings.properties#423
GVolquartsen wants to merge 1 commit into
jvondermarck:mainfrom
GVolquartsen:feature/achievement-persistence

Conversation

@GVolquartsen

Copy link
Copy Markdown

πŸ“ What does this PR do?

Fixes the issue where achievements were showing as unlocked every time the game was relaunched. The solution now persists achievement unlock status to settings.properties, similar to how game settings are saved.

Changes:

  • Added getId() and getDescription() abstract methods to Achievement base class
  • Added setCompleted() method to allow restoring achievement state from disk
  • Updated AchievementManager to load completed achievements on startup and save when new achievements are unlocked
  • Created new AchievementsProvider utility class to handle reading/writing achievement data to settings.properties
  • Added unit test AchievementsProviderTest to verify persistence functionality

Result:

  • Achievements are now saved immediately when unlocked
  • Previously unlocked achievements load automatically on game restart
  • Duplicate achievement popups no longer appear

@vercel

vercel Bot commented May 7, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
dinosaur-exploder Ignored Ignored Preview May 7, 2026 8:02pm

@sonarqubecloud

sonarqubecloud Bot commented May 7, 2026

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

πŸ‘‹ Hello @GVolquartsen, thank you for submitting in Dinosaur Exploder πŸ¦– PR! To allow your work to be integrated as seamlessly as possible, we advise you to:

  • βœ… Verify your PR is up-to-date with the repository /dinosaur-exploder main branch. If your PR is behind you can update your code by clicking the 'Update branch' button or by running git pull and git merge master locally.
  • βœ… Verify all Dinosaur Exploder Continuous Integration (CI) checks are passing.
  • βœ… Verify that you have well fill out the different checkboxes in the PR template.
  • ⚠️ Check that your code is clean: no code redundancy, variable and method names are correct, your code is understandable to everyone, and so on.
  • πŸ’‘ Reduce changes to the absolute minimum required for your bug fix or feature addition. "It is not daily increase but daily decrease, hack away the unessential. The closer to the source, the less wastage there is." β€” Bruce Lee

import java.util.stream.Collectors;
import com.dinosaur.dinosaurexploder.utils.AchievementsProvider;
import java.util.ArrayList;
import java.util.HashSet;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[πŸ’„Spotless - Format] reported by reviewdog 🐢

Suggested change
import java.util.HashSet;

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

🎨 Code Formatting Issues

badge

1 Java file(s) need formatting.

πŸ’‘ Quick fix

Click the suggestions below:

  1. Go to "Files changed" tab
  2. Click βœ… Commit suggestion on each [πŸ’„ Spotless] comment

Or run locally:

mvn spotless:apply
git add -A && git commit -m "style: apply Spotless" && git push
πŸ“š More options

Auto-format in your IDE:

Style guide: Google Java Style Guide


πŸ€– The DinoBot Team πŸ¦–

@github-actions

github-actions Bot commented May 7, 2026

Copy link
Copy Markdown
Contributor

❌ Build Failed

badge-fail

Thanks for your contribution to this open-source project! ❀️

Unfortunately the build for this pull request has failed:

  • 🚩 Workflow Run: View Logs
  • πŸ”– Commit: 679fc6771b4110ec8a179ded4f44c07b7e4e3bbd

Tip

Please check the logs and fix any issues before re-running the workflow.

Good luck with your debugging! πŸ› (or should I say dino-bugging? πŸ¦–)

The DinoBot Team πŸ¦–

@jvondermarck jvondermarck added status: in-review PR currently in review status: pending-request-changes Request changes from the contributor labels May 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

status: in-review PR currently in review status: pending-request-changes Request changes from the contributor

Projects

Development

Successfully merging this pull request may close these issues.

2 participants