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
+19
-4
@@ -6,13 +6,16 @@ signal settings_pressed
|
||||
signal rules_pressed
|
||||
signal daily_pressed
|
||||
signal profile_pressed
|
||||
signal streak_pressed
|
||||
|
||||
var progress_pill: Button
|
||||
var primary: Button
|
||||
var hint_label: Label
|
||||
var daily_button: Button
|
||||
var streak_button: Button
|
||||
var avatar_holder: CenterContainer
|
||||
var avatar_frame_id := ""
|
||||
var avatar_portrait_id := ""
|
||||
|
||||
|
||||
func _ready() -> void:
|
||||
@@ -62,10 +65,18 @@ func _ready() -> void:
|
||||
column.add_child(UI.label("A cozy rat hotel puzzle", 15, Palette.MUTED))
|
||||
|
||||
daily_button = UI.button("Daily room", false, 40)
|
||||
daily_button.custom_minimum_size = Vector2(0, 40)
|
||||
daily_button.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
daily_button.add_theme_font_size_override("font_size", 13)
|
||||
daily_button.pressed.connect(func() -> void: daily_pressed.emit())
|
||||
column.add_child(daily_button)
|
||||
streak_button = UI.button("Streak ›", false, 40)
|
||||
streak_button.custom_minimum_size = Vector2(96, 40)
|
||||
streak_button.add_theme_font_size_override("font_size", 12)
|
||||
streak_button.pressed.connect(func() -> void: streak_pressed.emit())
|
||||
var daily_row := HBoxContainer.new()
|
||||
daily_row.add_theme_constant_override("separation", 6)
|
||||
daily_row.add_child(daily_button)
|
||||
daily_row.add_child(streak_button)
|
||||
column.add_child(daily_row)
|
||||
|
||||
var top_space := Control.new()
|
||||
top_space.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||
@@ -151,7 +162,7 @@ func _build_avatar() -> void:
|
||||
var avatar := Button.new()
|
||||
avatar.custom_minimum_size = Vector2(44, 44)
|
||||
avatar.flat = true
|
||||
avatar.icon = load("res://art/crumb_head.png")
|
||||
avatar.icon = load(Avatars.portrait_path(SaveGame.selected_avatar()))
|
||||
avatar.expand_icon = true
|
||||
avatar.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
avatar.alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||
@@ -160,10 +171,14 @@ func _build_avatar() -> void:
|
||||
frame.add_child(avatar)
|
||||
avatar_holder.add_child(frame)
|
||||
avatar_frame_id = SaveGame.selected_frame()
|
||||
avatar_portrait_id = SaveGame.selected_avatar()
|
||||
|
||||
|
||||
func _refresh_avatar() -> void:
|
||||
if avatar_frame_id == SaveGame.selected_frame():
|
||||
if (
|
||||
avatar_frame_id == SaveGame.selected_frame()
|
||||
and avatar_portrait_id == SaveGame.selected_avatar()
|
||||
):
|
||||
return
|
||||
for child in avatar_holder.get_children():
|
||||
child.queue_free()
|
||||
|
||||
Reference in new issue
Block a user