feat(profile): selectable avatars and a daily streak view
Profile now has tabbed Avatar/Frame pickers with preview and Confirm/Cancel. Crumb plus unlocked guest portraits can be chosen as the avatar. A new Daily Streak screen shows the current streak, best streak, weekly calendar, next-frame goal, and a 7-day gift marker. Save format moves to version 4 with avatar_id and completion history.
This commit is contained in:
1 parent
c91586b4a1
commit
d0be689faa
16 files changed
+538
-60
No files matched your search
+15
-4
@@ -169,6 +169,8 @@ func _test_daily_and_frames(save, main) -> void:
|
||||
await process_frame
|
||||
_check(main.profile != null, "Profile screen missing")
|
||||
if main.profile != null:
|
||||
main.profile._set_tab("frame")
|
||||
await process_frame
|
||||
_check(
|
||||
main.profile.frame_grid.get_child_count() == frames.all().size(),
|
||||
"Profile should show every frame"
|
||||
@@ -187,11 +189,20 @@ func _test_daily_and_frames(save, main) -> void:
|
||||
main.profile.frame_grid.get_child(regular_index).pressed.emit()
|
||||
await process_frame
|
||||
await process_frame
|
||||
_check(save.selected_frame() == "regular", "frame press should select the frame")
|
||||
_check(main.profile.pending_frame == "regular", "frame card should update the preview")
|
||||
main.profile._on_confirm()
|
||||
await process_frame
|
||||
_check(save.selected_frame() == "regular", "confirm should apply the frame")
|
||||
_check(
|
||||
main.profile.frame_grid.get_child_count() == frames.all().size(),
|
||||
"frame grid should stay stable after selection"
|
||||
)
|
||||
main.profile._set_tab("avatar")
|
||||
await process_frame
|
||||
_check(main.profile.frame_grid.get_child_count() > 10, "avatar tab should list portraits")
|
||||
main.home.streak_pressed.emit()
|
||||
await process_frame
|
||||
_check(main.current == "streak", "streak button should open the streak screen")
|
||||
main.show_screen("home")
|
||||
main.home.daily_pressed.emit()
|
||||
await process_frame
|
||||
@@ -205,12 +216,12 @@ func _test_daily_and_frames(save, main) -> void:
|
||||
|
||||
|
||||
func _test_save_defaults(save) -> void:
|
||||
# A fresh save starts in double-tap mode at version 2.
|
||||
# A fresh save starts in double-tap mode at version 4.
|
||||
var abs_path := ProjectSettings.globalize_path(save.PATH)
|
||||
if FileAccess.file_exists(save.PATH):
|
||||
DirAccess.remove_absolute(abs_path)
|
||||
save.load_game()
|
||||
_check(int(save.data.get("version", 0)) == 3, "fresh saves should be version 3")
|
||||
_check(int(save.data.get("version", 0)) == 4, "fresh saves should be version 4")
|
||||
_check(bool(save.get_setting("double_tap_place")), "fresh saves should default to double-tap")
|
||||
|
||||
# A version 1 save with hold selected migrates to double-tap once.
|
||||
@@ -222,7 +233,7 @@ func _test_save_defaults(save) -> void:
|
||||
file.close()
|
||||
|
||||
save.load_game()
|
||||
_check(int(save.data.get("version", 0)) == 3, "version 1 saves should migrate to version 3")
|
||||
_check(int(save.data.get("version", 0)) == 4, "version 1 saves should migrate to version 4")
|
||||
_check(bool(save.get_setting("double_tap_place")), "version 1 saves should migrate to double-tap")
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user