feat(daily): add daily rooms, streaks, and profile frames
A deterministic daily room rotates through the 30-level pool and tracks current and best streaks in save version 3. Daily wins are separate from campaign progress. The new Profile screen shows framed Crumb, stats, and selectable frames unlocked by rooms or best streak.
This commit is contained in:
1 parent
77ff5b48de
commit
7e6a338240
11 files changed
+680
-44
No files matched your search
+27
-7
@@ -21,6 +21,8 @@ var detail_meta: Label
|
||||
var detail_bio: Label
|
||||
var detail_snack: Label
|
||||
var detail_status: Label
|
||||
var crumb_frame_holder: CenterContainer
|
||||
var crumb_frame_id := ""
|
||||
|
||||
var _press_active := false
|
||||
var _press_at := 0
|
||||
@@ -90,19 +92,36 @@ func _ready() -> void:
|
||||
refresh()
|
||||
|
||||
|
||||
func _build_crumb_frame() -> void:
|
||||
if crumb_frame_holder == null:
|
||||
return
|
||||
var selected := SaveGame.selected_frame()
|
||||
if crumb_frame_id == selected and crumb_frame_holder.get_child_count() > 0:
|
||||
return
|
||||
for child in crumb_frame_holder.get_children():
|
||||
child.free()
|
||||
var frame := Frames.frame_panel(selected, 56)
|
||||
var portrait := TextureRect.new()
|
||||
portrait.custom_minimum_size = Vector2(44, 44)
|
||||
portrait.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||
portrait.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||||
portrait.texture = load("res://art/crumb_head.png")
|
||||
portrait.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||
frame.add_child(portrait)
|
||||
crumb_frame_holder.add_child(frame)
|
||||
crumb_frame_id = selected
|
||||
|
||||
|
||||
func _make_crumb_card() -> PanelContainer:
|
||||
var panel := UI.panel(Palette.PAPER, 14, 8)
|
||||
var row := HBoxContainer.new()
|
||||
row.add_theme_constant_override("separation", 8)
|
||||
panel.add_child(row)
|
||||
|
||||
var portrait := TextureRect.new()
|
||||
portrait.custom_minimum_size = Vector2(50, 50)
|
||||
portrait.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||
portrait.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||||
if ResourceLoader.exists("res://art/crumb_head.png"):
|
||||
portrait.texture = load("res://art/crumb_head.png")
|
||||
row.add_child(portrait)
|
||||
crumb_frame_holder = CenterContainer.new()
|
||||
crumb_frame_holder.custom_minimum_size = Vector2(56, 56)
|
||||
row.add_child(crumb_frame_holder)
|
||||
_build_crumb_frame()
|
||||
|
||||
var text := VBoxContainer.new()
|
||||
text.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||
@@ -124,6 +143,7 @@ func _make_crumb_card() -> PanelContainer:
|
||||
func refresh() -> void:
|
||||
if grid == null:
|
||||
return
|
||||
_build_crumb_frame()
|
||||
for child in grid.get_children():
|
||||
child.free()
|
||||
|
||||
|
||||
Reference in new issue
Block a user