feat: guest stories, accessibility and cozy events

v0.9.0-alpha local build. Adds per-guest story vignettes, a scrollable Guest Book story section, live text scaling, Android haptics, a difficulty picker with descriptions, six repeating cosmetic hotel events, and isolated free play using verified symmetry variants. Save format v7 with automatic migration. QA is 9/9 including the free-play uniqueness suite.
This commit is contained in:
Ratdoku Builder committed 2026-12-05 16:44:39 -06:00
1 parent e0fd33c25e
commit 9e2776f7c4
27 files changed
+1559 -99

No files matched your search

+126 -10
View File
@@ -12,10 +12,14 @@ var hold_value: Label
var hold_panel: PanelContainer
var music_volume_slider: HSlider
var difficulty_button: Button
var ui_scale_button: Button
var theme_button: Button
var wallpaper_layer: ColorRect
var wallpaper_grid: GridContainer
var pending_theme := "cream"
var difficulty_layer: ColorRect
var difficulty_grid: VBoxContainer
var pending_difficulty := "normal"
var game_actions: HBoxContainer
var reset_row: Control
var resume_button: Button
@@ -77,7 +81,7 @@ func _ready() -> void:
var close := UI.button("×", false, 36)
close.custom_minimum_size = Vector2(42, 36)
close.add_theme_font_size_override("font_size", 24)
UI.set_font_size(close, 24)
close.pressed.connect(_close)
header.add_child(close)
@@ -95,12 +99,16 @@ func _ready() -> void:
_add_pattern_row(list)
_add_toggle(list, "Show timer", "Keep the clock visible while you solve.", "show_timer")
_add_toggle(list, "Reduce motion", "Stop the bob and placement pop.", "reduce_motion")
_add_toggle(list, "Haptics", "Light vibration on Android.", "haptics")
_add_toggle(list, "Double-tap to place", "Tap = mark · double-tap = check in.", "double_tap_place")
_add_toggle(list, "Music", "Play the hotel lounge loop.", "music")
_add_toggle(list, "Sound effects", "UI and completion chimes.", "sfx")
_add_slider_row(list, "Music volume", "Lounge loop loudness.", "music_volume")
ui_scale_button = UI.button("Text size: Normal", false, 40)
ui_scale_button.pressed.connect(_cycle_ui_scale)
list.add_child(ui_scale_button)
difficulty_button = UI.button("Difficulty: Normal", false, 40)
difficulty_button.pressed.connect(_cycle_difficulty)
difficulty_button.pressed.connect(_open_difficulty_picker)
list.add_child(difficulty_button)
theme_button = UI.button("Wallpaper: Cream", false, 40)
theme_button.pressed.connect(_open_wallpaper_picker)
@@ -109,7 +117,7 @@ func _ready() -> void:
list.add_child(UI.spacer(2))
var rules := UI.button("How to play", false, 44)
rules.add_theme_font_size_override("font_size", 15)
UI.set_font_size(rules, 15)
rules.pressed.connect(func() -> void: rules_requested.emit())
list.add_child(rules)
@@ -124,6 +132,7 @@ func _ready() -> void:
UI.pass_scroll_input(list)
_build_wallpaper_picker()
_build_difficulty_picker()
game_actions = HBoxContainer.new()
game_actions.add_theme_constant_override("separation", 6)
@@ -131,14 +140,14 @@ func _ready() -> void:
var restart := UI.button("Restart", false, 40)
restart.size_flags_horizontal = Control.SIZE_EXPAND_FILL
restart.add_theme_font_size_override("font_size", 14)
UI.set_font_size(restart, 14)
restart.add_theme_color_override("font_color", Palette.RED)
restart.pressed.connect(_on_restart)
game_actions.add_child(restart)
var lobby := UI.button("Lobby", false, 40)
lobby.size_flags_horizontal = Control.SIZE_EXPAND_FILL
lobby.add_theme_font_size_override("font_size", 14)
UI.set_font_size(lobby, 14)
lobby.pressed.connect(_on_lobby)
game_actions.add_child(lobby)
@@ -246,6 +255,10 @@ func refresh() -> void:
music_volume_slider.set_value_no_signal(float(SaveGame.get_setting("music_volume")))
if difficulty_button != null:
difficulty_button.text = "Difficulty: %s" % str(SaveGame.get_setting("difficulty")).capitalize()
if ui_scale_button != null:
var scale := float(SaveGame.get_setting("ui_scale"))
var size_name := "Normal" if is_equal_approx(scale, 1.0) else ("Large" if is_equal_approx(scale, 1.15) else "Extra large")
ui_scale_button.text = "Text size: %s" % size_name
if theme_button != null:
var theme: Dictionary = SaveGame.THEMES.get(SaveGame.theme_id(), {})
theme_button.text = "Wallpaper: %s" % str(theme.get("name", "Cream"))
@@ -324,11 +337,114 @@ func _add_slider_row(parent: VBoxContainer, title: String, detail: String, key:
music_volume_slider = slider
func _cycle_difficulty() -> void:
var order := ["zen", "easy", "normal"]
var current := str(SaveGame.get_setting("difficulty"))
func _cycle_ui_scale() -> void:
var order := [1.0, 1.15, 1.3]
var current := float(SaveGame.get_setting("ui_scale"))
var next_index := (order.find(current) + 1) % order.size()
SaveGame.set_setting("difficulty", order[next_index])
SaveGame.set_setting("ui_scale", order[next_index])
refresh()
func _open_difficulty_picker() -> void:
pending_difficulty = str(SaveGame.get_setting("difficulty"))
_build_difficulty_grid()
difficulty_layer.visible = true
difficulty_layer.move_to_front()
func _build_difficulty_picker() -> void:
difficulty_layer = ColorRect.new()
difficulty_layer.color = Color(0.18, 0.12, 0.08, 0.62)
difficulty_layer.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
difficulty_layer.mouse_filter = Control.MOUSE_FILTER_STOP
difficulty_layer.gui_input.connect(func(event: InputEvent) -> void:
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
difficulty_layer.visible = false
)
difficulty_layer.visible = false
add_child(difficulty_layer)
var center := CenterContainer.new()
center.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
center.mouse_filter = Control.MOUSE_FILTER_IGNORE
difficulty_layer.add_child(center)
var panel := UI.panel(Palette.CREAM, 24, 16)
var view_size := get_viewport_rect().size
panel.custom_minimum_size = Vector2(min(360, max(280, int(view_size.x) - 32)), max(280, min(400, int(view_size.y) - 96)))
center.add_child(panel)
var box := VBoxContainer.new()
box.add_theme_constant_override("separation", 8)
panel.add_child(box)
box.add_child(UI.heading("Difficulty", 20))
var scroll := ScrollContainer.new()
scroll.custom_minimum_size = Vector2(0, 190)
scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
box.add_child(scroll)
difficulty_grid = VBoxContainer.new()
difficulty_grid.add_theme_constant_override("separation", 6)
difficulty_grid.size_flags_horizontal = Control.SIZE_EXPAND_FILL
scroll.add_child(difficulty_grid)
var actions := HBoxContainer.new()
actions.add_theme_constant_override("separation", 8)
box.add_child(actions)
var cancel := UI.button("Cancel", false, 46)
cancel.size_flags_horizontal = Control.SIZE_EXPAND_FILL
cancel.pressed.connect(func() -> void: difficulty_layer.visible = false)
actions.add_child(cancel)
var confirm := UI.button("Apply", true, 46)
confirm.size_flags_horizontal = Control.SIZE_EXPAND_FILL
confirm.pressed.connect(_apply_difficulty)
actions.add_child(confirm)
func _difficulty_detail(id: String) -> String:
if id == "zen":
return "No timer. Rule strip always shown. Take your time."
if id == "easy":
return "Timer visible. Rule strip always shown."
return "Timer visible. Rule strip only in the first rooms."
func _build_difficulty_grid() -> void:
for child in difficulty_grid.get_children():
child.queue_free()
for id in ["zen", "easy", "normal"]:
var card := Button.new()
card.custom_minimum_size = Vector2(0, 62)
card.flat = true
card.add_theme_stylebox_override("normal", _card_style(Palette.GOLD if id == pending_difficulty else Palette.PAPER))
card.add_theme_stylebox_override("hover", _card_style(Palette.PAPER_DARK))
card.pressed.connect(_select_pending_difficulty.bind(str(id)))
var column := VBoxContainer.new()
column.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
column.add_theme_constant_override("separation", 2)
column.mouse_filter = Control.MOUSE_FILTER_IGNORE
card.add_child(column)
var title := UI.label(str(id).capitalize(), 14)
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
column.add_child(title)
var detail := UI.label(_difficulty_detail(str(id)), 10, Palette.MUTED)
detail.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
column.add_child(detail)
difficulty_grid.add_child(card)
UI.pass_scroll_input(difficulty_grid)
func _select_pending_difficulty(id: String) -> void:
call_deferred("_set_pending_difficulty", id)
func _set_pending_difficulty(id: String) -> void:
pending_difficulty = id
_build_difficulty_grid()
func _apply_difficulty() -> void:
SaveGame.set_setting("difficulty", pending_difficulty)
difficulty_layer.visible = false
refresh()
@@ -533,7 +649,7 @@ func _action_row(title: String, detail: String, color: Color, callback: Callable
var go := UI.button("›", false, 34)
go.custom_minimum_size = Vector2(38, 34)
go.add_theme_font_size_override("font_size", 18)
UI.set_font_size(go, 18)
go.pressed.connect(callback)
row.add_child(go)