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:
Ratdoku Builder committed 2026-12-02 23:57:28 -06:00
1 parent c91586b4a1
commit d0be689faa
16 files changed
+538 -60

No files matched your search

+24
View File
@@ -29,6 +29,30 @@ static func key_from_day_number(day: int) -> String:
return "%04d-%02d-%02d" % [int(d.get("year", 0)), int(d.get("month", 0)), int(d.get("day", 0))]
## Monday-to-Sunday keys for the week containing today.
static func week_keys() -> Array:
var date := Time.get_date_dict_from_system()
var weekday := int(date.get("weekday", 0)) # Godot: 0 = Sunday.
var monday_offset := (weekday + 6) % 7
var base := day_number(today_key()) - monday_offset
var out := []
for i in range(7):
out.append(key_from_day_number(base + i))
return out
static func weekday_labels() -> Array:
return ["MON", "TUE", "WED", "THU", "FRI", "SAT", "SUN"]
static func goal_text(streak: int) -> String:
if streak >= 7:
return "Week complete — your 7-day gift is ready."
if streak >= 3:
return "%d more day%s until the Night Owl frame" % [7 - streak, "" if 7 - streak == 1 else "s"]
return "%d more day%s until the Regular frame" % [3 - streak, "" if 3 - streak == 1 else "s"]
## Stable per-date room choice. With 30 rooms the pool repeats monthly.
static func level_index(level_count: int, key: String = "") -> int:
if level_count <= 0: