Add extensible Achievement API#88
Draft
HayashiUme wants to merge 2 commits into
Draft
Conversation
Author
|
Due to some overlap with existing APIs, it has been converted to Draft upon request. If you remain interested, you can restart and merge it into the main branch |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
Add an extensible achievement API to MiraAPI. The API provides only data logic
— no UI, no networking. The Example project demonstrates how to build title
display, RPC sync, and chat commands on top of it.
API (
MiraAPI/Achievements/)IAchievement— interface for defining custom achievementsBaseAchievement— abstract base with built-in progress trackingAchievementManager— registry, progress, titles, encrypted file persistenceAchievementTier— rarity enum (Common → Legendary)AchievementUnlockedEvent— MiraEvent fired on first unlockPersistence
Application.persistentDataPath/mira_achievement/{ModGuid}/Achievement.datmira_presets/— one folder per mod GUIDExample (
MiraAPI.Example/Achievements/)MadKillerAchievement/FirstVictoryAchievement— sample achievements/achievement <id>— equip an unlocked title in chat/achievement unlock <id>— force-unlock for testingAchievementTitleComponent— shows[Title]above player nameTitleSyncRpc— syncs equipped title across networkScope
This is the minimal foundation. Extension ideas that consumers can build on top:
Notes
Extensive XML doc comments are included on all public members to fully
demonstrate the API surface. Some phrasing may be slightly off — I'm not a
native English speaker and relied on translation tools for parts of the docs.