feat(achievements): persist unlocked achievements in settings.properties#423
feat(achievements): persist unlocked achievements in settings.properties#423GVolquartsen wants to merge 1 commit into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
|
There was a problem hiding this comment.
π 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-explodermainbranch. If your PR is behind you can update your code by clicking the 'Update branch' button or by runninggit pullandgit merge masterlocally. - β 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; |
There was a problem hiding this comment.
[πSpotless - Format] reported by reviewdog πΆ
| import java.util.HashSet; |
π¨ Code Formatting Issues1 Java file(s) need formatting. π‘ Quick fixClick the suggestions below:
Or run locally: mvn spotless:apply
git add -A && git commit -m "style: apply Spotless" && git pushπ More optionsAuto-format in your IDE:
Style guide: Google Java Style Guide π€ The DinoBot Team π¦ |
β Build FailedThanks for your contribution to this open-source project! β€οΈ Unfortunately the build for this pull request has failed:
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 π¦ |



π 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:
getId()andgetDescription()abstract methods toAchievementbase classsetCompleted()method to allow restoring achievement state from diskAchievementManagerto load completed achievements on startup and save when new achievements are unlockedAchievementsProviderutility class to handle reading/writing achievement data tosettings.propertiesAchievementsProviderTestto verify persistence functionalityResult: