feat(progress): a Progress page that follows the save, and ticks a line as the game would #366
No reviewers
Labels
No labels
area/build
area/install
area/mods
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
4 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
MagicBeanDev/LongshotLauncher!366
Loading…
Reference in a new issue
No description provided.
Delete branch "neotoxic/LongshotLauncher:feat/lenses"
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 ask what is left to find in their save and what they can do right now. This adds a Progress page to the launcher: the 100 % of the remake, read from the save, chapter by chapter or area by area, with what each thing needs. It is the tracker of Lenses of Truth (0.2.0), built in.
What it does
progress-backupsfirst (a backup never replaces another), then written through a temporary file; a game using the save refuses the edit.The catalogue
assets/progress/catalogue.tsvholds 439 lines: chapter, area, names and how to get each thing (English and French text; keywords and kinds in English), the "done" test, the "feasible" tests and the effects. Likesrc/players/caption.rs, it holds save field identifiers (hashes of their names), facts and our own text: no game file and no save. Every line was checked against the game's data (what each place holds, what each event gives and asks for); what only playing can settle is listed in Lenses of Truth's docs/in-game-checks.md. "Feasible" looks at what the player can get, not what they hold right now.Files
src/progress/(new): catalogue and save reading, the checks,complete(the effects);page.rs, the page;tests.rs, synthetic saves only.ui/progress.slint(new),ui/saves.slint(the details),ui/main.slint(the tab),src/players/mod.rs(slot_file,latest_progress,saves_idle),assets/lang/*.json(the labels, 15 catalogs).Testing
cargo fmt --check,cargo clippy --all-targetsclean;cargo test progress: 11 tests (catalogue reading, feasible paths, each effect, keys kept sorted, a key list cut short, no going back, a backup never replaced, either of two fields).python -I scripts/translations.py: 15 catalogs validated.main(6ae8497) as well: not touched here.🤖 Generated with Claude Code
Screenshots (test profile with copies of real saves, English):
Possibly related, for context:
On the two related pull requests:
mainhas no progress view today. This brings one back, with its own built-in catalogue and the effects of each line, so it needs no tool from a Longshot release.src/players,ui/saves.slint). Both apply cleanly onmaintoday; whichever is merged second gets rebased on the other.@review
Recommendation: Request changes. The editor can mark heart rewards as collected without granting them, and the catalogue contains identifiers taken from game data despite the repository’s prohibition on material made from game files. Save replacement also has a race with a newly started game.
Adds a chapter and area tracker and an optional save editor. The tracker gives players a useful view of progress, but the editor can produce incorrect saves and its game-derived catalogue conflicts with repository rules.
Blocking (3): must change before merging.
assets/progress/catalogue.tsv:73: These heart-piece effects mark the reward collected without adding the Piece of Heart. (more on the line) Do: Apply the appropriate heart-piece reward effects for both lines and add tests using the actual catalogue entries.assets/progress/catalogue.tsv:58: The catalogue includes game-derived object keys and effects, contrary to the repository’s rule against committing anything made from game files. (more on the line) Do: Remove the game-derived material from the repository and use a permitted source or derive the required data locally on the player’s PC.src/progress/page.rs:113: The running-game check is only a snapshot and does not protect the subsequent read and replacement. (more on the line) Do: Coordinate editing and game startup with a shared save lock held through replacement, including external game starts that use the profile.Should fix (2): not blocking, but worth doing before merging.
src/progress/page.rs:183: Changing the followed file retains the previous file’s parsed save if the new file cannot yet be read. (more on the line) Do: Clear the cached save and area when the file changes; retain the old reading only when retrying the same file.docs/saves.md: The save documentation still says the Progress view is read-only and that story and chest completion require a game report. When: A player looking up save behavior is told editing is unavailable even though this change adds an editor and backups. Do: Document the tracker, editor, backup location and game-closed restriction.Testing before merging (1) (the change behaves the same on every system: one run of the change itself is enough; it doesn't hold the recommendation)
src/progress/page.rs:110: The edited save has not been checked in the game. (more on the line) Do: On a disposable local save, edit representative chest, heart-piece and quest lines, launch Longshot through the launcher, and verify the rewards and subsequent save persist.@fixcan do L1, L2, L3, L4 and L5.Checks: Still running: 5 checks.
More: does it help, other systems, switches, what was read
Does it help: Unproven: screenshots show the launcher views and an edit read back by the launcher, but the PR says an edited save was not loaded in the game through the launcher.
Other systems: The save writer affects both Windows and Linux and files subsequently loaded by Longshot. Synthetic tests check the writer’s own interpretation, but do not establish that the game accepts its output or grants each reward. The live view also reads the game’s working copy and caption.
Switches: The Edit control is off when a save is opened and is unavailable while the launcher reports the game playing. No environment or build switches are added.
Reviewed:
c235846a57against6ae84979a2: Read AGENTS.md, CONTRIBUTING.md, docs/saves.md, the commit log, changed Rust progress files and Slint progress view, and the relevant save process checks and caption reader. Reviewed the remaining code changes and skimmed the catalogue and translations; the catalogue’s individual game facts were not independently verified. No review checklist or pull request template was present at the named paths.; nothing run (a code review).Checked and fine:
Testing: No code or tests were run, as requested. The author reports synthetic tests and launcher screenshots; CI is still running.
Overlaps and merge order: #253 also changes save details and player files; the author says whichever merges second should be rebased.
Automated code review by BeanBot (gpt-6.1-terra), asked for by llun. Nothing was run; a maintainer decides.
@ -0,0 +55,4 @@#stat PouchData.Obj_Heart_Piece.StockNum 1374459827#stat PouchData.Item_Token_Gold.StockNum 74668408#stat PlayerStatus.CurrentRupee 28097335910 Story Le réveil de Link ║║Forêt Kokiri : trouver l'épée kokiri dans le labyrinthe et acheter le bouclier mojo pour que Mido laisse passer enum 863135899 1471695344 1275749364 Link Wakes Up ║║Kokiri Forest: find the Kokiri Sword in the maze and buy the Deku Shield so that Mido lets you through KokiriForest story from 863135899 398436934 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; step 863135899 398436934 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; from 863135899 3949112793 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; step 863135899 3949112793 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; step 863135899 3949112793 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; from 863135899 240843480 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; step 863135899 240843480 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; step 863135899 240843480 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; from 863135899 1871805950 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; set 1345285354 0 ; set 4092436840 1 ; set 2054504804 1 ; step 863135899 1871805950 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; step 863135899 1871805950 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; from 863135899 1275749364 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; set 2590024800 1 ; step 863135899 1275749364 1471695344,398436934,3949112793,240843480,1871805950,1275749364 ; step 2104978273 3592842818 1471695344,398436934,3592842818,3957372343,3051307979,1466071034,3576369172,1275749364 ; step 863135899 1275749364 1471695344,398436934,3949112793,240843480,1871805950,1275749364L2 (blocking): The catalogue includes game-derived object keys and effects, contrary to the repository’s rule against committing anything made from game files.
When: The commits describe checking decoded game files and retain object identifiers and effects worked out from the game’s event flows and item table. Those derived values are committed in this catalogue.
Do: Remove the game-derived material from the repository and use a permitted source or derive the required data locally on the player’s PC.
@ -0,0 +70,4 @@3 HyruleField Skulltula d'or : grotte à bombes entre les arbres ║enfant : bombes, boomerang ; ou adulte : bombes ou masse des titans, grappin║Grotte à bombes entre les arbres de la plaine gs 12007978132755687032 bool 2789154349 0/bool 2999220442 0/bool 2525649529 0;bool 2135745421 0|bool 2789154349 0/bool 2999220442 0/bool 2525649529 0/bool 1915219928 0;bool 4288212312 0/bool 950969275 0;bool 2061733467 0 Gold Skulltula: Bomb Grotto Between the Trees ║as a child: bombs, Boomerang; or as an adult: bombs or Megaton Hammer, Hookshot║Bomb grotto between the trees of the field skulltula key 12007978132755687032 ; key 12007978132755687034 ; set 1805882622 1 ; set 3645371615 1 ; stock 74668408 1 max:100 ; set 3718673355 10 HyruleField Coffre de la grotte aux Effrois Rubis violet║chant des tempêtes║Jouer le chant des tempêtes sur le trou couvert de feuilles près de l'entrée de Cocorico, puis vaincre les 2 Effrois : le coffre apparaît bool 2020938610 0 bool 725212495 0 ReDead Grotto Chest Purple Rupee║Song of Storms║Play the Song of Storms on the leaf-covered hole near the Kakariko Village entrance, then defeat the 2 ReDeads: the chest appears chest set 2020938610 1 ; stock 2809733591 50 bag:3036877200=1000,3509980648=500,3068502949=200|base:99 ; set 3718673355 10 LakeHylia Coffre de la grotte Rubis rouge║║ bool 3390613229 0 Grotto Chest Red Rupee║║ chest set 3390613229 1 ; stock 2809733591 20 bag:3036877200=1000,3509980648=500,3068502949=200|base:99 ; set 913802800 10 LakeHylia Fragment de cœur : l'étang de pêche ║║Pêcher un gros poisson à l'étang du lac Hylia bool 4052295534 0 Piece of Heart: Fishing Pond ║║Catch a big fish at the Lake Hylia fishing pond heart set 4052295534 1 ; set 4052295534 1 ; set 1906656605 1 ; set 913802800 1L1 (blocking): These heart-piece effects mark the reward collected without adding the Piece of Heart.
When: Ticking Fishing Pond sets its completion flag, so it reads back as done, but none of its effects increments the heart-piece counter or creates a heart. The Lab Diving Test at line 402 has the same omission.
Do: Apply the appropriate heart-piece reward effects for both lines and add tests using the actual catalogue entries.
@ -0,0 +107,4 @@/// Marks line `index` done in `file`, with what the game gives for it (there is no going back): no game using it, the/// file copied to the launcher's "progress-backups" folder first, then written through a temporary file. Returns the/// backup.fn write(home: &Path, file: &Path, index: i32, done: bool) -> Result<PathBuf> {L6 (should fix): The edited save has not been checked in the game.
When: The launcher can read back its own output even if Longshot rejects a changed field or does not grant the intended reward.
Do: On a disposable local save, edit representative chest, heart-piece and quest lines, launch Longshot through the launcher, and verify the rewards and subsequent save persist.
@ -0,0 +110,4 @@fn write(home: &Path, file: &Path, index: i32, done: bool) -> Result<PathBuf> {anyhow::ensure!(done, "a line done cannot be undone");// a game started outside the launcher: refused with the edit's own words, not the transfer'scrate::players::saves_idle(file).map_err(|_| anyhow!("Close the game first."))?;L3 (blocking): The running-game check is only a snapshot and does not protect the subsequent read and replacement.
When: If another Longshot process starts after saves_idle returns and loads the slot before the rename, the editor reports success while the game is using the old state; its later save can overwrite the edit.
Do: Coordinate editing and game startup with a shared save lock held through replacement, including external game starts that use the profile.
@ -0,0 +180,4 @@false,)};if file != s.file {L4 (should fix): Changing the followed file retains the previous file’s parsed save if the new file cannot yet be read.
When: When the latest save changes to a working copy that is temporarily incomplete, reload changes s.file but keeps s.save and returns on the failed read. The tab continues showing the previous slot’s progress until the new file becomes readable.
Do: Clear the cached save and area when the file changes; retain the old reading only when retrying the same file.
Thanks for the review.
a1cf6f3addresses L1, L3, L4 and L5:@llun, a question on L2 before I change anything there. The catalogue holds no game files and no content taken from them: no text, models or assets. What it does hold are numbers that identify things in a save: the murmur3 hashes of save field names, and the placement IDs of chests and Gold Skulltulas. It also holds what the game writes when a line is done. Names, places and conditions are written by hand. Do these identifiers count as "made from game files" for this repository?
If they do, I see two ways:
Which would you prefer, or is the current form acceptable?
@neotoxic, thanks for asking before changing anything. On L2:
src/players/caption.rsreads the caption's flags by them, and Longshot'sgame/flags.hnames flags the same way.I will run this locally and provide feedback
View command line instructions
Manual merge helper
Use this merge commit message when completing the merge manually.
Checkout
From your project repository, check out a new branch and test the changes.