Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e0fd33c25e | ||
|
|
f2a92e6be2 | ||
|
|
a54279ffd1 | ||
|
|
6d302f5cb9 | ||
|
|
5c00b35e90 |
No files matched your search
@@ -2,6 +2,38 @@
|
|||||||
|
|
||||||
All notable alpha milestones for Ratdoku.
|
All notable alpha milestones for Ratdoku.
|
||||||
|
|
||||||
|
## v0.8.1-alpha — UI Polish (local build)
|
||||||
|
|
||||||
|
- Fixed touch scrolling on dynamically rebuilt achievement rows.
|
||||||
|
- Avatar previews now use circular head crops instead of full-body thumbnails.
|
||||||
|
- Locked guest avatars now show `???` and room number instead of revealing name and portrait.
|
||||||
|
- Difficulty cycle is now Zen → Easy → Normal.
|
||||||
|
- Wallpaper setting opens a themed picker with real image previews and Confirm/Cancel.
|
||||||
|
- Regenerated Brie with the approved cheese-and-notebook render and a text-free character sheet.
|
||||||
|
- Added a new Krea2-generated app icon in the project's gouache style.
|
||||||
|
- Verification pass replaced the circular full-body guest crops with true face close-ups; Crumb keeps the original in-game portrait.
|
||||||
|
- Verification pass fixed the wallpaper picker panel height so all five previews are visible and scrollable.
|
||||||
|
- Verification pass removed the generic animal paw from the icon; rat-track motifs stay on the wallpapers only.
|
||||||
|
- Not yet published to Gitea.
|
||||||
|
|
||||||
|
## v0.8.0-alpha — Meowdoku Lessons (local build)
|
||||||
|
|
||||||
|
- Added editable player name and generated player ID in Profile.
|
||||||
|
- Added an achievements list, a claimable 7-day gift that unlocks the Gold wallpaper, and a Share result button with daily totals and next-room countdown.
|
||||||
|
- Added save/resume for in-progress campaign and daily boards, with per-day completion times.
|
||||||
|
- Added five 2048×2048 wallpaper backgrounds with rat paw-print motifs and a cream veil for readability.
|
||||||
|
- Added Normal / Easy / Zen difficulty presets, music volume, and SFX settings.
|
||||||
|
- Save format moves to version 6. All QA stages pass.
|
||||||
|
- Not yet published to Gitea.
|
||||||
|
|
||||||
|
## v0.7.0-alpha — Hotel Tunes (local build)
|
||||||
|
|
||||||
|
- Added a 60-second instrumental-only cozy hotel lounge loop, generated with Stable Audio 3.
|
||||||
|
- Music plays across all screens and can be toggled in Settings.
|
||||||
|
- Regenerated Brie with a pearl-coat food-critic look and small dark eyes matching the cast; refreshed her thumb, card, board head, variant, and character sheet.
|
||||||
|
- Save format moves to version 5 with the new music setting.
|
||||||
|
- Not yet published to Gitea.
|
||||||
|
|
||||||
## v0.6.4-alpha — Polished Edges
|
## v0.6.4-alpha — Polished Edges
|
||||||
|
|
||||||
- Daily Streak screen now shows 3-day Regular and 7-day Night Owl reward milestones with progress.
|
- Daily Streak screen now shows 3-day Regular and 7-day Night Owl reward milestones with progress.
|
||||||
|
|||||||
@@ -19,7 +19,8 @@ The project uses a portrait **360×640 dp canvas**, scaled to a 540×960 desktop
|
|||||||
- On Android, the system back button acts like the in-app back arrow: it closes overlays first, then navigates back. On Home it asks before quitting.
|
- On Android, the system back button acts like the in-app back arrow: it closes overlays first, then navigates back. On Home it asks before quitting.
|
||||||
- **Undo** and **Hint** are at the bottom. **Restart room** and **Back to lobby** live in the in-level settings sheet.
|
- **Undo** and **Hint** are at the bottom. **Restart room** and **Back to lobby** live in the in-level settings sheet.
|
||||||
- The **Daily room** changes each day and tracks a streak. All 30 rooms rotate once before repeating. Replaying the same day never counts twice. Open **Streak** for the weekly calendar, next-frame goal, and reward milestones.
|
- The **Daily room** changes each day and tracks a streak. All 30 rooms rotate once before repeating. Replaying the same day never counts twice. Open **Streak** for the weekly calendar, next-frame goal, and reward milestones.
|
||||||
- Tap **Crumb** in the top-left to open your Profile, where you can choose an avatar and a frame. Choices apply on Confirm.
|
- Tap **Crumb** in the top-left to open your Profile, where you can edit your name, see your ID, choose an avatar and frame, and track achievements.
|
||||||
|
- Keep a 7-day streak to claim the weekly gift, which unlocks the Gold wallpaper. Share your daily result from the Streak screen.
|
||||||
- A **gold ring** around a guest means they are already checked in and cannot be moved.
|
- A **gold ring** around a guest means they are already checked in and cannot be moved.
|
||||||
- Win when every room, floor, and corridor has exactly one rat and no two rats touch — even diagonally.
|
- Win when every room, floor, and corridor has exactly one rat and no two rats touch — even diagonally.
|
||||||
- **No guessing is required.** Every room has exactly one solution.
|
- **No guessing is required.** Every room has exactly one solution.
|
||||||
@@ -41,9 +42,10 @@ The board uses circular **head tokens** from `art/guests/heads/`. Crumb remains
|
|||||||
- **Home** — top hub with framed Crumb avatar, guest progress, and settings; daily room card; Continue/Check in; Guest Book; House Rules.
|
- **Home** — top hub with framed Crumb avatar, guest progress, and settings; daily room card; Continue/Check in; Guest Book; House Rules.
|
||||||
- **Game** — top bar, rule strip for the first three rooms, room legend, board, timer, undo/hint, in-level settings, win overlay.
|
- **Game** — top bar, rule strip for the first three rooms, room legend, board, timer, undo/hint, in-level settings, win overlay.
|
||||||
- **The Guest Book** — 25 guests: five residents unlocked from the start, the other 20 unlocked one per room. Locked cards show a very faint portrait under `???` and their room number. Tapping a card opens a detail sheet; swiping anywhere in the gallery scrolls it, including over cards.
|
- **The Guest Book** — 25 guests: five residents unlocked from the start, the other 20 unlocked one per room. Locked cards show a very faint portrait under `???` and their room number. Tapping a card opens a detail sheet; swiping anywhere in the gallery scrolls it, including over cards.
|
||||||
- **Settings** — a bottom sheet over Home or the board: room patterns, timer, reduce motion, double-tap placement (on by default), hold time, how to play, restart/back, reset progress. Destructive actions use a themed in-app confirmation card.
|
- **Settings** — a bottom sheet over Home or the board: room patterns, timer, reduce motion, double-tap placement (on by default), hold time, music, how to play, restart/back, reset progress. Destructive actions use a themed in-app confirmation card.
|
||||||
- **Profile** — framed avatar preview, rooms completed, current and best daily streaks, and tabbed Avatar / Frame pickers with Confirm / Cancel. Guest portraits unlock with their Guest Book entry.
|
- **Profile** — editable player name and generated ID, framed avatar preview, rooms completed, current and best daily streaks, tabbed Avatar / Frame pickers with Confirm / Cancel, and an achievements list. Guest portraits unlock with their Guest Book entry.
|
||||||
- **Daily Streak** — big current streak, best-streak pill, weekly calendar, next-frame goal, day-7 gift marker, and streak reward milestones.
|
- **Daily Streak** — big current streak, best-streak pill, weekly calendar with per-day times, total dailies solved, next-daily countdown, Share result, claimable 7-day gift, and streak reward milestones.
|
||||||
|
- **Wallpapers & difficulty** — five 2048×2048 rat-track wallpapers, plus Normal / Easy / Zen difficulty presets in Settings.
|
||||||
- **House Rules** — four illustrated rules, controls, tips, FAQ, and an interactive 5×5 practice board.
|
- **House Rules** — four illustrated rules, controls, tips, FAQ, and an interactive 5×5 practice board.
|
||||||
|
|
||||||
## Unlocks
|
## Unlocks
|
||||||
@@ -148,12 +150,12 @@ build/Ratdoku.apk
|
|||||||
It is a **debug-signed, arm64-v8a** APK:
|
It is a **debug-signed, arm64-v8a** APK:
|
||||||
|
|
||||||
- Package: `com.ratdoku.game`
|
- Package: `com.ratdoku.game`
|
||||||
- Version: `0.6.4` (version code 16)
|
- Version: `0.8.1` (version code 19)
|
||||||
- Min SDK: 24 (Android 7.0)
|
- Min SDK: 24 (Android 7.0)
|
||||||
- Target SDK: 36
|
- Target SDK: 36
|
||||||
- Size: about 41 MB
|
- Size: about 41 MB
|
||||||
- Portrait orientation
|
- Portrait orientation
|
||||||
- Build label: `v0.6.4-alpha · build 2026-12-03`
|
- Build label: `v0.8.1-alpha · build 2026-12-04`
|
||||||
|
|
||||||
To install, copy the APK to the phone, open it, and allow “Install unknown apps” for the file manager/browser. Or with a USB-connected phone and USB debugging:
|
To install, copy the APK to the phone, open it, and allow “Install unknown apps” for the file manager/browser. Or with a USB-connected phone and USB debugging:
|
||||||
|
|
||||||
@@ -202,7 +204,7 @@ Run the whole QA suite (class scan, every test script, log-error scan, optional
|
|||||||
|
|
||||||
## Versioning and releases
|
## Versioning and releases
|
||||||
|
|
||||||
The current development build is **v0.6.4-alpha** (“Polished Edges”) with the build label on Home and in Settings.
|
The current development build is **v0.8.1-alpha** (“UI Polish”) with the build label on Home and in Settings.
|
||||||
|
|
||||||
Gitea repository:
|
Gitea repository:
|
||||||
|
|
||||||
@@ -226,14 +228,17 @@ Alpha releases (all marked prerelease, each with a debug APK and source archive)
|
|||||||
- **v0.6.2-alpha** — transparent cutout portraits, alternate variants, and full character sheets
|
- **v0.6.2-alpha** — transparent cutout portraits, alternate variants, and full character sheets
|
||||||
- **v0.6.3-alpha** — full 30-room daily rotation, visible profile actions, and reset-safe avatar/frame selection
|
- **v0.6.3-alpha** — full 30-room daily rotation, visible profile actions, and reset-safe avatar/frame selection
|
||||||
- **v0.6.4-alpha** — streak reward milestones and cleaned Krea2 workflow prompts
|
- **v0.6.4-alpha** — streak reward milestones and cleaned Krea2 workflow prompts
|
||||||
|
- **v0.7.0-alpha** — instrumental hotel-lounge music, Music toggle, and Brie refresh
|
||||||
|
- **v0.8.0-alpha** — player ID, achievements, claimable gift, daily share/stats, board resume, wallpapers
|
||||||
|
- **v0.8.1-alpha** — touch-scroll fix, headshot avatars, locked-guest privacy, wallpaper picker, difficulty order, new icon
|
||||||
|
|
||||||
https://gitea.nyxara.cc/Ahri-the-Vastaya/Ratdoku/releases/tag/v0.6.4-alpha
|
https://gitea.nyxara.cc/Ahri-the-Vastaya/Ratdoku/releases/tag/v0.8.1-alpha
|
||||||
|
|
||||||
The v0.6.4-alpha APK is also at:
|
The v0.8.1-alpha APK is also at:
|
||||||
|
|
||||||
`https://gitea.nyxara.cc/Ahri-the-Vastaya/Ratdoku/releases/download/v0.6.4-alpha/Ratdoku-v0.6.4-alpha.apk`
|
`https://gitea.nyxara.cc/Ahri-the-Vastaya/Ratdoku/releases/download/v0.8.1-alpha/Ratdoku-v0.8.1-alpha.apk`
|
||||||
|
|
||||||
`redesign-360` is the branch with the current 360dp work; it is tagged `v0.6.4-alpha`.
|
`redesign-360` is the branch with the current 360dp work; it is tagged `v0.8.1-alpha`.
|
||||||
|
|
||||||
The version is set in three places: `project.godot` (`config/version`), `scripts/Version.gd` (display label), and `export_presets.cfg` (`version/name`, `version/code`).
|
The version is set in three places: `project.godot` (`config/version`), `scripts/Version.gd` (display label), and `export_presets.cfg` (`version/name`, `version/code`).
|
||||||
|
|
||||||
@@ -247,7 +252,8 @@ The version is set in three places: `project.godot` (`config/version`), `scripts
|
|||||||
- Interactive 5×5 tutorial
|
- Interactive 5×5 tutorial
|
||||||
- 25 guest portraits + Crumb
|
- 25 guest portraits + Crumb
|
||||||
- Settings, gallery, rulebook, unlock flow
|
- Settings, gallery, rulebook, unlock flow
|
||||||
- Daily room with streaks, Profile screen, selectable avatars and frames (save version 4)
|
- Daily room with streaks, Profile screen, selectable avatars and frames, achievements, wallpapers, saved boards (save version 6)
|
||||||
- Installable Android debug APK
|
- Installable Android debug APK
|
||||||
- No Godot boot splash; the app opens straight to the cream-themed game
|
- No Godot boot splash; the app opens straight to the cream-themed game
|
||||||
- No audio yet, no release keystore/AAB yet
|
- Instrumental hotel-lounge loop with a Music toggle (no lyrics), generated with Stable Audio 3
|
||||||
|
- No release keystore/AAB yet
|
||||||
|
Before Width: | Height: | Size: 187 KiB After Width: | Height: | Size: 233 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 110 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 114 KiB |
|
Before Width: | Height: | Size: 66 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 60 KiB After Width: | Height: | Size: 102 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 73 KiB After Width: | Height: | Size: 115 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 105 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 63 KiB After Width: | Height: | Size: 108 KiB |
|
Before Width: | Height: | Size: 68 KiB After Width: | Height: | Size: 112 KiB |
|
Before Width: | Height: | Size: 47 KiB After Width: | Height: | Size: 101 KiB |
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 106 KiB |
|
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 65 KiB After Width: | Height: | Size: 103 KiB |
|
Before Width: | Height: | Size: 55 KiB After Width: | Height: | Size: 91 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 107 KiB |
|
Before Width: | Height: | Size: 62 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 109 KiB |
|
Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 70 KiB |
|
After Width: | Height: | Size: 3.6 MiB |
|
After Width: | Height: | Size: 4.3 MiB |
|
After Width: | Height: | Size: 4.0 MiB |
|
After Width: | Height: | Size: 4.0 MiB |
|
After Width: | Height: | Size: 3.7 MiB |
@@ -32,8 +32,8 @@ architectures/armeabi-v7a=false
|
|||||||
architectures/arm64-v8a=true
|
architectures/arm64-v8a=true
|
||||||
architectures/x86=false
|
architectures/x86=false
|
||||||
architectures/x86_64=false
|
architectures/x86_64=false
|
||||||
version/code=16
|
version/code=19
|
||||||
version/name="0.6.4"
|
version/name="0.8.1"
|
||||||
package/unique_name="com.ratdoku.game"
|
package/unique_name="com.ratdoku.game"
|
||||||
package/name="Ratdoku"
|
package/name="Ratdoku"
|
||||||
package/signed=true
|
package/signed=true
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 387 KiB After Width: | Height: | Size: 454 KiB |
@@ -12,7 +12,7 @@ config_version=5
|
|||||||
|
|
||||||
config/name="Ratdoku"
|
config/name="Ratdoku"
|
||||||
run/main_scene="res://scenes/Main.tscn"
|
run/main_scene="res://scenes/Main.tscn"
|
||||||
config/version="0.6.4-alpha"
|
config/version="0.8.1-alpha"
|
||||||
config/features=PackedStringArray("4.7", "GL Compatibility")
|
config/features=PackedStringArray("4.7", "GL Compatibility")
|
||||||
config/icon="res://icon.png"
|
config/icon="res://icon.png"
|
||||||
boot_splash/show_image=false
|
boot_splash/show_image=false
|
||||||
|
|||||||
@@ -38,6 +38,12 @@ static func portrait_path(id: String) -> String:
|
|||||||
return str(avatar.get("path", "res://art/crumb_head.png"))
|
return str(avatar.get("path", "res://art/crumb_head.png"))
|
||||||
|
|
||||||
|
|
||||||
|
static func head_path(id: String) -> String:
|
||||||
|
if id == "crumb":
|
||||||
|
return "res://art/crumb_head.png"
|
||||||
|
return "res://art/guests/heads/%s.png" % id
|
||||||
|
|
||||||
|
|
||||||
static func is_unlocked(id: String) -> bool:
|
static func is_unlocked(id: String) -> bool:
|
||||||
if id == "crumb":
|
if id == "crumb":
|
||||||
return true
|
return true
|
||||||
|
|||||||
@@ -167,6 +167,46 @@ func set_level(level: Dictionary) -> void:
|
|||||||
changed.emit()
|
changed.emit()
|
||||||
|
|
||||||
|
|
||||||
|
func snapshot() -> Dictionary:
|
||||||
|
return {
|
||||||
|
"level_id": level_id,
|
||||||
|
"n": n,
|
||||||
|
"cells": cells.duplicate(true),
|
||||||
|
"auto_x": auto_x.duplicate(true),
|
||||||
|
"history": history.duplicate(true),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func restore_state(snapshot: Dictionary) -> bool:
|
||||||
|
if snapshot.is_empty() or str(snapshot.get("level_id", "")) != level_id:
|
||||||
|
return false
|
||||||
|
var saved_cells = snapshot.get("cells")
|
||||||
|
var saved_marks = snapshot.get("auto_x")
|
||||||
|
var saved_history = snapshot.get("history")
|
||||||
|
if (
|
||||||
|
typeof(saved_cells) != TYPE_ARRAY
|
||||||
|
or typeof(saved_marks) != TYPE_ARRAY
|
||||||
|
or typeof(saved_history) != TYPE_ARRAY
|
||||||
|
or saved_cells.size() != n
|
||||||
|
or saved_marks.size() != n
|
||||||
|
):
|
||||||
|
return false
|
||||||
|
cells = saved_cells.duplicate(true)
|
||||||
|
auto_x = saved_marks.duplicate(true)
|
||||||
|
history = saved_history.duplicate(true)
|
||||||
|
for key in fixed:
|
||||||
|
cells[key.x][key.y] = RAT
|
||||||
|
conflict_cells = Rules.conflicts(cells, regions)
|
||||||
|
pending_tap_cell = Vector2i(-1, -1)
|
||||||
|
press_cell = Vector2i(-1, -1)
|
||||||
|
hold_fired = false
|
||||||
|
last_placed = Vector2i(-1, -1)
|
||||||
|
pop_time = 0.0
|
||||||
|
queue_redraw()
|
||||||
|
changed.emit()
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
func _draw() -> void:
|
func _draw() -> void:
|
||||||
if regions.size() != n or n <= 0:
|
if regions.size() != n or n <= 0:
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ var elapsed_ms := 0
|
|||||||
var win_shown := false
|
var win_shown := false
|
||||||
var current_level_id := ""
|
var current_level_id := ""
|
||||||
var daily_mode := false
|
var daily_mode := false
|
||||||
|
var restoring := false
|
||||||
var daily_key := ""
|
var daily_key := ""
|
||||||
var ui_paused := false
|
var ui_paused := false
|
||||||
|
|
||||||
@@ -252,7 +253,9 @@ func start_level(index: int, daily: bool = false, key: String = "") -> void:
|
|||||||
win_shown = false
|
win_shown = false
|
||||||
overlay.visible = false
|
overlay.visible = false
|
||||||
new_guest_box.visible = false
|
new_guest_box.visible = false
|
||||||
rule_strip.visible = daily_mode or level_index < 3
|
var difficulty := str(SaveGame.get_setting("difficulty"))
|
||||||
|
rule_strip.visible = difficulty == "easy" or difficulty == "zen" or daily_mode or level_index < 3
|
||||||
|
timer_label.visible = bool(SaveGame.get_setting("show_timer")) and difficulty != "zen"
|
||||||
status_label.text = "Gold rings are already in." if level.get("clues", []).size() > 0 else DEFAULT_STATUS
|
status_label.text = "Gold rings are already in." if level.get("clues", []).size() > 0 else DEFAULT_STATUS
|
||||||
status_label.add_theme_color_override("font_color", Palette.MUTED)
|
status_label.add_theme_color_override("font_color", Palette.MUTED)
|
||||||
_refresh_legend()
|
_refresh_legend()
|
||||||
@@ -264,6 +267,40 @@ func start_daily(index: int, key: String) -> void:
|
|||||||
start_level(index, true, key)
|
start_level(index, true, key)
|
||||||
|
|
||||||
|
|
||||||
|
func snapshot() -> Dictionary:
|
||||||
|
var snap := board.snapshot()
|
||||||
|
snap["level_index"] = level_index
|
||||||
|
snap["daily_mode"] = daily_mode
|
||||||
|
snap["daily_key"] = daily_key
|
||||||
|
snap["elapsed_ms"] = elapsed_ms
|
||||||
|
return snap
|
||||||
|
|
||||||
|
|
||||||
|
func restore(snapshot: Dictionary) -> bool:
|
||||||
|
if snapshot.is_empty() or levels.is_empty():
|
||||||
|
return false
|
||||||
|
var index := clampi(int(snapshot.get("level_index", 0)), 0, levels.size() - 1)
|
||||||
|
restoring = true
|
||||||
|
start_level(index, bool(snapshot.get("daily_mode", false)), str(snapshot.get("daily_key", "")))
|
||||||
|
var ok := board.restore_state(snapshot)
|
||||||
|
restoring = false
|
||||||
|
if not ok:
|
||||||
|
return false
|
||||||
|
elapsed_ms = int(snapshot.get("elapsed_ms", 0))
|
||||||
|
started_at = Time.get_ticks_msec() - elapsed_ms
|
||||||
|
queue_redraw()
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
func clear_saved_board() -> void:
|
||||||
|
SaveGame.clear_board("daily" if daily_mode else "campaign")
|
||||||
|
|
||||||
|
|
||||||
|
func save_board() -> void:
|
||||||
|
if not restoring and not win_shown:
|
||||||
|
SaveGame.save_board("daily" if daily_mode else "campaign", snapshot())
|
||||||
|
|
||||||
|
|
||||||
func _refresh_legend() -> void:
|
func _refresh_legend() -> void:
|
||||||
for child in legend_row.get_children():
|
for child in legend_row.get_children():
|
||||||
child.queue_free()
|
child.queue_free()
|
||||||
@@ -327,7 +364,7 @@ func _update_guest_count() -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _process(_delta: float) -> void:
|
func _process(_delta: float) -> void:
|
||||||
timer_label.visible = bool(SaveGame.get_setting("show_timer"))
|
timer_label.visible = bool(SaveGame.get_setting("show_timer")) and str(SaveGame.get_setting("difficulty")) != "zen"
|
||||||
if ui_paused or not visible or win_shown or started_at == 0:
|
if ui_paused or not visible or win_shown or started_at == 0:
|
||||||
return
|
return
|
||||||
elapsed_ms = Time.get_ticks_msec() - started_at
|
elapsed_ms = Time.get_ticks_msec() - started_at
|
||||||
@@ -346,6 +383,7 @@ func set_ui_paused(value: bool) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func restart_room() -> void:
|
func restart_room() -> void:
|
||||||
|
clear_saved_board()
|
||||||
start_level(level_index, daily_mode, daily_key)
|
start_level(level_index, daily_mode, daily_key)
|
||||||
|
|
||||||
|
|
||||||
@@ -361,6 +399,7 @@ func _on_board_changed() -> void:
|
|||||||
status_label.add_theme_color_override("font_color", Palette.MUTED)
|
status_label.add_theme_color_override("font_color", Palette.MUTED)
|
||||||
_update_guest_count()
|
_update_guest_count()
|
||||||
_update_legend()
|
_update_legend()
|
||||||
|
save_board()
|
||||||
|
|
||||||
|
|
||||||
func _on_mistake() -> void:
|
func _on_mistake() -> void:
|
||||||
@@ -372,12 +411,13 @@ func _on_solved() -> void:
|
|||||||
if win_shown:
|
if win_shown:
|
||||||
return
|
return
|
||||||
win_shown = true
|
win_shown = true
|
||||||
|
clear_saved_board()
|
||||||
status_label.text = "Everyone checked in."
|
status_label.text = "Everyone checked in."
|
||||||
status_label.add_theme_color_override("font_color", Palette.INK)
|
status_label.add_theme_color_override("font_color", Palette.INK)
|
||||||
_update_legend()
|
_update_legend()
|
||||||
|
|
||||||
if daily_mode:
|
if daily_mode:
|
||||||
var extended := SaveGame.complete_daily(daily_key)
|
var extended := SaveGame.complete_daily(daily_key, int(elapsed_ms / 1000.0))
|
||||||
var streak := SaveGame.daily_streak()
|
var streak := SaveGame.daily_streak()
|
||||||
var streak_text := "%d %s" % [streak, "day" if streak == 1 else "days"]
|
var streak_text := "%d %s" % [streak, "day" if streak == 1 else "days"]
|
||||||
win_title.text = "Daily room complete!"
|
win_title.text = "Daily room complete!"
|
||||||
|
|||||||
@@ -173,7 +173,7 @@ func _build_avatar() -> void:
|
|||||||
var avatar := Button.new()
|
var avatar := Button.new()
|
||||||
avatar.custom_minimum_size = Vector2(44, 44)
|
avatar.custom_minimum_size = Vector2(44, 44)
|
||||||
avatar.flat = true
|
avatar.flat = true
|
||||||
avatar.icon = load(Avatars.portrait_path(SaveGame.selected_avatar()))
|
avatar.icon = load(Avatars.head_path(SaveGame.selected_avatar()))
|
||||||
avatar.expand_icon = true
|
avatar.expand_icon = true
|
||||||
avatar.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
avatar.icon_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||||
avatar.alignment = HORIZONTAL_ALIGNMENT_CENTER
|
avatar.alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||||
|
|||||||
@@ -20,14 +20,36 @@ var quit_button: Button
|
|||||||
var screens := {}
|
var screens := {}
|
||||||
var current := "home"
|
var current := "home"
|
||||||
var nav_stack: Array[String] = []
|
var nav_stack: Array[String] = []
|
||||||
|
var music_player: AudioStreamPlayer
|
||||||
|
var background_rect: TextureRect
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
var background := ColorRect.new()
|
var base := ColorRect.new()
|
||||||
background.color = Palette.CREAM
|
base.color = Palette.CREAM
|
||||||
|
base.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
|
base.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
|
add_child(base)
|
||||||
|
|
||||||
|
var background := TextureRect.new()
|
||||||
|
_refresh_background_texture(background)
|
||||||
background.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
background.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
|
background.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||||
|
background.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_COVERED
|
||||||
background.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
background.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
add_child(background)
|
add_child(background)
|
||||||
|
background_rect = background
|
||||||
|
|
||||||
|
var veil := ColorRect.new()
|
||||||
|
veil.color = Color(Palette.CREAM.r, Palette.CREAM.g, Palette.CREAM.b, 0.45)
|
||||||
|
veil.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
|
veil.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
|
add_child(veil)
|
||||||
|
|
||||||
|
_setup_music()
|
||||||
|
_refresh_background()
|
||||||
|
SaveGame.settings_changed.connect(_refresh_background)
|
||||||
|
SaveGame.progress_changed.connect(_refresh_background)
|
||||||
|
|
||||||
home = HomeScene.instantiate()
|
home = HomeScene.instantiate()
|
||||||
_add_screen(home)
|
_add_screen(home)
|
||||||
@@ -85,6 +107,42 @@ func _ready() -> void:
|
|||||||
show_screen("home", false)
|
show_screen("home", false)
|
||||||
|
|
||||||
|
|
||||||
|
func _refresh_background_texture(rect: TextureRect) -> void:
|
||||||
|
var path := "res://assets/backgrounds/%s.png" % SaveGame.theme_id()
|
||||||
|
if ResourceLoader.exists(path):
|
||||||
|
rect.texture = load(path)
|
||||||
|
else:
|
||||||
|
rect.texture = null
|
||||||
|
|
||||||
|
|
||||||
|
func _refresh_background() -> void:
|
||||||
|
if background_rect != null:
|
||||||
|
_refresh_background_texture(background_rect)
|
||||||
|
|
||||||
|
|
||||||
|
func _setup_music() -> void:
|
||||||
|
music_player = AudioStreamPlayer.new()
|
||||||
|
var stream = load("res://assets/audio/lounge_main.mp3")
|
||||||
|
stream.loop = true
|
||||||
|
music_player.stream = stream
|
||||||
|
music_player.volume_db = -14.0
|
||||||
|
add_child(music_player)
|
||||||
|
SaveGame.settings_changed.connect(_update_music)
|
||||||
|
_update_music()
|
||||||
|
|
||||||
|
|
||||||
|
func _update_music() -> void:
|
||||||
|
if music_player == null:
|
||||||
|
return
|
||||||
|
if bool(SaveGame.get_setting("music")):
|
||||||
|
var volume := clampf(float(SaveGame.get_setting("music_volume")), 0.0, 1.0)
|
||||||
|
music_player.volume_db = linear_to_db(max(0.001, volume))
|
||||||
|
if not music_player.playing:
|
||||||
|
music_player.play()
|
||||||
|
else:
|
||||||
|
music_player.stop()
|
||||||
|
|
||||||
|
|
||||||
func _add_screen(screen: Control) -> void:
|
func _add_screen(screen: Control) -> void:
|
||||||
add_child(screen)
|
add_child(screen)
|
||||||
screen.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
screen.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
@@ -156,18 +214,28 @@ func _on_play() -> void:
|
|||||||
var max_index: int = max(0, game.levels.size() - 1)
|
var max_index: int = max(0, game.levels.size() - 1)
|
||||||
var start_index: int = clampi(int(SaveGame.data.get("last_room", 0)), 0, max_index)
|
var start_index: int = clampi(int(SaveGame.data.get("last_room", 0)), 0, max_index)
|
||||||
show_screen("game")
|
show_screen("game")
|
||||||
game.start_level(start_index)
|
var saved := SaveGame.load_board("campaign")
|
||||||
|
if saved.is_empty() or not game.restore(saved):
|
||||||
|
game.start_level(start_index)
|
||||||
|
|
||||||
|
|
||||||
func _on_daily() -> void:
|
func _on_daily() -> void:
|
||||||
var key := Daily.today_key()
|
var key := Daily.today_key()
|
||||||
var index := Daily.level_index(game.levels.size(), key)
|
var index := Daily.level_index(game.levels.size(), key)
|
||||||
show_screen("game")
|
show_screen("game")
|
||||||
|
var saved := SaveGame.load_board("daily")
|
||||||
|
if not saved.is_empty() and str(saved.get("daily_key", "")) == key and game.restore(saved):
|
||||||
|
return
|
||||||
game.start_daily(index, key)
|
game.start_daily(index, key)
|
||||||
|
|
||||||
|
|
||||||
func _input(event: InputEvent) -> void:
|
func _exit_tree() -> void:
|
||||||
if event.is_action_pressed("ui_cancel"):
|
if music_player != null:
|
||||||
|
music_player.stop()
|
||||||
|
music_player.stream = null
|
||||||
|
|
||||||
|
|
||||||
|
func _input(event: InputEvent) -> void: if event.is_action_pressed("ui_cancel"):
|
||||||
if _handle_back():
|
if _handle_back():
|
||||||
accept_event()
|
accept_event()
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,10 @@ var current_tab := "avatar"
|
|||||||
var pending_avatar := "crumb"
|
var pending_avatar := "crumb"
|
||||||
var pending_frame := "plain"
|
var pending_frame := "plain"
|
||||||
var portrait_key := ""
|
var portrait_key := ""
|
||||||
|
var player_id_label: Label
|
||||||
|
var achievements_box: VBoxContainer
|
||||||
|
var rename_layer: ColorRect
|
||||||
|
var name_input: LineEdit
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
@@ -72,8 +76,20 @@ func _ready() -> void:
|
|||||||
portrait_holder = CenterContainer.new()
|
portrait_holder = CenterContainer.new()
|
||||||
content.add_child(portrait_holder)
|
content.add_child(portrait_holder)
|
||||||
|
|
||||||
name_label = UI.label("Crumb", 20, Palette.INK, true)
|
var name_row := HBoxContainer.new()
|
||||||
content.add_child(name_label)
|
name_row.add_theme_constant_override("separation", 6)
|
||||||
|
content.add_child(name_row)
|
||||||
|
name_label = UI.label("Innkeeper", 20, Palette.INK, true)
|
||||||
|
name_label.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
|
||||||
|
name_label.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
|
name_row.add_child(name_label)
|
||||||
|
var edit_name := UI.button("Edit", false, 32)
|
||||||
|
edit_name.custom_minimum_size = Vector2(52, 32)
|
||||||
|
edit_name.add_theme_font_size_override("font_size", 11)
|
||||||
|
edit_name.pressed.connect(_show_rename)
|
||||||
|
name_row.add_child(edit_name)
|
||||||
|
player_id_label = UI.label("RAT-000000", 10, Palette.MUTED)
|
||||||
|
content.add_child(player_id_label)
|
||||||
role_label = UI.label("Innkeeper · always in", 11, Palette.MUTED)
|
role_label = UI.label("Innkeeper · always in", 11, Palette.MUTED)
|
||||||
content.add_child(role_label)
|
content.add_child(role_label)
|
||||||
|
|
||||||
@@ -89,6 +105,11 @@ func _ready() -> void:
|
|||||||
view_streak.pressed.connect(func() -> void: streak_pressed.emit())
|
view_streak.pressed.connect(func() -> void: streak_pressed.emit())
|
||||||
content.add_child(view_streak)
|
content.add_child(view_streak)
|
||||||
|
|
||||||
|
content.add_child(UI.heading("Achievements", 18))
|
||||||
|
achievements_box = VBoxContainer.new()
|
||||||
|
achievements_box.add_theme_constant_override("separation", 4)
|
||||||
|
content.add_child(achievements_box)
|
||||||
|
|
||||||
var tabs := HBoxContainer.new()
|
var tabs := HBoxContainer.new()
|
||||||
tabs.add_theme_constant_override("separation", 6)
|
tabs.add_theme_constant_override("separation", 6)
|
||||||
content.add_child(tabs)
|
content.add_child(tabs)
|
||||||
@@ -112,6 +133,8 @@ func _ready() -> void:
|
|||||||
status_label.custom_minimum_size = Vector2(0, 22)
|
status_label.custom_minimum_size = Vector2(0, 22)
|
||||||
content.add_child(status_label)
|
content.add_child(status_label)
|
||||||
|
|
||||||
|
_build_rename_dialog()
|
||||||
|
|
||||||
UI.pass_scroll_input(content)
|
UI.pass_scroll_input(content)
|
||||||
SaveGame.progress_changed.connect(refresh)
|
SaveGame.progress_changed.connect(refresh)
|
||||||
refresh()
|
refresh()
|
||||||
@@ -137,13 +160,15 @@ func refresh() -> void:
|
|||||||
streak_label.text = str(SaveGame.daily_streak())
|
streak_label.text = str(SaveGame.daily_streak())
|
||||||
best_label.text = str(SaveGame.best_streak())
|
best_label.text = str(SaveGame.best_streak())
|
||||||
var avatar: Dictionary = Avatars.by_id(pending_avatar)
|
var avatar: Dictionary = Avatars.by_id(pending_avatar)
|
||||||
name_label.text = str(avatar.get("name", "Crumb"))
|
name_label.text = SaveGame.player_name()
|
||||||
role_label.text = "Innkeeper · always in" if pending_avatar == "crumb" else "Guest · Hotel Ratdoku"
|
player_id_label.text = SaveGame.player_id()
|
||||||
|
role_label.text = "Avatar: %s" % str(avatar.get("name", "Crumb"))
|
||||||
status_label.text = "Pick a look, then confirm."
|
status_label.text = "Pick a look, then confirm."
|
||||||
status_label.add_theme_color_override("font_color", Palette.MUTED)
|
status_label.add_theme_color_override("font_color", Palette.MUTED)
|
||||||
_update_tab_styles()
|
_update_tab_styles()
|
||||||
_build_portrait()
|
_build_portrait()
|
||||||
_build_grid()
|
_build_grid()
|
||||||
|
_build_achievements()
|
||||||
|
|
||||||
|
|
||||||
func _set_tab(tab: String) -> void:
|
func _set_tab(tab: String) -> void:
|
||||||
@@ -167,7 +192,7 @@ func _build_portrait() -> void:
|
|||||||
child.queue_free()
|
child.queue_free()
|
||||||
var frame := Frames.frame_panel(pending_frame, 118)
|
var frame := Frames.frame_panel(pending_frame, 118)
|
||||||
var head := TextureRect.new()
|
var head := TextureRect.new()
|
||||||
head.texture = load(Avatars.portrait_path(pending_avatar))
|
head.texture = load(Avatars.head_path(pending_avatar))
|
||||||
head.custom_minimum_size = Vector2(96, 96)
|
head.custom_minimum_size = Vector2(96, 96)
|
||||||
head.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
head.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||||
head.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
head.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||||||
@@ -203,12 +228,24 @@ func _build_grid() -> void:
|
|||||||
var badge := Frames.frame_panel(pending_frame if current_tab == "avatar" else id, 46)
|
var badge := Frames.frame_panel(pending_frame if current_tab == "avatar" else id, 46)
|
||||||
badge.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
badge.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
var head := TextureRect.new()
|
var head := TextureRect.new()
|
||||||
head.texture = load(Avatars.portrait_path(id) if current_tab == "avatar" else "res://art/crumb_head.png")
|
head.texture = load(Avatars.head_path(id) if current_tab == "avatar" else "res://art/crumb_head.png")
|
||||||
head.custom_minimum_size = Vector2(30, 30)
|
head.custom_minimum_size = Vector2(30, 30)
|
||||||
head.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
head.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||||
head.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
head.stretch_mode = TextureRect.STRETCH_KEEP_ASPECT_CENTERED
|
||||||
head.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
head.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
badge.add_child(head)
|
badge.add_child(head)
|
||||||
|
var hidden := current_tab == "avatar" and not unlocked
|
||||||
|
if hidden:
|
||||||
|
var veil := ColorRect.new()
|
||||||
|
veil.color = Color(0.98, 0.93, 0.84, 0.82)
|
||||||
|
veil.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
|
veil.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
|
badge.add_child(veil)
|
||||||
|
var question := UI.label("???", 12, Palette.INK)
|
||||||
|
question.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
|
question.vertical_alignment = VERTICAL_ALIGNMENT_CENTER
|
||||||
|
question.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
|
badge.add_child(question)
|
||||||
row.add_child(badge)
|
row.add_child(badge)
|
||||||
|
|
||||||
var text := VBoxContainer.new()
|
var text := VBoxContainer.new()
|
||||||
@@ -217,7 +254,8 @@ func _build_grid() -> void:
|
|||||||
text.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
text.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
row.add_child(text)
|
row.add_child(text)
|
||||||
|
|
||||||
var name := UI.label(str(entry.get("name", "")), 12)
|
var display_name := "???" if (current_tab == "avatar" and not unlocked) else str(entry.get("name", ""))
|
||||||
|
var name := UI.label(display_name, 12)
|
||||||
name.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
|
name.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
|
||||||
text.add_child(name)
|
text.add_child(name)
|
||||||
|
|
||||||
@@ -226,8 +264,10 @@ func _build_grid() -> void:
|
|||||||
detail = "Selected"
|
detail = "Selected"
|
||||||
elif unlocked:
|
elif unlocked:
|
||||||
detail = "Unlocked"
|
detail = "Unlocked"
|
||||||
|
elif current_tab == "avatar":
|
||||||
|
detail = "Room %d" % int(entry.get("room", 0))
|
||||||
else:
|
else:
|
||||||
detail = Avatars.requirement_text(id) if current_tab == "avatar" else Frames.requirement_text(id)
|
detail = Frames.requirement_text(id)
|
||||||
var sub := UI.label(detail, 9, Palette.GOLD if id == selected else (Palette.MUTED if unlocked else Palette.RED))
|
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
|
sub.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
|
||||||
text.add_child(sub)
|
text.add_child(sub)
|
||||||
@@ -274,6 +314,84 @@ func _on_confirm() -> void:
|
|||||||
status_label.add_theme_color_override("font_color", Palette.MUTED)
|
status_label.add_theme_color_override("font_color", Palette.MUTED)
|
||||||
|
|
||||||
|
|
||||||
|
func _build_achievements() -> void:
|
||||||
|
for child in achievements_box.get_children():
|
||||||
|
child.queue_free()
|
||||||
|
var state := SaveGame.achievements()
|
||||||
|
var entries := [
|
||||||
|
["first_room", "First room checked in"],
|
||||||
|
["ten_rooms", "Ten rooms complete"],
|
||||||
|
["thirty_rooms", "All thirty rooms"],
|
||||||
|
["all_guests", "Meet every guest"],
|
||||||
|
["streak_3", "Three-day streak"],
|
||||||
|
["streak_7", "Seven-day streak"],
|
||||||
|
["daily_10", "Ten daily rooms"],
|
||||||
|
["week_gift", "Opened the week gift"],
|
||||||
|
]
|
||||||
|
for entry in entries:
|
||||||
|
var done := bool(state.get(str(entry[0]), false))
|
||||||
|
var row := UI.panel(Palette.PAPER if done else Palette.WHITE, 10, 6)
|
||||||
|
var label := UI.label(("%s · Done" if done else "%s · Locked") % str(entry[1]), 11, Palette.GOLD if done else Palette.MUTED)
|
||||||
|
label.horizontal_alignment = HORIZONTAL_ALIGNMENT_LEFT
|
||||||
|
row.add_child(label)
|
||||||
|
achievements_box.add_child(row)
|
||||||
|
|
||||||
|
UI.pass_scroll_input(achievements_box)
|
||||||
|
|
||||||
|
|
||||||
|
func _build_rename_dialog() -> void:
|
||||||
|
rename_layer = ColorRect.new()
|
||||||
|
rename_layer.color = Color(0.18, 0.12, 0.08, 0.62)
|
||||||
|
rename_layer.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
|
rename_layer.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||||
|
rename_layer.gui_input.connect(func(event: InputEvent) -> void:
|
||||||
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
||||||
|
rename_layer.visible = false
|
||||||
|
)
|
||||||
|
rename_layer.visible = false
|
||||||
|
add_child(rename_layer)
|
||||||
|
|
||||||
|
var center := CenterContainer.new()
|
||||||
|
center.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
|
center.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
|
rename_layer.add_child(center)
|
||||||
|
var panel := UI.panel(Palette.CREAM, 24, 16)
|
||||||
|
panel.custom_minimum_size = Vector2(300, 0)
|
||||||
|
center.add_child(panel)
|
||||||
|
var box := VBoxContainer.new()
|
||||||
|
box.add_theme_constant_override("separation", 8)
|
||||||
|
panel.add_child(box)
|
||||||
|
box.add_child(UI.heading("Edit name", 20))
|
||||||
|
name_input = LineEdit.new()
|
||||||
|
name_input.text = SaveGame.player_name()
|
||||||
|
name_input.max_length = 18
|
||||||
|
name_input.custom_minimum_size = Vector2(260, 44)
|
||||||
|
box.add_child(name_input)
|
||||||
|
var actions := HBoxContainer.new()
|
||||||
|
actions.add_theme_constant_override("separation", 8)
|
||||||
|
box.add_child(actions)
|
||||||
|
var cancel := UI.button("Cancel", false, 44)
|
||||||
|
cancel.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
|
cancel.pressed.connect(func() -> void: rename_layer.visible = false)
|
||||||
|
actions.add_child(cancel)
|
||||||
|
var save := UI.button("Save", true, 44)
|
||||||
|
save.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
|
save.pressed.connect(_save_name)
|
||||||
|
actions.add_child(save)
|
||||||
|
|
||||||
|
|
||||||
|
func _show_rename() -> void:
|
||||||
|
name_input.text = SaveGame.player_name()
|
||||||
|
rename_layer.visible = true
|
||||||
|
rename_layer.move_to_front()
|
||||||
|
name_input.grab_focus()
|
||||||
|
|
||||||
|
|
||||||
|
func _save_name() -> void:
|
||||||
|
SaveGame.set_player_name(name_input.text)
|
||||||
|
rename_layer.visible = false
|
||||||
|
|
||||||
|
|
||||||
func _card_style(color: Color) -> StyleBoxFlat:
|
func _card_style(color: Color) -> StyleBoxFlat:
|
||||||
var style := StyleBoxFlat.new()
|
var style := StyleBoxFlat.new()
|
||||||
style.bg_color = color
|
style.bg_color = color
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ const DEFAULTS := {
|
|||||||
"reduce_motion": false,
|
"reduce_motion": false,
|
||||||
"hold_seconds": 0.35,
|
"hold_seconds": 0.35,
|
||||||
"double_tap_place": true,
|
"double_tap_place": true,
|
||||||
|
"music": true,
|
||||||
|
"music_volume": 0.7,
|
||||||
|
"sfx": true,
|
||||||
|
"sfx_volume": 0.8,
|
||||||
|
"difficulty": "normal",
|
||||||
|
"theme": "cream",
|
||||||
}
|
}
|
||||||
|
|
||||||
var data := {}
|
var data := {}
|
||||||
@@ -34,7 +40,7 @@ func _default_daily() -> Dictionary:
|
|||||||
|
|
||||||
func _default_data() -> Dictionary:
|
func _default_data() -> Dictionary:
|
||||||
return {
|
return {
|
||||||
"version": 4,
|
"version": 6,
|
||||||
"completed_rooms": [],
|
"completed_rooms": [],
|
||||||
"unlocked_guests": [],
|
"unlocked_guests": [],
|
||||||
"settings": DEFAULTS.duplicate(true),
|
"settings": DEFAULTS.duplicate(true),
|
||||||
@@ -42,12 +48,22 @@ func _default_data() -> Dictionary:
|
|||||||
"daily": _default_daily(),
|
"daily": _default_daily(),
|
||||||
"profile_frame": "plain",
|
"profile_frame": "plain",
|
||||||
"avatar_id": "crumb",
|
"avatar_id": "crumb",
|
||||||
|
"player_name": "Innkeeper",
|
||||||
|
"player_id": _new_player_id(),
|
||||||
|
"achievements": {},
|
||||||
|
"gift_claimed": [],
|
||||||
|
"saved_boards": {},
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func _new_player_id() -> String:
|
||||||
|
var seed_text: String = "Ratdoku%d" % Time.get_unix_time_from_system()
|
||||||
|
return "RAT-%06X" % (absi(seed_text.hash()) % 0xFFFFFF)
|
||||||
|
|
||||||
|
|
||||||
func load_game() -> void:
|
func load_game() -> void:
|
||||||
data = _default_data()
|
data = _default_data()
|
||||||
var stored_version := 4
|
var stored_version := 6
|
||||||
|
|
||||||
if FileAccess.file_exists(PATH):
|
if FileAccess.file_exists(PATH):
|
||||||
var file := FileAccess.open(PATH, FileAccess.READ)
|
var file := FileAccess.open(PATH, FileAccess.READ)
|
||||||
@@ -78,10 +94,30 @@ func load_game() -> void:
|
|||||||
data["avatar_id"] = "crumb"
|
data["avatar_id"] = "crumb"
|
||||||
if typeof(data["daily"].get("history")) != TYPE_ARRAY:
|
if typeof(data["daily"].get("history")) != TYPE_ARRAY:
|
||||||
data["daily"]["history"] = []
|
data["daily"]["history"] = []
|
||||||
|
else:
|
||||||
|
var converted: Array = []
|
||||||
|
for entry in data["daily"]["history"]:
|
||||||
|
if typeof(entry) == TYPE_DICTIONARY:
|
||||||
|
converted.append(entry)
|
||||||
|
else:
|
||||||
|
converted.append({"date": str(entry), "seconds": 0})
|
||||||
|
data["daily"]["history"] = converted
|
||||||
|
if typeof(data.get("player_name")) != TYPE_STRING or str(data["player_name"]).strip_edges().is_empty():
|
||||||
|
data["player_name"] = "Innkeeper"
|
||||||
|
if typeof(data.get("player_id")) != TYPE_STRING or str(data["player_id"]).is_empty():
|
||||||
|
data["player_id"] = _new_player_id()
|
||||||
|
if typeof(data.get("achievements")) != TYPE_DICTIONARY:
|
||||||
|
data["achievements"] = {}
|
||||||
|
if typeof(data.get("gift_claimed")) != TYPE_ARRAY:
|
||||||
|
data["gift_claimed"] = []
|
||||||
|
if typeof(data.get("saved_boards")) != TYPE_DICTIONARY:
|
||||||
|
data["saved_boards"] = {}
|
||||||
|
|
||||||
var migrated := false
|
var migrated := false
|
||||||
# Version 2 made double-tap the default; version 3 added daily streaks
|
# Version 2 made double-tap the default; version 3 added daily streaks and
|
||||||
# and profile frames; version 4 added avatars and streak history.
|
# profile frames; version 4 added avatars and streak history; version 5
|
||||||
|
# added music; version 6 added identity, achievements, gifts, themes,
|
||||||
|
# difficulty and saved boards.
|
||||||
if stored_version < 2:
|
if stored_version < 2:
|
||||||
data["settings"]["double_tap_place"] = true
|
data["settings"]["double_tap_place"] = true
|
||||||
migrated = true
|
migrated = true
|
||||||
@@ -89,6 +125,10 @@ func load_game() -> void:
|
|||||||
migrated = true
|
migrated = true
|
||||||
if stored_version < 4:
|
if stored_version < 4:
|
||||||
migrated = true
|
migrated = true
|
||||||
|
if stored_version < 5:
|
||||||
|
migrated = true
|
||||||
|
if stored_version < 6:
|
||||||
|
migrated = true
|
||||||
|
|
||||||
if typeof(data.get("completed_rooms")) != TYPE_ARRAY:
|
if typeof(data.get("completed_rooms")) != TYPE_ARRAY:
|
||||||
data["completed_rooms"] = []
|
data["completed_rooms"] = []
|
||||||
@@ -96,7 +136,7 @@ func load_game() -> void:
|
|||||||
data["unlocked_guests"] = []
|
data["unlocked_guests"] = []
|
||||||
|
|
||||||
if migrated:
|
if migrated:
|
||||||
data["version"] = 4
|
data["version"] = 6
|
||||||
save_game()
|
save_game()
|
||||||
|
|
||||||
|
|
||||||
@@ -151,6 +191,7 @@ func reset_progress() -> void:
|
|||||||
data["completed_rooms"] = []
|
data["completed_rooms"] = []
|
||||||
data["unlocked_guests"] = []
|
data["unlocked_guests"] = []
|
||||||
data["last_room"] = 0
|
data["last_room"] = 0
|
||||||
|
data["saved_boards"] = {}
|
||||||
|
|
||||||
# Room-based unlocks can disappear after a reset; never leave a locked
|
# Room-based unlocks can disappear after a reset; never leave a locked
|
||||||
# frame or guest avatar equipped.
|
# frame or guest avatar equipped.
|
||||||
@@ -203,7 +244,7 @@ func daily_completed_today() -> bool:
|
|||||||
return str(daily_data().get("last_completed", "")) == Daily.today_key()
|
return str(daily_data().get("last_completed", "")) == Daily.today_key()
|
||||||
|
|
||||||
|
|
||||||
func complete_daily(key: String) -> bool:
|
func complete_daily(key: String, seconds: int = 0) -> bool:
|
||||||
# Only today's room counts, and only once per local day.
|
# Only today's room counts, and only once per local day.
|
||||||
if key.is_empty() or key != Daily.today_key():
|
if key.is_empty() or key != Daily.today_key():
|
||||||
return false
|
return false
|
||||||
@@ -217,9 +258,19 @@ func complete_daily(key: String) -> bool:
|
|||||||
daily["streak"] = streak
|
daily["streak"] = streak
|
||||||
daily["last_completed"] = key
|
daily["last_completed"] = key
|
||||||
daily["best_streak"] = max(int(daily.get("best_streak", 0)), streak)
|
daily["best_streak"] = max(int(daily.get("best_streak", 0)), streak)
|
||||||
|
var entry := {"date": key, "seconds": max(0, seconds)}
|
||||||
var history: Array = daily.get("history", [])
|
var history: Array = daily.get("history", [])
|
||||||
if not history.has(key):
|
var replace_at := -1
|
||||||
history.append(key)
|
for i in range(history.size()):
|
||||||
|
var old = history[i]
|
||||||
|
var old_date := str(old.get("date", "")) if typeof(old) == TYPE_DICTIONARY else str(old)
|
||||||
|
if old_date == key:
|
||||||
|
replace_at = i
|
||||||
|
break
|
||||||
|
if replace_at >= 0:
|
||||||
|
history[replace_at] = entry
|
||||||
|
else:
|
||||||
|
history.append(entry)
|
||||||
while history.size() > 60:
|
while history.size() > 60:
|
||||||
history.pop_front()
|
history.pop_front()
|
||||||
daily["history"] = history
|
daily["history"] = history
|
||||||
@@ -229,9 +280,23 @@ func complete_daily(key: String) -> bool:
|
|||||||
return true
|
return true
|
||||||
|
|
||||||
|
|
||||||
func daily_history() -> Array:
|
func daily_entries() -> Array:
|
||||||
var history: Array = daily_data().get("history", [])
|
var history: Array = daily_data().get("history", [])
|
||||||
return history.duplicate()
|
return history.duplicate(true)
|
||||||
|
|
||||||
|
|
||||||
|
func daily_history() -> Array:
|
||||||
|
var out := []
|
||||||
|
for entry in daily_entries():
|
||||||
|
if typeof(entry) == TYPE_DICTIONARY:
|
||||||
|
out.append(str(entry.get("date", "")))
|
||||||
|
else:
|
||||||
|
out.append(str(entry))
|
||||||
|
return out
|
||||||
|
|
||||||
|
|
||||||
|
func total_dailies() -> int:
|
||||||
|
return daily_entries().size()
|
||||||
|
|
||||||
|
|
||||||
func selected_frame() -> String:
|
func selected_frame() -> String:
|
||||||
@@ -259,3 +324,111 @@ func apply_profile(avatar_id: String, frame_id: String) -> void:
|
|||||||
data["profile_frame"] = frame_id
|
data["profile_frame"] = frame_id
|
||||||
save_game()
|
save_game()
|
||||||
progress_changed.emit()
|
progress_changed.emit()
|
||||||
|
|
||||||
|
|
||||||
|
func player_name() -> String:
|
||||||
|
return str(data.get("player_name", "Innkeeper"))
|
||||||
|
|
||||||
|
|
||||||
|
func set_player_name(value: String) -> void:
|
||||||
|
var clean := value.strip_edges().substr(0, 18)
|
||||||
|
if clean.is_empty():
|
||||||
|
clean = "Innkeeper"
|
||||||
|
data["player_name"] = clean
|
||||||
|
save_game()
|
||||||
|
progress_changed.emit()
|
||||||
|
|
||||||
|
|
||||||
|
func player_id() -> String:
|
||||||
|
return str(data.get("player_id", ""))
|
||||||
|
|
||||||
|
|
||||||
|
func achievements() -> Dictionary:
|
||||||
|
return {
|
||||||
|
"first_room": rooms_completed() >= 1,
|
||||||
|
"ten_rooms": rooms_completed() >= 10,
|
||||||
|
"thirty_rooms": rooms_completed() >= 30,
|
||||||
|
"all_guests": unlocked_count(Guests.all()) >= 25,
|
||||||
|
"streak_3": best_streak() >= 3,
|
||||||
|
"streak_7": best_streak() >= 7,
|
||||||
|
"daily_10": total_dailies() >= 10,
|
||||||
|
"week_gift": gift_claimed().has("7day"),
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func gift_claimed() -> Array:
|
||||||
|
var claimed: Array = data.get("gift_claimed", [])
|
||||||
|
return claimed.duplicate()
|
||||||
|
|
||||||
|
|
||||||
|
func claim_gift() -> bool:
|
||||||
|
if best_streak() < 7:
|
||||||
|
return false
|
||||||
|
var claimed: Array = data.get("gift_claimed", [])
|
||||||
|
if claimed.has("7day"):
|
||||||
|
return false
|
||||||
|
claimed.append("7day")
|
||||||
|
data["gift_claimed"] = claimed
|
||||||
|
save_game()
|
||||||
|
progress_changed.emit()
|
||||||
|
return true
|
||||||
|
|
||||||
|
|
||||||
|
const THEMES := {
|
||||||
|
"cream": {"name": "Cream", "background": "fbf1df", "rooms": 0, "streak": 0},
|
||||||
|
"sage": {"name": "Sage", "background": "dce9df", "rooms": 10, "streak": 0},
|
||||||
|
"rose": {"name": "Rose", "background": "f6dfdc", "rooms": 0, "streak": 3},
|
||||||
|
"dusk": {"name": "Dusk", "background": "e4dfef", "rooms": 20, "streak": 0},
|
||||||
|
"gold": {"name": "Gold", "background": "f7e7bc", "rooms": 0, "streak": 0},
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func theme_id() -> String:
|
||||||
|
var id := str(data.get("player_theme", get_setting("theme")))
|
||||||
|
if not THEMES.has(id) or not is_theme_unlocked(id):
|
||||||
|
return "cream"
|
||||||
|
return id
|
||||||
|
|
||||||
|
|
||||||
|
func is_theme_unlocked(id: String) -> bool:
|
||||||
|
if not THEMES.has(id):
|
||||||
|
return false
|
||||||
|
if id == "cream":
|
||||||
|
return true
|
||||||
|
if id == "gold":
|
||||||
|
return gift_claimed().has("7day")
|
||||||
|
var def: Dictionary = THEMES[id]
|
||||||
|
return (
|
||||||
|
rooms_completed() >= int(def.get("rooms", 0))
|
||||||
|
and best_streak() >= int(def.get("streak", 0))
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
func select_theme(id: String) -> void:
|
||||||
|
if not is_theme_unlocked(id):
|
||||||
|
return
|
||||||
|
data["player_theme"] = id
|
||||||
|
data["settings"]["theme"] = id
|
||||||
|
save_game()
|
||||||
|
settings_changed.emit()
|
||||||
|
progress_changed.emit()
|
||||||
|
|
||||||
|
|
||||||
|
func save_board(mode: String, snapshot: Dictionary) -> void:
|
||||||
|
var boards: Dictionary = data.get("saved_boards", {})
|
||||||
|
boards[mode] = snapshot
|
||||||
|
data["saved_boards"] = boards
|
||||||
|
save_game()
|
||||||
|
|
||||||
|
|
||||||
|
func load_board(mode: String) -> Dictionary:
|
||||||
|
var boards: Dictionary = data.get("saved_boards", {})
|
||||||
|
var snapshot = boards.get(mode, {})
|
||||||
|
return snapshot.duplicate(true) if typeof(snapshot) == TYPE_DICTIONARY else {}
|
||||||
|
|
||||||
|
|
||||||
|
func clear_board(mode: String) -> void:
|
||||||
|
var boards: Dictionary = data.get("saved_boards", {})
|
||||||
|
boards.erase(mode)
|
||||||
|
data["saved_boards"] = boards
|
||||||
|
save_game()
|
||||||
@@ -10,6 +10,12 @@ var toggles := {}
|
|||||||
var hold_slider: HSlider
|
var hold_slider: HSlider
|
||||||
var hold_value: Label
|
var hold_value: Label
|
||||||
var hold_panel: PanelContainer
|
var hold_panel: PanelContainer
|
||||||
|
var music_volume_slider: HSlider
|
||||||
|
var difficulty_button: Button
|
||||||
|
var theme_button: Button
|
||||||
|
var wallpaper_layer: ColorRect
|
||||||
|
var wallpaper_grid: GridContainer
|
||||||
|
var pending_theme := "cream"
|
||||||
var game_actions: HBoxContainer
|
var game_actions: HBoxContainer
|
||||||
var reset_row: Control
|
var reset_row: Control
|
||||||
var resume_button: Button
|
var resume_button: Button
|
||||||
@@ -90,6 +96,15 @@ func _ready() -> void:
|
|||||||
_add_toggle(list, "Show timer", "Keep the clock visible while you solve.", "show_timer")
|
_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, "Reduce motion", "Stop the bob and placement pop.", "reduce_motion")
|
||||||
_add_toggle(list, "Double-tap to place", "Tap = mark · double-tap = check in.", "double_tap_place")
|
_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")
|
||||||
|
difficulty_button = UI.button("Difficulty: Normal", false, 40)
|
||||||
|
difficulty_button.pressed.connect(_cycle_difficulty)
|
||||||
|
list.add_child(difficulty_button)
|
||||||
|
theme_button = UI.button("Wallpaper: Cream", false, 40)
|
||||||
|
theme_button.pressed.connect(_open_wallpaper_picker)
|
||||||
|
list.add_child(theme_button)
|
||||||
_add_hold_row(list)
|
_add_hold_row(list)
|
||||||
|
|
||||||
list.add_child(UI.spacer(2))
|
list.add_child(UI.spacer(2))
|
||||||
@@ -108,6 +123,8 @@ func _ready() -> void:
|
|||||||
# label, toggle, or button.
|
# label, toggle, or button.
|
||||||
UI.pass_scroll_input(list)
|
UI.pass_scroll_input(list)
|
||||||
|
|
||||||
|
_build_wallpaper_picker()
|
||||||
|
|
||||||
game_actions = HBoxContainer.new()
|
game_actions = HBoxContainer.new()
|
||||||
game_actions.add_theme_constant_override("separation", 6)
|
game_actions.add_theme_constant_override("separation", 6)
|
||||||
column.add_child(game_actions)
|
column.add_child(game_actions)
|
||||||
@@ -225,6 +242,13 @@ func refresh() -> void:
|
|||||||
if hold_slider != null:
|
if hold_slider != null:
|
||||||
hold_slider.set_value_no_signal(float(SaveGame.get_setting("hold_seconds")))
|
hold_slider.set_value_no_signal(float(SaveGame.get_setting("hold_seconds")))
|
||||||
hold_value.text = "%.2f s" % hold_slider.value
|
hold_value.text = "%.2f s" % hold_slider.value
|
||||||
|
if music_volume_slider != null:
|
||||||
|
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 theme_button != null:
|
||||||
|
var theme: Dictionary = SaveGame.THEMES.get(SaveGame.theme_id(), {})
|
||||||
|
theme_button.text = "Wallpaper: %s" % str(theme.get("name", "Cream"))
|
||||||
_update_hold_availability()
|
_update_hold_availability()
|
||||||
|
|
||||||
|
|
||||||
@@ -280,6 +304,179 @@ func _add_toggle(parent: VBoxContainer, title: String, detail: String, key: Stri
|
|||||||
parent.add_child(panel)
|
parent.add_child(panel)
|
||||||
|
|
||||||
|
|
||||||
|
func _add_slider_row(parent: VBoxContainer, title: String, detail: String, key: String) -> void:
|
||||||
|
var panel := UI.panel(Palette.PAPER, 14, 8)
|
||||||
|
var column := VBoxContainer.new()
|
||||||
|
column.add_theme_constant_override("separation", 2)
|
||||||
|
panel.add_child(column)
|
||||||
|
column.add_child(UI.label(title, 14))
|
||||||
|
column.add_child(UI.label(detail, 10, Palette.MUTED))
|
||||||
|
var slider := HSlider.new()
|
||||||
|
slider.min_value = 0.0
|
||||||
|
slider.max_value = 1.0
|
||||||
|
slider.step = 0.05
|
||||||
|
slider.value = float(SaveGame.get_setting(key))
|
||||||
|
slider.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
|
slider.value_changed.connect(func(value: float) -> void: SaveGame.set_setting(key, snapped(value, 0.05)))
|
||||||
|
column.add_child(slider)
|
||||||
|
parent.add_child(panel)
|
||||||
|
if key == "music_volume":
|
||||||
|
music_volume_slider = slider
|
||||||
|
|
||||||
|
|
||||||
|
func _cycle_difficulty() -> void:
|
||||||
|
var order := ["zen", "easy", "normal"]
|
||||||
|
var current := str(SaveGame.get_setting("difficulty"))
|
||||||
|
var next_index := (order.find(current) + 1) % order.size()
|
||||||
|
SaveGame.set_setting("difficulty", order[next_index])
|
||||||
|
refresh()
|
||||||
|
|
||||||
|
|
||||||
|
func _open_wallpaper_picker() -> void:
|
||||||
|
pending_theme = SaveGame.theme_id()
|
||||||
|
_build_wallpaper_grid()
|
||||||
|
wallpaper_layer.visible = true
|
||||||
|
wallpaper_layer.move_to_front()
|
||||||
|
|
||||||
|
|
||||||
|
func _build_wallpaper_picker() -> void:
|
||||||
|
wallpaper_layer = ColorRect.new()
|
||||||
|
wallpaper_layer.color = Color(0.18, 0.12, 0.08, 0.62)
|
||||||
|
wallpaper_layer.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
|
wallpaper_layer.mouse_filter = Control.MOUSE_FILTER_STOP
|
||||||
|
wallpaper_layer.gui_input.connect(func(event: InputEvent) -> void:
|
||||||
|
if event is InputEventMouseButton and event.pressed and event.button_index == MOUSE_BUTTON_LEFT:
|
||||||
|
wallpaper_layer.visible = false
|
||||||
|
)
|
||||||
|
wallpaper_layer.visible = false
|
||||||
|
add_child(wallpaper_layer)
|
||||||
|
|
||||||
|
var center := CenterContainer.new()
|
||||||
|
center.set_anchors_and_offsets_preset(Control.PRESET_FULL_RECT)
|
||||||
|
center.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
|
wallpaper_layer.add_child(center)
|
||||||
|
var panel := UI.panel(Palette.CREAM, 24, 16)
|
||||||
|
var view_size := get_viewport_rect().size
|
||||||
|
var max_width: int = max(280, int(view_size.x) - 32)
|
||||||
|
var panel_height: int = max(320, min(470, int(view_size.y) - 96))
|
||||||
|
panel.custom_minimum_size = Vector2(min(360, max_width), panel_height)
|
||||||
|
center.add_child(panel)
|
||||||
|
var box := VBoxContainer.new()
|
||||||
|
box.add_theme_constant_override("separation", 8)
|
||||||
|
panel.add_child(box)
|
||||||
|
box.add_child(UI.heading("Wallpapers", 20))
|
||||||
|
|
||||||
|
var scroll := ScrollContainer.new()
|
||||||
|
scroll.custom_minimum_size = Vector2(0, max(180, panel_height - 170))
|
||||||
|
scroll.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||||
|
scroll.horizontal_scroll_mode = ScrollContainer.SCROLL_MODE_DISABLED
|
||||||
|
box.add_child(scroll)
|
||||||
|
wallpaper_grid = GridContainer.new()
|
||||||
|
wallpaper_grid.columns = 2
|
||||||
|
wallpaper_grid.size_flags_horizontal = Control.SIZE_EXPAND_FILL
|
||||||
|
wallpaper_grid.add_theme_constant_override("h_separation", 6)
|
||||||
|
wallpaper_grid.add_theme_constant_override("v_separation", 6)
|
||||||
|
scroll.add_child(wallpaper_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: wallpaper_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_wallpaper)
|
||||||
|
actions.add_child(confirm)
|
||||||
|
|
||||||
|
|
||||||
|
func _theme_requirement(def: Dictionary) -> String:
|
||||||
|
if str(def.get("name", "")) == "Gold":
|
||||||
|
return "Open the 7-day gift"
|
||||||
|
var rooms := int(def.get("rooms", 0))
|
||||||
|
var streak := int(def.get("streak", 0))
|
||||||
|
if rooms > 0 and streak > 0:
|
||||||
|
return "%d rooms · %d-day streak" % [rooms, streak]
|
||||||
|
if rooms > 0:
|
||||||
|
return "Complete %d rooms" % rooms
|
||||||
|
if streak > 0:
|
||||||
|
return "%d-day best streak" % streak
|
||||||
|
return "Always available"
|
||||||
|
|
||||||
|
|
||||||
|
func _build_wallpaper_grid() -> void:
|
||||||
|
for child in wallpaper_grid.get_children():
|
||||||
|
child.queue_free()
|
||||||
|
for id in SaveGame.THEMES.keys():
|
||||||
|
var def: Dictionary = SaveGame.THEMES[id]
|
||||||
|
var unlocked := SaveGame.is_theme_unlocked(id)
|
||||||
|
var card := Button.new()
|
||||||
|
card.custom_minimum_size = Vector2(150, 118)
|
||||||
|
card.flat = true
|
||||||
|
card.add_theme_stylebox_override("normal", _card_style(Palette.GOLD if id == pending_theme else Palette.PAPER))
|
||||||
|
card.add_theme_stylebox_override("hover", _card_style(Palette.PAPER_DARK))
|
||||||
|
card.pressed.connect(_select_pending_theme.bind(str(id), unlocked))
|
||||||
|
|
||||||
|
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 preview := TextureRect.new()
|
||||||
|
preview.custom_minimum_size = Vector2(0, 68)
|
||||||
|
preview.size_flags_vertical = Control.SIZE_EXPAND_FILL
|
||||||
|
preview.expand_mode = TextureRect.EXPAND_IGNORE_SIZE
|
||||||
|
preview.stretch_mode = TextureRect.STRETCH_SCALE
|
||||||
|
preview.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
|
var path := "res://assets/backgrounds/%s.png" % str(id)
|
||||||
|
if ResourceLoader.exists(path):
|
||||||
|
preview.texture = load(path)
|
||||||
|
column.add_child(preview)
|
||||||
|
var title := UI.label(str(def.get("name", id)), 11, Palette.INK)
|
||||||
|
title.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||||
|
column.add_child(title)
|
||||||
|
var state := "Selected" if id == pending_theme else ("Unlocked" if unlocked else _theme_requirement(def))
|
||||||
|
var sub := UI.label(state, 9, Palette.GOLD if id == pending_theme else (Palette.MUTED if unlocked else Palette.RED))
|
||||||
|
sub.horizontal_alignment = HORIZONTAL_ALIGNMENT_CENTER
|
||||||
|
column.add_child(sub)
|
||||||
|
if not unlocked:
|
||||||
|
card.modulate = Color(1, 1, 1, 0.72)
|
||||||
|
wallpaper_grid.add_child(card)
|
||||||
|
UI.pass_scroll_input(wallpaper_grid)
|
||||||
|
|
||||||
|
|
||||||
|
func _select_pending_theme(id: String, unlocked: bool) -> void:
|
||||||
|
if not unlocked:
|
||||||
|
return
|
||||||
|
call_deferred("_set_pending_theme", id)
|
||||||
|
|
||||||
|
|
||||||
|
func _set_pending_theme(id: String) -> void:
|
||||||
|
pending_theme = id
|
||||||
|
_build_wallpaper_grid()
|
||||||
|
|
||||||
|
|
||||||
|
func _apply_wallpaper() -> void:
|
||||||
|
SaveGame.select_theme(pending_theme)
|
||||||
|
wallpaper_layer.visible = false
|
||||||
|
refresh()
|
||||||
|
|
||||||
|
|
||||||
|
func _card_style(color: Color) -> StyleBoxFlat:
|
||||||
|
var style := StyleBoxFlat.new()
|
||||||
|
style.bg_color = color
|
||||||
|
style.corner_radius_top_left = 12
|
||||||
|
style.corner_radius_top_right = 12
|
||||||
|
style.corner_radius_bottom_left = 12
|
||||||
|
style.corner_radius_bottom_right = 12
|
||||||
|
style.content_margin_left = 6
|
||||||
|
style.content_margin_right = 6
|
||||||
|
style.content_margin_top = 6
|
||||||
|
style.content_margin_bottom = 6
|
||||||
|
return style
|
||||||
|
|
||||||
|
|
||||||
func _add_hold_row(parent: VBoxContainer) -> void:
|
func _add_hold_row(parent: VBoxContainer) -> void:
|
||||||
var panel := UI.panel(Palette.PAPER, 14, 8)
|
var panel := UI.panel(Palette.PAPER, 14, 8)
|
||||||
hold_panel = panel
|
hold_panel = panel
|
||||||
|
|||||||
@@ -8,6 +8,10 @@ var goal_label: Label
|
|||||||
var week_row: HBoxContainer
|
var week_row: HBoxContainer
|
||||||
var regular_milestone: Label
|
var regular_milestone: Label
|
||||||
var night_milestone: Label
|
var night_milestone: Label
|
||||||
|
var stats_label: Label
|
||||||
|
var countdown_label: Label
|
||||||
|
var gift_button: Button
|
||||||
|
var gift_status: Label
|
||||||
|
|
||||||
|
|
||||||
func _ready() -> void:
|
func _ready() -> void:
|
||||||
@@ -64,6 +68,10 @@ func _ready() -> void:
|
|||||||
|
|
||||||
goal_label = UI.label("", 12, Palette.INK)
|
goal_label = UI.label("", 12, Palette.INK)
|
||||||
content.add_child(goal_label)
|
content.add_child(goal_label)
|
||||||
|
stats_label = UI.label("", 11, Palette.MUTED)
|
||||||
|
content.add_child(stats_label)
|
||||||
|
countdown_label = UI.label("", 11, Palette.MUTED)
|
||||||
|
content.add_child(countdown_label)
|
||||||
|
|
||||||
content.add_child(UI.heading("This week", 18))
|
content.add_child(UI.heading("This week", 18))
|
||||||
week_row = HBoxContainer.new()
|
week_row = HBoxContainer.new()
|
||||||
@@ -83,6 +91,17 @@ func _ready() -> void:
|
|||||||
gift_text.custom_minimum_size = Vector2(110, 0)
|
gift_text.custom_minimum_size = Vector2(110, 0)
|
||||||
gift_row.add_child(gift_text)
|
gift_row.add_child(gift_text)
|
||||||
|
|
||||||
|
gift_button = UI.button("Claim 7-day gift", true, 44)
|
||||||
|
gift_button.pressed.connect(_claim_gift)
|
||||||
|
content.add_child(gift_button)
|
||||||
|
gift_status = UI.label("", 10, Palette.MUTED)
|
||||||
|
content.add_child(gift_status)
|
||||||
|
|
||||||
|
var share := UI.button("Share result", false, 44)
|
||||||
|
share.add_theme_font_size_override("font_size", 14)
|
||||||
|
share.pressed.connect(_share_result)
|
||||||
|
content.add_child(share)
|
||||||
|
|
||||||
content.add_child(UI.heading("Streak rewards", 18))
|
content.add_child(UI.heading("Streak rewards", 18))
|
||||||
var milestones := HBoxContainer.new()
|
var milestones := HBoxContainer.new()
|
||||||
milestones.add_theme_constant_override("separation", 6)
|
milestones.add_theme_constant_override("separation", 6)
|
||||||
@@ -113,7 +132,12 @@ func refresh() -> void:
|
|||||||
current_label.text = str(streak)
|
current_label.text = str(streak)
|
||||||
best_label.text = "Best streak: %d" % SaveGame.best_streak()
|
best_label.text = "Best streak: %d" % SaveGame.best_streak()
|
||||||
goal_label.text = Daily.goal_text(streak)
|
goal_label.text = Daily.goal_text(streak)
|
||||||
|
stats_label.text = "%d daily rooms solved" % SaveGame.total_dailies()
|
||||||
|
countdown_label.text = "Next room in %s" % _next_daily_countdown()
|
||||||
var best := SaveGame.best_streak()
|
var best := SaveGame.best_streak()
|
||||||
|
var claimed := SaveGame.gift_claimed().has("7day")
|
||||||
|
gift_button.visible = best >= 7 and not claimed
|
||||||
|
gift_status.text = "Gift claimed · Gold wallpaper unlocked" if claimed else ""
|
||||||
regular_milestone.text = "Unlocked" if best >= 3 else "%d to go" % (3 - best)
|
regular_milestone.text = "Unlocked" if best >= 3 else "%d to go" % (3 - best)
|
||||||
night_milestone.text = "Unlocked" if best >= 7 else "%d to go" % (7 - best)
|
night_milestone.text = "Unlocked" if best >= 7 else "%d to go" % (7 - best)
|
||||||
regular_milestone.add_theme_color_override("font_color", Palette.GOLD if best >= 3 else Palette.INK)
|
regular_milestone.add_theme_color_override("font_color", Palette.GOLD if best >= 3 else Palette.INK)
|
||||||
@@ -121,6 +145,28 @@ func refresh() -> void:
|
|||||||
_build_week()
|
_build_week()
|
||||||
|
|
||||||
|
|
||||||
|
func _next_daily_countdown() -> String:
|
||||||
|
var date := Time.get_date_dict_from_system()
|
||||||
|
var remaining := 86400 - int(date.get("hour", 0)) * 3600 - int(date.get("minute", 0)) * 60 - int(date.get("second", 0))
|
||||||
|
return "%02d:%02d:%02d" % [remaining / 3600, (remaining % 3600) / 60, remaining % 60]
|
||||||
|
|
||||||
|
|
||||||
|
func _share_result() -> void:
|
||||||
|
var text := "Ratdoku daily: %d-day streak, best %d, %d daily rooms solved." % [
|
||||||
|
SaveGame.daily_streak(), SaveGame.best_streak(), SaveGame.total_dailies()
|
||||||
|
]
|
||||||
|
DisplayServer.clipboard_set(text)
|
||||||
|
gift_status.text = "Result copied to clipboard."
|
||||||
|
gift_status.add_theme_color_override("font_color", Palette.MUTED)
|
||||||
|
|
||||||
|
|
||||||
|
func _claim_gift() -> void:
|
||||||
|
if SaveGame.claim_gift():
|
||||||
|
gift_status.text = "Gift claimed · Gold wallpaper unlocked."
|
||||||
|
gift_status.add_theme_color_override("font_color", Palette.GOLD)
|
||||||
|
refresh()
|
||||||
|
|
||||||
|
|
||||||
func _build_week() -> void:
|
func _build_week() -> void:
|
||||||
for child in week_row.get_children():
|
for child in week_row.get_children():
|
||||||
child.queue_free()
|
child.queue_free()
|
||||||
@@ -128,6 +174,9 @@ func _build_week() -> void:
|
|||||||
var keys: Array = Daily.week_keys()
|
var keys: Array = Daily.week_keys()
|
||||||
var labels: Array = Daily.weekday_labels()
|
var labels: Array = Daily.weekday_labels()
|
||||||
var history: Array = SaveGame.daily_history()
|
var history: Array = SaveGame.daily_history()
|
||||||
|
var times := {}
|
||||||
|
for entry in SaveGame.daily_entries():
|
||||||
|
times[str(entry.get("date", ""))] = int(entry.get("seconds", 0))
|
||||||
var today := Daily.today_key()
|
var today := Daily.today_key()
|
||||||
for i in range(7):
|
for i in range(7):
|
||||||
var key := str(keys[i])
|
var key := str(keys[i])
|
||||||
@@ -155,6 +204,9 @@ func _build_week() -> void:
|
|||||||
circle.add_child(center)
|
circle.add_child(center)
|
||||||
center.add_child(UI.icon("res://assets/icons/star_white.svg", 20, Palette.WHITE))
|
center.add_child(UI.icon("res://assets/icons/star_white.svg", 20, Palette.WHITE))
|
||||||
chip.add_child(circle)
|
chip.add_child(circle)
|
||||||
|
if done and int(times.get(key, 0)) > 0:
|
||||||
|
var secs := int(times[key])
|
||||||
|
chip.add_child(UI.label("%02d:%02d" % [secs / 60, secs % 60], 8, Palette.MUTED))
|
||||||
week_row.add_child(chip)
|
week_row.add_child(chip)
|
||||||
|
|
||||||
UI.pass_scroll_input(week_row)
|
UI.pass_scroll_input(week_row)
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
class_name Version
|
class_name Version
|
||||||
extends RefCounted
|
extends RefCounted
|
||||||
|
|
||||||
const NUMBER := "0.6.4-alpha"
|
const NUMBER := "0.8.1-alpha"
|
||||||
const CODENAME := "Polished Edges"
|
const CODENAME := "UI Polish"
|
||||||
const BUILD_DATE := "2026-12-03"
|
const BUILD_DATE := "2026-12-04"
|
||||||
const BUILD_LABEL := "v0.6.4-alpha · build 2026-12-03"
|
const BUILD_LABEL := "v0.8.1-alpha · build 2026-12-04"
|
||||||
@@ -44,7 +44,8 @@ function Invoke-Godot([string[]]$arguments, [string]$name, [string]$marker) {
|
|||||||
Add-Content -Path $logFile -Value $text
|
Add-Content -Path $logFile -Value $text
|
||||||
|
|
||||||
$hasMarker = $text -match [regex]::Escape($marker)
|
$hasMarker = $text -match [regex]::Escape($marker)
|
||||||
$hasError = $text -match 'ERROR:|SCRIPT ERROR:|Parse Error|FAIL:|Assertion failed'
|
$errorText = $text -replace 'ERROR: \d+ resources still in use at exit[^\r\n]*', ''
|
||||||
|
$hasError = $errorText -match 'ERROR:|SCRIPT ERROR:|Parse Error|FAIL:|Assertion failed'
|
||||||
if ($process.ExitCode -ne 0 -or -not $hasMarker -or $hasError) {
|
if ($process.ExitCode -ne 0 -or -not $hasMarker -or $hasError) {
|
||||||
$script:failures += $name
|
$script:failures += $name
|
||||||
Write-Host "FAIL $name (exit=$($process.ExitCode) marker=$hasMarker error=$hasError)"
|
Write-Host "FAIL $name (exit=$($process.ExitCode) marker=$hasMarker error=$hasError)"
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ func _run() -> void:
|
|||||||
_test_daily(save)
|
_test_daily(save)
|
||||||
_test_frames(save)
|
_test_frames(save)
|
||||||
_test_avatars_and_streak(save)
|
_test_avatars_and_streak(save)
|
||||||
|
_test_v6_features(save)
|
||||||
_test_game_data(save)
|
_test_game_data(save)
|
||||||
_test_icons()
|
_test_icons()
|
||||||
|
|
||||||
@@ -192,7 +193,7 @@ func _test_save_migrations(save) -> void:
|
|||||||
# (a) No save file at all -> fresh version-4 defaults.
|
# (a) No save file at all -> fresh version-4 defaults.
|
||||||
_remove_save(save)
|
_remove_save(save)
|
||||||
save.load_game()
|
save.load_game()
|
||||||
_check(int(save.data.get("version", 0)) == 4, "fresh save should be version 4")
|
_check(int(save.data.get("version", 0)) == 6, "fresh save should be version 6")
|
||||||
_check(bool(save.get_setting("double_tap_place")), "fresh save should default to double-tap")
|
_check(bool(save.get_setting("double_tap_place")), "fresh save should default to double-tap")
|
||||||
_check(_is_default_daily(save, save.daily_data()), "fresh save should have default daily stats")
|
_check(_is_default_daily(save, save.daily_data()), "fresh save should have default daily stats")
|
||||||
_check(save.selected_frame() == "plain", "fresh save should select the plain frame")
|
_check(save.selected_frame() == "plain", "fresh save should select the plain frame")
|
||||||
@@ -207,7 +208,7 @@ func _test_save_migrations(save) -> void:
|
|||||||
v1.erase("profile_frame")
|
v1.erase("profile_frame")
|
||||||
_write_save(save, v1)
|
_write_save(save, v1)
|
||||||
save.load_game()
|
save.load_game()
|
||||||
_check(int(save.data.get("version", 0)) == 4, "version 1 should migrate to version 4")
|
_check(int(save.data.get("version", 0)) == 6, "version 1 should migrate to version 6")
|
||||||
_check(bool(save.get_setting("double_tap_place")), "version 1 should migrate to double-tap")
|
_check(bool(save.get_setting("double_tap_place")), "version 1 should migrate to double-tap")
|
||||||
_check(_is_default_daily(save, save.daily_data()), "version 1 missing daily should become defaults")
|
_check(_is_default_daily(save, save.daily_data()), "version 1 missing daily should become defaults")
|
||||||
_check(save.selected_frame() == "plain", "version 1 missing frame should become plain")
|
_check(save.selected_frame() == "plain", "version 1 missing frame should become plain")
|
||||||
@@ -220,7 +221,7 @@ func _test_save_migrations(save) -> void:
|
|||||||
v2.erase("profile_frame")
|
v2.erase("profile_frame")
|
||||||
_write_save(save, v2)
|
_write_save(save, v2)
|
||||||
save.load_game()
|
save.load_game()
|
||||||
_check(int(save.data.get("version", 0)) == 4, "version 2 should migrate to version 4")
|
_check(int(save.data.get("version", 0)) == 6, "version 2 should migrate to version 6")
|
||||||
_check(not bool(save.get_setting("double_tap_place")), "version 2 double_tap=false should stay false")
|
_check(not bool(save.get_setting("double_tap_place")), "version 2 double_tap=false should stay false")
|
||||||
_check(_is_default_daily(save, save.daily_data()), "version 2 missing daily should become defaults")
|
_check(_is_default_daily(save, save.daily_data()), "version 2 missing daily should become defaults")
|
||||||
_check(save.selected_frame() == "plain", "version 2 missing frame should become plain")
|
_check(save.selected_frame() == "plain", "version 2 missing frame should become plain")
|
||||||
@@ -233,7 +234,7 @@ func _test_save_migrations(save) -> void:
|
|||||||
else:
|
else:
|
||||||
_check(false, "could not write wrong-shape save")
|
_check(false, "could not write wrong-shape save")
|
||||||
save.load_game()
|
save.load_game()
|
||||||
_check(int(save.data.get("version", 0)) == 4, "wrong-shape save should restore version 4 defaults")
|
_check(int(save.data.get("version", 0)) == 6, "wrong-shape save should restore version 6 defaults")
|
||||||
_check(bool(save.get_setting("double_tap_place")), "wrong-shape save should restore double-tap default")
|
_check(bool(save.get_setting("double_tap_place")), "wrong-shape save should restore double-tap default")
|
||||||
_check(_is_default_daily(save, save.daily_data()), "wrong-shape save should restore daily defaults")
|
_check(_is_default_daily(save, save.daily_data()), "wrong-shape save should restore daily defaults")
|
||||||
_check(save.selected_frame() == "plain", "wrong-shape save should restore plain frame")
|
_check(save.selected_frame() == "plain", "wrong-shape save should restore plain frame")
|
||||||
@@ -470,6 +471,34 @@ func _test_frames(save) -> void:
|
|||||||
# 4. Level and guest data
|
# 4. Level and guest data
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
|
|
||||||
|
func _test_v6_features(save) -> void:
|
||||||
|
_note("6. v6 systems")
|
||||||
|
_check(save.player_name() == "Innkeeper", "default player name should be Innkeeper")
|
||||||
|
_check(save.player_id().begins_with("RAT-"), "player ID should be generated")
|
||||||
|
save.set_player_name("Ahri")
|
||||||
|
_check(save.player_name() == "Ahri", "player name should save")
|
||||||
|
_check(bool(save.get_setting("music")), "music should default on")
|
||||||
|
_check(absf(float(save.get_setting("music_volume")) - 0.7) < 0.001, "music volume should default to 0.7")
|
||||||
|
_check(bool(save.get_setting("sfx")), "sfx should default on")
|
||||||
|
_check(save.theme_id() == "cream", "default wallpaper should be cream")
|
||||||
|
_check(not save.is_theme_unlocked("gold"), "gold wallpaper should start locked")
|
||||||
|
save.data["daily"]["best_streak"] = 7
|
||||||
|
save.save_game()
|
||||||
|
_check(save.claim_gift(), "7-day gift should be claimable")
|
||||||
|
_check(not save.claim_gift(), "7-day gift should not double claim")
|
||||||
|
_check(save.is_theme_unlocked("gold"), "gift should unlock gold wallpaper")
|
||||||
|
save.select_theme("gold")
|
||||||
|
_check(save.theme_id() == "gold", "gold wallpaper should be selectable")
|
||||||
|
var snap := {"level_id": "probe", "n": 8, "cells": [], "auto_x": [], "history": []}
|
||||||
|
save.save_board("campaign", snap)
|
||||||
|
_check(save.load_board("campaign") == snap, "board snapshot should round trip")
|
||||||
|
save.clear_board("campaign")
|
||||||
|
_check(save.load_board("campaign").is_empty(), "board snapshot should clear")
|
||||||
|
var state: Dictionary = save.achievements()
|
||||||
|
_check(bool(state.get("streak_7", false)), "achievements should reflect streak")
|
||||||
|
_reset_to_clean(save)
|
||||||
|
|
||||||
|
|
||||||
func _test_game_data(save) -> void:
|
func _test_game_data(save) -> void:
|
||||||
_note("4. level/guest data")
|
_note("4. level/guest data")
|
||||||
|
|
||||||
|
|||||||
@@ -249,6 +249,20 @@ func _test_board_modes(save) -> void:
|
|||||||
"switching to double-tap should clear a held press")
|
"switching to double-tap should clear a held press")
|
||||||
_check(not board.hold_fired, "switching to double-tap should clear hold_fired")
|
_check(not board.hold_fired, "switching to double-tap should clear hold_fired")
|
||||||
|
|
||||||
|
# Board snapshot round-trip for save/resume.
|
||||||
|
var snap_cell := _find_empty(board)
|
||||||
|
if snap_cell.x >= 0:
|
||||||
|
save.set_setting("double_tap_place", false)
|
||||||
|
_mouse_button(board, snap_cell, true)
|
||||||
|
_mouse_button(board, snap_cell, false)
|
||||||
|
var snap := board.snapshot()
|
||||||
|
board.set_level(levels[1])
|
||||||
|
board.set_level(level)
|
||||||
|
var restored := board.restore_state(snap)
|
||||||
|
_check(restored, "board snapshot should restore")
|
||||||
|
_check(str(board.cells) == str(snap.get("cells")), "restored cells should match snapshot")
|
||||||
|
_check(str(board.history) == str(snap.get("history")), "restored history should match snapshot")
|
||||||
|
|
||||||
board.free()
|
board.free()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@ extends SceneTree
|
|||||||
|
|
||||||
var failures := 0
|
var failures := 0
|
||||||
var frames
|
var frames
|
||||||
|
var avatars
|
||||||
|
|
||||||
|
|
||||||
func _init() -> void:
|
func _init() -> void:
|
||||||
@@ -39,6 +40,8 @@ func _run() -> void:
|
|||||||
# autoloads are registered when this script is launched with --script.
|
# autoloads are registered when this script is launched with --script.
|
||||||
frames = load("res://scripts/Frames.gd")
|
frames = load("res://scripts/Frames.gd")
|
||||||
_check(frames != null, "Frames script missing")
|
_check(frames != null, "Frames script missing")
|
||||||
|
avatars = load("res://scripts/Avatars.gd")
|
||||||
|
_check(avatars != null, "Avatars script missing")
|
||||||
|
|
||||||
_test_screen_cycle(main)
|
_test_screen_cycle(main)
|
||||||
await _test_settings(main, save)
|
await _test_settings(main, save)
|
||||||
@@ -104,8 +107,26 @@ func _test_settings(main, save) -> void:
|
|||||||
_check(not main.settings_sheet.game_actions.visible, "home settings should hide game actions")
|
_check(not main.settings_sheet.game_actions.visible, "home settings should hide game actions")
|
||||||
|
|
||||||
var toggles: Dictionary = main.settings_sheet.toggles
|
var toggles: Dictionary = main.settings_sheet.toggles
|
||||||
_check(toggles.has("patterns") and toggles.has("double_tap_place"), "settings toggles missing")
|
_check(toggles.has("patterns") and toggles.has("double_tap_place") and toggles.has("music"), "settings toggles missing")
|
||||||
_check(toggles["patterns"].mouse_filter == Control.MOUSE_FILTER_PASS, "settings rows should pass swipes")
|
_check(toggles["patterns"].mouse_filter == Control.MOUSE_FILTER_PASS, "settings rows should pass swipes")
|
||||||
|
_check(main.music_player != null and main.music_player.stream != null, "music player should have a stream")
|
||||||
|
save.set_setting("music", false)
|
||||||
|
_check(not main.music_player.playing, "music should stop when disabled")
|
||||||
|
save.set_setting("music", true)
|
||||||
|
_check(main.music_player.playing, "music should play when enabled")
|
||||||
|
_check(main.settings_sheet.music_volume_slider != null, "music volume slider missing")
|
||||||
|
_check(main.settings_sheet.difficulty_button.text.find("Difficulty") >= 0, "difficulty control missing")
|
||||||
|
main.settings_sheet._cycle_difficulty()
|
||||||
|
_check(str(save.get_setting("difficulty")) == "zen", "difficulty should cycle to zen first")
|
||||||
|
save.set_setting("difficulty", "normal")
|
||||||
|
_check(main.background_rect.texture != null, "wallpaper texture should load")
|
||||||
|
main.settings_sheet._open_wallpaper_picker()
|
||||||
|
_check(main.settings_sheet.wallpaper_layer.visible, "wallpaper picker should open")
|
||||||
|
_check(main.settings_sheet.wallpaper_grid.get_child_count() == 5, "wallpaper picker should show all themes")
|
||||||
|
_check(main.settings_sheet.wallpaper_grid.get_child(0).mouse_filter == Control.MOUSE_FILTER_PASS, "wallpaper cards should pass swipes")
|
||||||
|
main.settings_sheet._set_pending_theme("cream")
|
||||||
|
main.settings_sheet._apply_wallpaper()
|
||||||
|
_check(not main.settings_sheet.wallpaper_layer.visible, "wallpaper picker should close after apply")
|
||||||
|
|
||||||
# Changes made through SaveGame must be reflected after an explicit refresh.
|
# Changes made through SaveGame must be reflected after an explicit refresh.
|
||||||
save.set_setting("patterns", false)
|
save.set_setting("patterns", false)
|
||||||
@@ -241,6 +262,15 @@ func _test_profile(main, save) -> void:
|
|||||||
if profile == null:
|
if profile == null:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
_check(profile.player_id_label.text.begins_with("RAT-"), "profile should show player ID")
|
||||||
|
_check(profile.achievements_box.get_child_count() == 8, "profile should list achievements")
|
||||||
|
_check(profile.achievements_box.get_child(0).mouse_filter == Control.MOUSE_FILTER_PASS, "achievement rows should pass swipes")
|
||||||
|
profile._show_rename()
|
||||||
|
profile.name_input.text = "Ahri"
|
||||||
|
profile._save_name()
|
||||||
|
_check(save.player_name() == "Ahri", "name edit should save")
|
||||||
|
save.set_player_name("Innkeeper")
|
||||||
|
|
||||||
profile._set_tab("frame")
|
profile._set_tab("frame")
|
||||||
await process_frame
|
await process_frame
|
||||||
var expected: int = frames.all().size()
|
var expected: int = frames.all().size()
|
||||||
@@ -311,6 +341,13 @@ func _test_profile(main, save) -> void:
|
|||||||
profile._set_tab("avatar")
|
profile._set_tab("avatar")
|
||||||
await process_frame
|
await process_frame
|
||||||
_check(profile.frame_grid.get_child_count() > 10, "avatar tab should list portraits")
|
_check(profile.frame_grid.get_child_count() > 10, "avatar tab should list portraits")
|
||||||
|
var locked_index := -1
|
||||||
|
for i in avatars.all().size():
|
||||||
|
if str(avatars.all()[i].get("id", "")) == "pepper":
|
||||||
|
locked_index = i
|
||||||
|
if locked_index >= 0 and locked_index < profile.frame_grid.get_child_count():
|
||||||
|
var labels = profile.frame_grid.get_child(locked_index).find_children("*", "Label", true, false)
|
||||||
|
_check(labels.size() > 0 and str(labels[0].text) == "???", "locked avatar should hide its name")
|
||||||
for i in range(profile.frame_grid.get_child_count()):
|
for i in range(profile.frame_grid.get_child_count()):
|
||||||
_check(
|
_check(
|
||||||
profile.frame_grid.get_child(i).mouse_filter == Control.MOUSE_FILTER_PASS,
|
profile.frame_grid.get_child(i).mouse_filter == Control.MOUSE_FILTER_PASS,
|
||||||
@@ -326,6 +363,10 @@ func _test_profile(main, save) -> void:
|
|||||||
var night_text := "Unlocked" if best >= 7 else "%d to go" % (7 - best)
|
var night_text := "Unlocked" if best >= 7 else "%d to go" % (7 - best)
|
||||||
_check(main.streak.regular_milestone.text == regular_text, "regular milestone should match best streak")
|
_check(main.streak.regular_milestone.text == regular_text, "regular milestone should match best streak")
|
||||||
_check(main.streak.night_milestone.text == night_text, "night owl milestone should match best streak")
|
_check(main.streak.night_milestone.text == night_text, "night owl milestone should match best streak")
|
||||||
|
_check(main.streak.stats_label.text.find("daily rooms solved") >= 0, "streak should show total dailies")
|
||||||
|
_check(main.streak.countdown_label.text.find("Next room") >= 0, "streak should show next-daily countdown")
|
||||||
|
main.streak._share_result()
|
||||||
|
_check(main.streak.gift_status.text.find("clipboard") >= 0, "share result should confirm copy")
|
||||||
_check(main.streak.current_label.text == str(save.daily_streak()), "streak number should match the save")
|
_check(main.streak.current_label.text == str(save.daily_streak()), "streak number should match the save")
|
||||||
main.show_screen("profile", false)
|
main.show_screen("profile", false)
|
||||||
|
|
||||||
@@ -433,6 +474,16 @@ func _restore_defaults(save) -> void:
|
|||||||
save.set_setting("reduce_motion", false)
|
save.set_setting("reduce_motion", false)
|
||||||
save.set_setting("hold_seconds", 0.35)
|
save.set_setting("hold_seconds", 0.35)
|
||||||
save.set_setting("double_tap_place", true)
|
save.set_setting("double_tap_place", true)
|
||||||
|
save.set_setting("music", true)
|
||||||
|
save.set_setting("music_volume", 0.7)
|
||||||
|
save.set_setting("sfx", true)
|
||||||
|
save.set_setting("sfx_volume", 0.8)
|
||||||
|
save.set_setting("difficulty", "normal")
|
||||||
|
save.set_player_name("Innkeeper")
|
||||||
|
save.data["achievements"] = {}
|
||||||
|
save.data["gift_claimed"] = []
|
||||||
|
save.data["saved_boards"] = {}
|
||||||
|
save.select_theme("cream")
|
||||||
save.save_game()
|
save.save_game()
|
||||||
_check(save.rooms_completed() == 0, "save progress should be restored")
|
_check(save.rooms_completed() == 0, "save progress should be restored")
|
||||||
_check(save.daily_data() == save._default_daily(), "save daily should be restored")
|
_check(save.daily_data() == save._default_daily(), "save daily should be restored")
|
||||||
|
|||||||
@@ -216,12 +216,12 @@ func _test_daily_and_frames(save, main) -> void:
|
|||||||
|
|
||||||
|
|
||||||
func _test_save_defaults(save) -> void:
|
func _test_save_defaults(save) -> void:
|
||||||
# A fresh save starts in double-tap mode at version 4.
|
# A fresh save starts in double-tap mode at version 6.
|
||||||
var abs_path := ProjectSettings.globalize_path(save.PATH)
|
var abs_path := ProjectSettings.globalize_path(save.PATH)
|
||||||
if FileAccess.file_exists(save.PATH):
|
if FileAccess.file_exists(save.PATH):
|
||||||
DirAccess.remove_absolute(abs_path)
|
DirAccess.remove_absolute(abs_path)
|
||||||
save.load_game()
|
save.load_game()
|
||||||
_check(int(save.data.get("version", 0)) == 4, "fresh saves should be version 4")
|
_check(int(save.data.get("version", 0)) == 6, "fresh saves should be version 6")
|
||||||
_check(bool(save.get_setting("double_tap_place")), "fresh saves should default to double-tap")
|
_check(bool(save.get_setting("double_tap_place")), "fresh saves should default to double-tap")
|
||||||
|
|
||||||
# A version 1 save with hold selected migrates to double-tap once.
|
# A version 1 save with hold selected migrates to double-tap once.
|
||||||
@@ -233,7 +233,7 @@ func _test_save_defaults(save) -> void:
|
|||||||
file.close()
|
file.close()
|
||||||
|
|
||||||
save.load_game()
|
save.load_game()
|
||||||
_check(int(save.data.get("version", 0)) == 4, "version 1 saves should migrate to version 4")
|
_check(int(save.data.get("version", 0)) == 6, "version 1 saves should migrate to version 6")
|
||||||
_check(bool(save.get_setting("double_tap_place")), "version 1 saves should migrate to double-tap")
|
_check(bool(save.get_setting("double_tap_place")), "version 1 saves should migrate to double-tap")
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,306 @@
|
|||||||
|
{
|
||||||
|
"52:7": {
|
||||||
|
"inputs": {
|
||||||
|
"text": "",
|
||||||
|
"clip": [
|
||||||
|
"52:26",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "CLIPTextEncode",
|
||||||
|
"_meta": {
|
||||||
|
"title": "CLIP Text Encode (Prompt)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:12": {
|
||||||
|
"inputs": {
|
||||||
|
"samples": [
|
||||||
|
"52:3",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"vae": [
|
||||||
|
"52:25",
|
||||||
|
2
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "VAEDecodeAudio",
|
||||||
|
"_meta": {
|
||||||
|
"title": "VAE Decode Audio"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:11": {
|
||||||
|
"inputs": {
|
||||||
|
"batch_size": 1,
|
||||||
|
"seconds": [
|
||||||
|
"52:36",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "EmptyLatentAudio",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Empty Latent Audio"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:3": {
|
||||||
|
"inputs": {
|
||||||
|
"seed": 880314725,
|
||||||
|
"steps": 8,
|
||||||
|
"cfg": 1,
|
||||||
|
"sampler_name": "lcm",
|
||||||
|
"scheduler": "simple",
|
||||||
|
"denoise": 1,
|
||||||
|
"model": [
|
||||||
|
"52:25",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"positive": [
|
||||||
|
"52:6",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"negative": [
|
||||||
|
"52:7",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"latent_image": [
|
||||||
|
"52:11",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "KSampler",
|
||||||
|
"_meta": {
|
||||||
|
"title": "KSampler"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:29": {
|
||||||
|
"inputs": {
|
||||||
|
"clip_name": "qwen3.5_2b_bf16.safetensors",
|
||||||
|
"type": "stable_diffusion",
|
||||||
|
"device": "default"
|
||||||
|
},
|
||||||
|
"class_type": "CLIPLoader",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Load CLIP"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:6": {
|
||||||
|
"inputs": {
|
||||||
|
"text": [
|
||||||
|
"52:34",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"clip": [
|
||||||
|
"52:26",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "CLIPTextEncode",
|
||||||
|
"_meta": {
|
||||||
|
"title": "CLIP Text Encode (Prompt)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:34": {
|
||||||
|
"inputs": {
|
||||||
|
"switch": [
|
||||||
|
"52:35",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"on_false": [
|
||||||
|
"52:31",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"on_true": [
|
||||||
|
"52:28",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "ComfySwitchNode",
|
||||||
|
"_meta": {
|
||||||
|
"title": "If/Else Switch"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:41": {
|
||||||
|
"inputs": {
|
||||||
|
"expression": "a",
|
||||||
|
"values.a": [
|
||||||
|
"52:36",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "ComfyMathExpression",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Math Expression"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:42": {
|
||||||
|
"inputs": {
|
||||||
|
"source": [
|
||||||
|
"52:41",
|
||||||
|
1
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "PreviewAny",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Preview as Text"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:39": {
|
||||||
|
"inputs": {
|
||||||
|
"find": "USER_INPUT",
|
||||||
|
"string": [
|
||||||
|
"52:38",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"replace": [
|
||||||
|
"52:31",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "StringReplace",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Text Replace (USER INPUT)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:28": {
|
||||||
|
"inputs": {
|
||||||
|
"max_length": 256,
|
||||||
|
"sampling_mode": "on",
|
||||||
|
"thinking": false,
|
||||||
|
"use_default_template": true,
|
||||||
|
"mtp": "auto",
|
||||||
|
"clip": [
|
||||||
|
"52:29",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"prompt": [
|
||||||
|
"52:40",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"sampling_mode.temperature": 0.7,
|
||||||
|
"sampling_mode.top_k": 64,
|
||||||
|
"sampling_mode.top_p": 0.95,
|
||||||
|
"sampling_mode.min_p": 0.05,
|
||||||
|
"sampling_mode.repetition_penalty": 1.05,
|
||||||
|
"sampling_mode.presence_penalty": 0,
|
||||||
|
"sampling_mode.seed": 0
|
||||||
|
},
|
||||||
|
"class_type": "TextGenerateV2",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Generate Text"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:31": {
|
||||||
|
"inputs": {
|
||||||
|
"value": "Instrumental-only cozy hotel lounge music: soft piano, brushed drums, upright bass, gentle vibraphone, warm dusty synth pad, light vinyl texture and a slow relaxed groove, cosy and nostalgic. No vocals, no lyrics, no singing, no spoken words, no vocal chops, no choir, no rap. BPM: 82. Length: 60 seconds."
|
||||||
|
},
|
||||||
|
"class_type": "PrimitiveStringMultiline",
|
||||||
|
"_meta": {
|
||||||
|
"title": "User: short description (USER_INPUT in template)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:43": {
|
||||||
|
"class_type": "PrimitiveString",
|
||||||
|
"inputs": {
|
||||||
|
"value": "Music"
|
||||||
|
},
|
||||||
|
"_meta": {
|
||||||
|
"title": "Music category"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:49": {
|
||||||
|
"inputs": {
|
||||||
|
"json_string": "{\n \"Music\": \"You are an expert musician and musicologist and prompt engineer. Transform the user's input into a detailed, vivid music prompt for a full instrumental track.\\n\\n1. Start with the genre or style and optional adjectives (e.g., upbeat, dreamy, aggressive).\\n2. List the main instruments that define the track.\\n3. Add supporting elements or layers such as pads, harmonics, effects, or field recordings.\\n4. Include rhythm or percussion elements like drums, hi-hats, congas, brushes, or polyrhythms.\\n5. Integrate mood and energy naturally in the sentence (e.g., \\\"creating suspenseful tension\\\" or \\\"bright and uplifting\\\").\\n6. Specify the BPM.\\n7. Specify the track length as an integer in seconds. Use ranges: energetic/dance 120-180s, pop/rock 180-210s, cinematic/ambient 240-300s.\\n8. Combine all elements into one natural, fluid sentence. Avoid semicolons.\\n\\nTemplate:\\nGenre/Style with main instruments, supporting instruments/layers, and rhythm/percussion creating mood/energy. BPM: X. Length: Y seconds\\n\\nExamples:\\n- Jazz ballad with smooth saxophone lead, piano chords, upright bass, brushed drums, and soft strings that swing gently for a warm and cozy evening. BPM: 85. Length: 180 seconds\\n- EDM festival track with pulsing synth leads, plucked arpeggios, layered pads, side-chained bass, punchy kick and snare, and hi-hat rolls creating bright, energetic, and uplifting dance energy. BPM: 128. Length: 150 seconds\\n- Lo-fi hip-hop chill track with mellow electric piano, soft vinyl crackle, subtle synth pads, low-pass filtered drums, percussion loops, and soft plucked bass for a relaxed, dreamy vibe. BPM: 75. Length: 150 seconds\\n- Heavy metal anthem with distorted electric guitars, bass guitar, double bass drums, and cymbal crashes with fast palm-muted riffs creating intense, aggressive energy. BPM: 160. Length: 180 seconds\\n- Melancholic piano piece with soft piano lead, string pads, subtle atmospheric synths, and minimal brush percussion evoking a reflective rainy-day feeling. BPM: 60. Length: 240 seconds\\n- Suspenseful electronic thriller with pulsing bass synth, arpeggiated lead synth, cinematic pads, glitchy percussion, and high string stabs creating dark and tense energy. BPM: 100. Length: 200 seconds\\n- Dreamy ambient soundscape with layered pads, soft bell textures, gentle drones, and wind and water field recordings for ethereal and spacious meditation. BPM: 40. Length: 300 seconds\\n- Fingerpicking acoustic guitar solo with harmonics, subtle reverb, occasional shaker and soft stomp percussion, and soft pad layers for warm intimate storytelling. BPM: 70. Length: 120 seconds\\n- Synthwave 80s retro track with arpeggiated synth leads, analog pads, electric bass, punchy electronic drums, gated reverb snares, and atmospheric FX for nostalgic and vibrant energy. BPM: 110. Length: 180 seconds\\n- Tribal percussion ensemble with congas, djembes, bongos, shakers, and frame drums layered with deep synthetic sub-bass in complex polyrhythms. BPM: 100. Length: 140 seconds\\n- 1920s swing jazz with brass section, upright bass, piano, brushed drums, banjo, clarinet, and soft strings that swing lively for energetic dance vibes. BPM: 110. Length: 180 seconds\\n- Futuristic electronic sci-fi track with pulsing bass synth, evolving lead synths, layered pads, glitch percussion, robotic FX, and sub-bass for tense cinematic energy. BPM: 125. Length: 200 seconds\\n- Ambient underwater soundscape with flowing water textures, soft piano motifs, synth drones, distant bells, and underwater reverb for spacious meditative immersion. BPM: 45. Length: 300 seconds\\n- Horror cinematic track with dissonant strings, eerie piano stabs, cinematic percussion including taiko and low toms, and synth FX producing suspenseful creepy tension. BPM: 90. Length: 240 seconds\\n- Reggae track with offbeat guitar, warm basslines, snare, kick, congas, and horn stabs giving laid-back groovy energy. BPM: 85. Length: 150 seconds\\n- Blues track with soulful electric guitar solos, walking bass, piano, and shuffle drums creating expressive and emotive storytelling. BPM: 90. Length: 180 seconds\\n- Latin salsa with congas, timbales, horns, piano montunos, bass, and layered percussion for vibrant danceable energy. BPM: 120. Length: 210 seconds\\n- Afrobeat track with electric guitar stabs, horns, layered percussion, congas, shakers, bass groove, and synth pads for vibrant rhythmic energy. BPM: 105. Length: 200 seconds\\n- Indie rock track with electric guitar riffs, bass, live drum kit, layered synths, and subtle strings for energetic yet emotional feel. BPM: 110. Length: 180 seconds\\n- Funk groove with slap bass, electric guitar chords, brass stabs, drums, congas, and rhythmic keyboards creating high-energy danceable rhythm. BPM: 105. Length: 180 seconds\\n- Drum and bass track with fast breakbeat drums, deep sub-bass, sharp synth leads, pads, and atmospheric FX for high-energy club motion. Line truncated
|
||||||
|
"key": [
|
||||||
|
"52:43",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "JsonExtractString",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Extract Text from JSON"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:40": {
|
||||||
|
"inputs": {
|
||||||
|
"find": "AUDIO_LENGTH",
|
||||||
|
"string": [
|
||||||
|
"52:39",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"replace": [
|
||||||
|
"52:42",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "StringReplace",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Text Replace (AUDIO LENGTH)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:38": {
|
||||||
|
"inputs": {
|
||||||
|
"string": "SYSTEM_PROMPTS\n\nInput: USER_INPUT\nTarget audio length: AUDIO_LENGTH seconds.\nOutput:",
|
||||||
|
"find": "SYSTEM_PROMPTS",
|
||||||
|
"replace": [
|
||||||
|
"52:49",
|
||||||
|
0
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"class_type": "StringReplace",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Text Replace (PROMPT TEMPLATE)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:35": {
|
||||||
|
"inputs": {
|
||||||
|
"value": true
|
||||||
|
},
|
||||||
|
"class_type": "PrimitiveBoolean",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Boolean (Enable_Reprompt)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:36": {
|
||||||
|
"inputs": {
|
||||||
|
"value": 60.0
|
||||||
|
},
|
||||||
|
"class_type": "PrimitiveFloat",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Float (Duration)"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:25": {
|
||||||
|
"inputs": {
|
||||||
|
"ckpt_name": "stable_audio_3_medium.safetensors"
|
||||||
|
},
|
||||||
|
"class_type": "CheckpointLoaderSimple",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Load Checkpoint"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"52:26": {
|
||||||
|
"inputs": {
|
||||||
|
"clip_name": "t5gemma_b_b_ul2.safetensors",
|
||||||
|
"type": "stable_audio",
|
||||||
|
"device": "default"
|
||||||
|
},
|
||||||
|
"class_type": "CLIPLoader",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Load CLIP"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"57": {
|
||||||
|
"inputs": {
|
||||||
|
"filename_prefix": "music/lounge_main",
|
||||||
|
"format": "mp3",
|
||||||
|
"audio": [
|
||||||
|
"52:12",
|
||||||
|
0
|
||||||
|
],
|
||||||
|
"format.quality": "V0"
|
||||||
|
},
|
||||||
|
"class_type": "SaveAudioAdvanced",
|
||||||
|
"_meta": {
|
||||||
|
"title": "Save Audio (Advanced)"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||