Repository navigation
Add XP, levels and profile cosmetics - #65
Closed
professorDeveloper wants to merge 1 commit into
Closed
professorDeveloper wants to merge 1 commit into
professorDeveloper wants to merge 1 commit into
Conversation
A progress page with the level ring, recent XP and a locker for avatar frames, titles and name colours. Watch time goes to the server every ten minutes while playing and when the app goes to the background, as each day's running total so a retry adds nothing. Comment authors, social cards, activity cards and the profile header show the frame, name colour and level. A level-up is celebrated by the achievement celebration host. Nothing shows until the server answers /progress.
Owner
Author
|
Combined into one PR against release/3.2.1. |
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.
Adds XP, levels and profile cosmetics. Needs professorDeveloper/sozo-backend#78 for anything to show; without it every decoration stays hidden and the app behaves as before.
What it adds
lib/features/progress/:domain/progress.dart: the level curve (level n needsfloor(100·n^1.5)XP, the same as the server),LevelProgressfor the ring, and lenient parsing of/progressanswers and of thelevel / frame / title / nameColorfields on cards.data/progress_service.dart: the active profile's progress, cached per household profile, and level-up detection against the last level seen. The first level ever seen is a baseline, not a celebration.data/watch_time_uploader.dart: sendsWatchStatsStore.byDaytoPOST /api/progress/watch-timeas each day's running total for today and yesterday. It sends every ten minutes while the player ticks and when the app goes to the background (paused or hidden). Offline is handled by comparing against the last total sent, so nothing extra is stored. A random per-install device id lets two devices add up; it is kept out of backups.presentation/pages/progress_page.dart(/progress): level ring, XP to the next level, today's watch XP against the cap, how XP is earned, recent gains, and the locker. Tap an unlocked item to equip it, tap again to take it off. Locked items say which level or badge unlocks them.StreakBadge, which was unused, now sits in the app bar here.presentation/widgets/user_badge_line.dart:FramedAvatar,UserBadgeLine,LevelChipand theCosmeticsid → colour/words table.presentation/dialogs/level_up_dialog.dart, shown byAchievementCelebrationHostafter any badge dialog, never over the player.SocialAvatar(so every social list gets the frame),SocialUserTile, other users' profile header (with title), activity card actor line, and the own profile header (frame, name colour, level link to/progress).progress.*keys in all 16 locales, translated.test/features/progress/progress_test.dartcovers the level curve, parsing, level-up detection, upload batching, offline retry and replay safety.Not done
PartyMembercarries no level or cosmetics, so decorating it needs a backend watch-party change too. Not a trivial import, and another branch is editing watch party, so it is left out.Not verified