feat(saves): show read-only per-slot thumbnails, location, era, progress stats, and full date/time #253
No reviewers
Labels
No labels
area/build
area/install
area/saves
area/tooling
area/ui
area/updates
ci: approved
good first issue
gpu/amd
gpu/intel
gpu/nvidia
help wanted
kind
bug
kind
chore
kind
docs
kind
feature
kind
performance
kind
question
platform/linux
platform/steam-deck
platform/windows
priority
critical
priority
high
priority
low
risk
high
risk
low
risk
medium
status
blocked
status
confirmed
status
duplicate
status
invalid
status
needs-info
status
wontfix
ci: approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!253
Loading…
Reference in a new issue
No description provided.
Delete branch "Jer9/LongshotLauncher:feat/saves-slot-previews-main"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Players with multiple saves on the Saves tab can currently only see "Slot 1 / Slot 2" and a date (without the time for older saves), making it hard to tell which playthrough is which. This adds strictly read-only per-slot previews (
caption.sav/progress.sav) and full date+time timestamps to the Saves tab without writing to save files or changingSavesConfirmViewModel.Summary
Core/SaveSlotPreview.cs):FileAccess.Read,FileShare.ReadWrite | FileShare.Delete) and bounds-checked (<= 8 MiBforcaption.sav,<= 4 MiBforprogress.sav).LinkTarget != null || FileAttributes.ReparsePoint) on both theslot_NNdirectory (trimming trailing directory separators) and leaf files (caption.sav/progress.sav), including on directReadCaption/ReadProgresscalls.caption.savarea name viaSaveEditorText.Humanize,Child/Adultera from the scene path at offset 748, and bounded embedded JPEG thumbnail at offset 1396 (validating SOI/SOF/EOI markers,<= 4096×4096,<= 8 MP, aspect ratio before decoding).progress.savhearts/20, rupees, 3 Spiritual Stones, 6 Sage Medallions, Gold Skulltulas, and 9-item main-quest progress (SaveEditorText.Percent, never showing 100% until all 9 are collected), handling trailing bytes, ignoring duplicate field IDs, and rejecting out-of-range values. Missing, truncated, or unrecognized files degrade cleanly to the slot-number badge without throwing.Core/MakeGameRun.cs):Durations.WhenFullrouting older dates throughTr.F("{0}, {1}", Date(t, now), time)for Saves-tab rows while leavingDurations.WhenandSavesConfirmViewModel(FromSlots/ToSlots) unchanged.App/ViewModels/SavesViewModel.cs,App/Views/SavesView.axaml):Grid-based Title + Era badge layout so long area names ellipsize without clipping theChild/Adultbadge, pluralizedTr.Prupee/skulltula counts (matchingSaveEditorViewModel), a clearly labeledMain quest X/9 (Y%)readout (distinct from the save editor's full-game completion%), and Launcher's<c:Bar>control.IDisposableonSlotRowViewModelandILeavingPageonSavesViewModelso decoded rowBitmaps are disposed on everyReload()and when switching away to another top-level tab (while kept alive acrossBackups/Progress/SavesConfirmsub-pages).docs/saves.md,tests/launcher_core/SaveSlotPreviewChecks.cs,tests/launcher_app/Program.cs,tools/screenshots/Program.cs):docs/saves.md(clarifying lightweight read-only Saves-list previews vs. full Progress save editor).Durations.WhenFull), app-level ViewModel/disposal checks (assertingIsDisposedonReload()and tab switches), and synthetic procedural gradient JPEGs for headless screenshots.Prior work & credits
Core/SaveSlotPreview.cs) and@Anarkkie's read-onlycaption.sav/progress.savreader layout in #55. Scoped strictly to lightweight read-only Saves-tab previews (no player profiles, no asset extractor, no save mutations), matching the #55 review suggestion and keeping slot reordering in a separate stacked WIP PR.Screenshots
See the attached screenshots in the first comment below (both real local
543×306in-gamecaption.savthumbnails inspected read-only and synthetic mid/late-game progress fixtures; no save files committed).Testing
Tested (Windows 11, .NET SDK
10.0.404):dotnet build LongshotLauncher.slnx -c Release -p:RestoreLockedMode=true: 0 warnings, 0 errors (Core,App,Screenshots);LauncherCoreTests.csproj: 0 warnings, 0 errors; zeropackages.lock.jsonchanges.dotnet format Core/LongshotLauncher.Core.csproj --verify-no-changes --include Core/SaveSlotPreview.cs: PASS (exit 0) (note: solution-widedotnet format --verify-no-changesfails on pre-existing single-line{ ... }blocks across untouched repo files because the repo has no.editorconfig).dotnet run --project tests/launcher_app/LauncherAppTests.csproj -c Release -p:RestoreLockedMode=true: PASS (includesSaveSlotPreviewsplural/label/timestamp/IsDisposedchecks onReload()andILeavingPage).LauncherCoreTests.dll:SaveSlotPreviewChecks22/22 passed (including live NTFS directory junction + trailing-separator refusal viaFileLinks.TryDirectoryLink; leaf-file symbolic link sub-check skipped on Windows without Developer Mode), plusSaveArchiveChecks(78/78),SaveBackupsChecks(30/30),PadChecks,IconChecks,TranslationChecks, andShownProfileChecksall PASS.scripts/translations.py: 0 new faults (only the 4 pre-existing leftover #244 keys per catalog onmainfixed by #246).saves-backups-listed,saves-progress, narrow760×640German--lang de, plus real-save read-only capture): rendered and visually inspected —Titleellipsizes cleanly while theChild/Adultbadge never clips and<c:Bar>aligns with the card layout.Still to test:
SaveSlotPreviewChecksandSavesChecks.LinkSavesChecks).Risks
Bitmaps on reload and tab leave, and falls back to the existingSlot Nbadge on any unknown or corrupt file.Assisted-by: Antigravity
Adds a strictly read-only, bounded parser (Core/SaveSlotPreview.cs) for caption.sav (area name via SaveEditorText.Humanize, Child/Adult era, and bounded JPEG thumbnail) and progress.sav (hearts, rupees, 3 Spiritual Stones, 6 Sage Medallions, Gold Skulltulas, and main-quest progress), plus Durations.WhenFull for full date+time on the Saves tab. - Core/SaveSlotPreview.cs: refuses symlinks/junctions via LinkTarget and FileAttributes.ReparsePoint on both the slot directory and leaf files, bounds file sizes and JPEG SOF dimensions before decoding, ignores duplicate field IDs and out-of-range values, handles trailing bytes, and degrades cleanly to the slot-number badge. - Core/MakeGameRun.cs: adds Durations.WhenFull using Tr.F("{0}, {1}", Date(t, now), time) without changing Durations.When or SavesConfirmViewModel timestamps. - App/ViewModels/SavesViewModel.cs & App/Views/SavesView.axaml: displays 16:9 thumbnail with fallback, Grid-based Title + Era badge (no badge clipping on truncation), Tr.P pluralized rupees/skulltulas, Launcher's <c:Bar> with clarified Main quest X/9 (Y%) label, and IDisposable cleanup of previous row Bitmaps on Reload(). - docs/saves.md, tests/launcher_core/SaveSlotPreviewChecks.cs, tests/launcher_app/Program.cs, tools/screenshots/Program.cs: reconciled docs, 21 core checks (trailing bytes, duplicate IDs, out-of-range values, directory/file link refusal, WhenFull), app ViewModel checks, and synthetic gradient JPEGs for headless screenshots. Field hashes adapted from Traiver/OOT-SW2SE (MIT) and Anarkkie's LongshotLauncher#55 layout. Assisted-by: AntigravityScreenshots
Real local saves (read-only, actual 543×306
caption.savthumbnails; no save files committed):Synthetic mid/late-game fixtures (
tools/screenshotssavesscene, showing 0%, 55%, and 88%<c:Bar>quest progress, Child/Adult badges, rupees, and Skulltulas):View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.