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

+56
View File
@@ -0,0 +1,56 @@
class_name Avatars
extends RefCounted
## Selectable profile portraits. Crumb is always available; guest portraits
## unlock with the corresponding Guest Book entry.
static func all() -> Array:
var out := [{
"id": "crumb",
"name": "Crumb",
"path": "res://art/crumb_head.png",
"room": 0,
}]
for guest in Guests.all():
var id := str(guest.get("id", ""))
if id.is_empty():
continue
out.append({
"id": id,
"name": str(guest.get("name", id)),
"path": Guests.portrait(id, "thumbs"),
"room": int(guest.get("unlock_room", 0)),
})
return out
static func by_id(id: String) -> Dictionary:
for avatar in all():
if str(avatar.get("id", "")) == id:
return avatar
return {}
static func portrait_path(id: String) -> String:
var avatar := by_id(id)
if avatar.is_empty():
return "res://art/crumb_head.png"
return str(avatar.get("path", "res://art/crumb_head.png"))
static func is_unlocked(id: String) -> bool:
if id == "crumb":
return true
var avatar := by_id(id)
if avatar.is_empty():
return false
return SaveGame.is_guest_unlocked(id)
static func requirement_text(id: String) -> String:
var avatar := by_id(id)
if avatar.is_empty():
return ""
if id == "crumb":
return "Always available"
return "Meet in Room %d" % int(avatar.get("room", 0))
+1
View File
@@ -0,0 +1 @@
uid://c5700f5m3iuxh
+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:
+19 -4
View File
@@ -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()
+9
View File
@@ -5,6 +5,7 @@ const GameScene = preload("res://scenes/Game.tscn")
const GuestBookScene = preload("res://scenes/GuestBook.tscn")
const RulebookScene = preload("res://scenes/Rulebook.tscn")
const ProfileScene = preload("res://scenes/Profile.tscn")
const StreakScene = preload("res://scenes/Streak.tscn")
const SettingsSheetScene = preload("res://scenes/SettingsSheet.tscn")
var home
@@ -12,6 +13,7 @@ var game
var guest_book
var rulebook
var profile
var streak
var settings_sheet
var screens := {}
var current := "home"
@@ -33,6 +35,7 @@ func _ready() -> void:
home.rules_pressed.connect(func() -> void: show_screen("rules"))
home.daily_pressed.connect(_on_daily)
home.profile_pressed.connect(func() -> void: show_screen("profile"))
home.streak_pressed.connect(func() -> void: show_screen("streak"))
game = GameScene.instantiate()
_add_screen(game)
@@ -51,6 +54,11 @@ func _ready() -> void:
profile = ProfileScene.instantiate()
_add_screen(profile)
profile.back_pressed.connect(go_back)
profile.streak_pressed.connect(func() -> void: show_screen("streak"))
streak = StreakScene.instantiate()
_add_screen(streak)
streak.back_pressed.connect(go_back)
settings_sheet = SettingsSheetScene.instantiate()
add_child(settings_sheet)
@@ -67,6 +75,7 @@ func _ready() -> void:
"guest_book": guest_book,
"rules": rulebook,
"profile": profile,
"streak": streak,
}
show_screen("home", false)
+111 -32
View File
@@ -1,14 +1,22 @@
extends Control
signal back_pressed
signal streak_pressed
var portrait_holder: CenterContainer
var name_label: Label
var role_label: Label
var rooms_label: Label
var streak_label: Label
var best_label: Label
var frame_grid: GridContainer
var status_label: Label
var portrait_frame_id := ""
var avatar_tab: Button
var frame_tab: Button
var current_tab := "avatar"
var pending_avatar := "crumb"
var pending_frame := "plain"
var portrait_key := ""
func _ready() -> void:
@@ -32,7 +40,7 @@ func _ready() -> void:
back.pressed.connect(func() -> void: back_pressed.emit())
top.add_child(back)
var title := UI.label("Crumb's Profile", 22)
var title := UI.label("Profile", 22)
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
title.size_flags_horizontal = Control.SIZE_EXPAND_FILL
top.add_child(title)
@@ -51,8 +59,10 @@ func _ready() -> void:
portrait_holder = CenterContainer.new()
content.add_child(portrait_holder)
content.add_child(UI.label("Crumb", 20, Palette.INK, true))
content.add_child(UI.label("Innkeeper · always in", 11, Palette.MUTED))
name_label = UI.label("Crumb", 20, Palette.INK, true)
content.add_child(name_label)
role_label = UI.label("Innkeeper · always in", 11, Palette.MUTED)
content.add_child(role_label)
var stats := HBoxContainer.new()
stats.add_theme_constant_override("separation", 6)
@@ -61,7 +71,23 @@ func _ready() -> void:
streak_label = _stat_card(stats, "Streak", "0")
best_label = _stat_card(stats, "Best", "0")
content.add_child(UI.heading("Frames", 18))
var view_streak := UI.button("View daily streak ›", false, 40)
view_streak.add_theme_font_size_override("font_size", 14)
view_streak.pressed.connect(func() -> void: streak_pressed.emit())
content.add_child(view_streak)
var tabs := HBoxContainer.new()
tabs.add_theme_constant_override("separation", 6)
content.add_child(tabs)
avatar_tab = UI.button("Avatar", false, 38)
avatar_tab.size_flags_horizontal = Control.SIZE_EXPAND_FILL
avatar_tab.pressed.connect(func() -> void: _set_tab("avatar"))
tabs.add_child(avatar_tab)
frame_tab = UI.button("Frame", false, 38)
frame_tab.size_flags_horizontal = Control.SIZE_EXPAND_FILL
frame_tab.pressed.connect(func() -> void: _set_tab("frame"))
tabs.add_child(frame_tab)
frame_grid = GridContainer.new()
frame_grid.columns = 2
frame_grid.size_flags_horizontal = Control.SIZE_EXPAND_FILL
@@ -69,10 +95,22 @@ func _ready() -> void:
frame_grid.add_theme_constant_override("v_separation", 6)
content.add_child(frame_grid)
status_label = UI.label("Tap an unlocked frame to wear it.", 11, Palette.MUTED)
status_label = UI.label("Pick a look, then confirm.", 11, Palette.MUTED)
status_label.custom_minimum_size = Vector2(0, 22)
content.add_child(status_label)
var actions := HBoxContainer.new()
actions.add_theme_constant_override("separation", 8)
content.add_child(actions)
var cancel := UI.button("Cancel", false, 46)
cancel.size_flags_horizontal = Control.SIZE_EXPAND_FILL
cancel.pressed.connect(_on_cancel)
actions.add_child(cancel)
var confirm := UI.button("Confirm", true, 46)
confirm.size_flags_horizontal = Control.SIZE_EXPAND_FILL
confirm.pressed.connect(_on_confirm)
actions.add_child(confirm)
UI.pass_scroll_input(content)
SaveGame.progress_changed.connect(refresh)
refresh()
@@ -92,46 +130,68 @@ func _stat_card(parent: HBoxContainer, title: String, value: String) -> Label:
func refresh() -> void:
pending_avatar = SaveGame.selected_avatar()
pending_frame = SaveGame.selected_frame()
rooms_label.text = "%d / 30" % SaveGame.rooms_completed()
streak_label.text = str(SaveGame.daily_streak())
best_label.text = str(SaveGame.best_streak())
var avatar: Dictionary = Avatars.by_id(pending_avatar)
name_label.text = str(avatar.get("name", "Crumb"))
role_label.text = "Innkeeper · always in" if pending_avatar == "crumb" else "Guest · Hotel Ratdoku"
status_label.text = "Pick a look, then confirm."
status_label.add_theme_color_override("font_color", Palette.MUTED)
_update_tab_styles()
_build_portrait()
_build_frames()
_build_grid()
func _set_tab(tab: String) -> void:
if current_tab == tab:
return
current_tab = tab
_update_tab_styles()
_build_grid()
func _update_tab_styles() -> void:
avatar_tab.add_theme_stylebox_override("normal", _card_style(Palette.GOLD if current_tab == "avatar" else Palette.PAPER))
frame_tab.add_theme_stylebox_override("normal", _card_style(Palette.GOLD if current_tab == "frame" else Palette.PAPER))
func _build_portrait() -> void:
var selected := SaveGame.selected_frame()
if portrait_frame_id == selected and portrait_holder.get_child_count() > 0:
var key: String = pending_avatar + "|" + pending_frame
if portrait_key == key and portrait_holder.get_child_count() > 0:
return
for child in portrait_holder.get_children():
child.queue_free()
var frame := Frames.frame_panel(selected, 118)
var frame := Frames.frame_panel(pending_frame, 118)
var head := TextureRect.new()
head.texture = load("res://art/crumb_head.png")
head.texture = load(Avatars.portrait_path(pending_avatar))
head.custom_minimum_size = Vector2(96, 96)
head.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
head.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
head.mouse_filter = Control.MOUSE_FILTER_IGNORE
frame.add_child(head)
portrait_holder.add_child(frame)
portrait_frame_id = selected
portrait_key = key
func _build_frames() -> void:
func _build_grid() -> void:
for child in frame_grid.get_children():
child.queue_free()
var selected := SaveGame.selected_frame()
for frame in Frames.all():
var id := str(frame.get("id", ""))
var unlocked := Frames.is_unlocked(id)
var entries: Array = Avatars.all() if current_tab == "avatar" else Frames.all()
var selected := pending_avatar if current_tab == "avatar" else pending_frame
for entry in entries:
var id := str(entry.get("id", ""))
var unlocked := Avatars.is_unlocked(id) if current_tab == "avatar" else Frames.is_unlocked(id)
var card := Button.new()
card.custom_minimum_size = Vector2(148, 92)
card.flat = true
card.add_theme_stylebox_override("normal", _card_style(Palette.PAPER))
card.add_theme_stylebox_override("hover", _card_style(Palette.PAPER_DARK))
card.add_theme_stylebox_override("pressed", _card_style(Palette.GOLD))
card.pressed.connect(_on_frame_pressed.bind(id, unlocked))
card.pressed.connect(_on_card_pressed.bind(id, unlocked, current_tab))
var row := HBoxContainer.new()
row.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
@@ -139,10 +199,10 @@ func _build_frames() -> void:
row.mouse_filter = Control.MOUSE_FILTER_IGNORE
card.add_child(row)
var badge := Frames.frame_panel(id, 46)
var badge := Frames.frame_panel(pending_frame if current_tab == "avatar" else id, 46)
badge.mouse_filter = Control.MOUSE_FILTER_IGNORE
var head := TextureRect.new()
head.texture = load("res://art/crumb_head.png")
head.texture = load(Avatars.portrait_path(id) if current_tab == "avatar" else "res://art/crumb_head.png")
head.custom_minimum_size = Vector2(30, 30)
head.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
head.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
@@ -156,18 +216,18 @@ func _build_frames() -> void:
text.mouse_filter = Control.MOUSE_FILTER_IGNORE
row.add_child(text)
var name := UI.label(str(frame.get("name", "")), 12)
var name := UI.label(str(entry.get("name", "")), 12)
name.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
text.add_child(name)
var detail := ""
if id == selected:
detail = "Wearing"
detail = "Selected"
elif unlocked:
detail = "Unlocked"
else:
detail = Frames.requirement_text(id)
var sub := UI.label(detail, 9, Palette.MUTED if unlocked else Palette.RED)
detail = Avatars.requirement_text(id) if current_tab == "avatar" else Frames.requirement_text(id)
var sub := UI.label(detail, 9, Palette.GOLD if id == selected else (Palette.MUTED if unlocked else Palette.RED))
sub.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
text.add_child(sub)
@@ -178,19 +238,38 @@ func _build_frames() -> void:
UI.pass_scroll_input(frame_grid)
func _on_frame_pressed(id: String, unlocked: bool) -> void:
func _on_card_pressed(id: String, unlocked: bool, tab: String) -> void:
if not unlocked:
status_label.text = "Locked: %s." % Frames.requirement_text(id)
var requirement := Avatars.requirement_text(id) if tab == "avatar" else Frames.requirement_text(id)
status_label.text = "Locked: %s." % requirement
status_label.add_theme_color_override("font_color", Palette.RED)
return
# Never rebuild the card grid while the card's own `pressed` signal is
# still on the stack; Godot locks the emitting node during the call.
call_deferred("_apply_frame", id)
call_deferred("_select_card", id, tab)
func _apply_frame(id: String) -> void:
SaveGame.select_frame(id)
status_label.text = "Now wearing %s." % str(Frames.by_id(id).get("name", id))
func _select_card(id: String, tab: String) -> void:
if tab == "avatar":
pending_avatar = id
else:
pending_frame = id
_build_portrait()
_build_grid()
status_label.text = "Preview only — press Confirm to save."
status_label.add_theme_color_override("font_color", Palette.MUTED)
func _on_cancel() -> void:
pending_avatar = SaveGame.selected_avatar()
pending_frame = SaveGame.selected_frame()
_build_portrait()
_build_grid()
status_label.text = "Changes discarded."
status_label.add_theme_color_override("font_color", Palette.MUTED)
func _on_confirm() -> void:
SaveGame.apply_profile(pending_avatar, pending_frame)
status_label.text = "Profile updated."
status_label.add_theme_color_override("font_color", Palette.MUTED)
+40 -4
View File
@@ -28,24 +28,26 @@ func _default_daily() -> Dictionary:
"last_completed": "",
"streak": 0,
"best_streak": 0,
"history": [],
}
func _default_data() -> Dictionary:
return {
"version": 3,
"version": 4,
"completed_rooms": [],
"unlocked_guests": [],
"settings": DEFAULTS.duplicate(true),
"last_room": 0,
"daily": _default_daily(),
"profile_frame": "plain",
"avatar_id": "crumb",
}
func load_game() -> void:
data = _default_data()
var stored_version := 3
var stored_version := 4
if FileAccess.file_exists(PATH):
var file := FileAccess.open(PATH, FileAccess.READ)
@@ -72,15 +74,21 @@ func load_game() -> void:
data["daily"][key] = daily_defaults[key]
if typeof(data.get("profile_frame")) != TYPE_STRING or str(data["profile_frame"]).is_empty():
data["profile_frame"] = "plain"
if typeof(data.get("avatar_id")) != TYPE_STRING or str(data["avatar_id"]).is_empty():
data["avatar_id"] = "crumb"
if typeof(data["daily"].get("history")) != TYPE_ARRAY:
data["daily"]["history"] = []
var migrated := false
# Version 2 made double-tap the default; version 3 added daily streaks
# and profile frames. Both migrations are one-time.
# and profile frames; version 4 added avatars and streak history.
if stored_version < 2:
data["settings"]["double_tap_place"] = true
migrated = true
if stored_version < 3:
migrated = true
if stored_version < 4:
migrated = true
if typeof(data.get("completed_rooms")) != TYPE_ARRAY:
data["completed_rooms"] = []
@@ -88,7 +96,7 @@ func load_game() -> void:
data["unlocked_guests"] = []
if migrated:
data["version"] = 3
data["version"] = 4
save_game()
@@ -196,17 +204,45 @@ func complete_daily(key: String) -> bool:
daily["streak"] = streak
daily["last_completed"] = key
daily["best_streak"] = max(int(daily.get("best_streak", 0)), streak)
var history: Array = daily.get("history", [])
if not history.has(key):
history.append(key)
while history.size() > 60:
history.pop_front()
daily["history"] = history
data["daily"] = daily
save_game()
progress_changed.emit()
return true
func daily_history() -> Array:
var history: Array = daily_data().get("history", [])
return history.duplicate()
func selected_frame() -> String:
return str(data.get("profile_frame", "plain"))
func selected_avatar() -> String:
return str(data.get("avatar_id", "crumb"))
func select_frame(id: String) -> void:
data["profile_frame"] = id
save_game()
progress_changed.emit()
func select_avatar(id: String) -> void:
data["avatar_id"] = id
save_game()
progress_changed.emit()
func apply_profile(avatar_id: String, frame_id: String) -> void:
data["avatar_id"] = avatar_id
data["profile_frame"] = frame_id
save_game()
progress_changed.emit()
+133
View File
@@ -0,0 +1,133 @@
extends Control
signal back_pressed
var current_label: Label
var best_label: Label
var goal_label: Label
var week_row: HBoxContainer
func _ready() -> void:
var margin := MarginContainer.new()
margin.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
margin.add_theme_constant_override("margin_left", 12)
margin.add_theme_constant_override("margin_right", 12)
margin.add_theme_constant_override("margin_top", UI.safe_top())
margin.add_theme_constant_override("margin_bottom", UI.safe_bottom())
add_child(margin)
var column := VBoxContainer.new()
column.add_theme_constant_override("separation", 6)
margin.add_child(column)
var top := HBoxContainer.new()
top.add_theme_constant_override("separation", 6)
column.add_child(top)
var back := UI.round_button("res://assets/icons/arrow-left.svg", 40)
back.pressed.connect(func() -> void: back_pressed.emit())
top.add_child(back)
var title := UI.label("Daily Streak", 22)
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
title.size_flags_horizontal = Control.SIZE_EXPAND_FILL
top.add_child(title)
var scroll := ScrollContainer.new()
scroll.size_flags_horizontal = Control.SIZE_EXPAND_FILL
scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
column.add_child(scroll)
var content := VBoxContainer.new()
content.size_flags_horizontal = Control.SIZE_EXPAND_FILL
content.add_theme_constant_override("separation", 8)
scroll.add_child(content)
var emblem := CenterContainer.new()
content.add_child(emblem)
var star := UI.icon("res://assets/icons/star_gold.svg", 96, Palette.WHITE)
emblem.add_child(star)
current_label = UI.label("0", 52, Palette.ORANGE, true)
content.add_child(current_label)
content.add_child(UI.heading("Current Streak", 20, Palette.ORANGE))
var best_panel := UI.panel(Palette.WHITE, 22, 8)
best_panel.size_flags_horizontal = Control.SIZE_SHRINK_CENTER
best_label = UI.label("Best streak: 0", 12, Palette.MUTED)
best_label.autowrap_mode = TextServer.AUTOWRAP_OFF
best_label.custom_minimum_size = Vector2(160, 0)
best_panel.add_child(best_label)
content.add_child(best_panel)
goal_label = UI.label("", 12, Palette.INK)
content.add_child(goal_label)
content.add_child(UI.heading("This week", 18))
week_row = HBoxContainer.new()
week_row.add_theme_constant_override("separation", 4)
week_row.alignment = BoxContainer.ALIGNMENT_CENTER
content.add_child(week_row)
var gift := CenterContainer.new()
content.add_child(gift)
var gift_row := HBoxContainer.new()
gift_row.custom_minimum_size = Vector2(150, 0)
gift_row.add_theme_constant_override("separation", 6)
gift.add_child(gift_row)
gift_row.add_child(UI.icon("res://assets/icons/star_gold.svg", 22, Palette.WHITE))
var gift_text := UI.label("7-day gift", 12, Palette.MUTED)
gift_text.autowrap_mode = TextServer.AUTOWRAP_OFF
gift_text.custom_minimum_size = Vector2(110, 0)
gift_row.add_child(gift_text)
UI.pass_scroll_input(content)
SaveGame.progress_changed.connect(refresh)
refresh()
func refresh() -> void:
var streak := SaveGame.daily_streak()
current_label.text = str(streak)
best_label.text = "Best streak: %d" % SaveGame.best_streak()
goal_label.text = Daily.goal_text(streak)
_build_week()
func _build_week() -> void:
for child in week_row.get_children():
child.queue_free()
var keys: Array = Daily.week_keys()
var labels: Array = Daily.weekday_labels()
var history: Array = SaveGame.daily_history()
var today := Daily.today_key()
for i in range(7):
var key := str(keys[i])
var done := history.has(key)
var is_today := key == today
var chip := VBoxContainer.new()
chip.add_theme_constant_override("separation", 2)
chip.add_child(UI.label(str(labels[i]), 9, Palette.MUTED))
var circle := PanelContainer.new()
circle.custom_minimum_size = Vector2(42, 42)
var style := StyleBoxFlat.new()
style.bg_color = Palette.GOLD if done else Palette.PAPER
style.corner_radius_top_left = 21
style.corner_radius_top_right = 21
style.corner_radius_bottom_left = 21
style.corner_radius_bottom_right = 21
style.border_width_left = 3 if is_today else 1
style.border_width_right = 3 if is_today else 1
style.border_width_top = 3 if is_today else 1
style.border_width_bottom = 3 if is_today else 1
style.border_color = Palette.ORANGE if is_today else Palette.PAPER_DARK
circle.add_theme_stylebox_override("panel", style)
if done:
var center := CenterContainer.new()
circle.add_child(center)
center.add_child(UI.icon("res://assets/icons/star_white.svg", 20, Palette.WHITE))
chip.add_child(circle)
week_row.add_child(chip)
UI.pass_scroll_input(week_row)
+1
View File
@@ -0,0 +1 @@
uid://dqlbnhq0n653j