[pr-fix][startup] play: ask a question only when it can be seen (Play-MyRig) #132

Manually merged
TrustNo1 merged 0 commits from 1rascen/Darner:ask-only-when-seen into main 2026-12-04 02:14:00 +00:00
Contributor

Contributor role (optional)

  • Fluxer ID:

What it changes

Play-MyRig.cmd (scripts\play-rig.ps1) starts darner.exe play with its output piped and read line by line (& $runner @playArgs 2>&1 | ForEach-Object); its input is still the console. A question printed without a new line (print!, then read_line) never reaches the screen there, so the start waits for an answer nobody sees.

  • Seen: on 2026-12-03, a build of 1a5286a78 started from Play-MyRig.cmd on an RTX 5080 stopped with nothing more on the screen. A build with this change on top of 85c11db93 went on into the game.
  • From the code: what it waited for was the first-start settings offer (c9925327a), the hang 85c11db93 describes. Since 85c11db93 that offer gives up after 20 s, but under Play-MyRig it is still not shown, so the 20 s look like a hang. The DLSS, FSR and MFG Unlocker download offers and the Direct3D 12 runtime question read their answer the same way, with no time limit. When they are due, a start through Play-MyRig would wait for them unseen with no end. One example is Windows 10 without D3D12\D3D12Core.dll, where Play-MyRig's own check says darner.exe will offer to fetch it. Neither was seen.

This adds can_ask(): stdin and stdout are both a console. Those five questions use it instead of checking stdin alone. When it is false, each takes the path it already takes when stdin is not a console:

  • the settings offer is not made and stays due for a start from a console (F1 AUTO-DETECT and darner rig --write apply the picks at any time);
  • DLSS and FSR say how to get their files;
  • MFG Unlocker stays off;
  • the Direct3D 12 runtime is fetched, as for any start without a console.

A start from a console asks exactly as before. hold_window is unchanged: only a start in a console of its own reaches it.

How it was tested

  • Tested revision: d9f725692 (on 57dea7f23)
  • Commands and results, on Linux for the Windows target (x86_64-pc-windows-gnu): cargo clippy -p darner --all-targets --target x86_64-pc-windows-gnu --locked -- -D warnings passes; cargo xtask policy: "asset policy: 553 files ok".
  • Gameplay: a build with this change on top of 85c11db93, started from Play-MyRig.cmd on an RTX 5080: the start went on into the game.
  • Coverage gaps: the three gates were not run on Windows (MSVC), and cargo test was not run. The DLSS, FSR, MFG Unlocker and Direct3D 12 questions were not due on that PC, so their paths under Play-MyRig were not reached.

Checklist

  • This PR contains one change based on main.
  • The diff follows docs/asset-policy.md.
  • I recorded this PR's dependencies below.
    • Depends on: none

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches.
  • Related PRs: none found for this problem. Open pull requests that also change apps/darner/src/play.rs, none of them in these functions: #9, #12, #16, #36, #59, #75, #80.

🤖 Generated with Claude Code

## Contributor role (optional) - Fluxer ID: ## What it changes `Play-MyRig.cmd` (`scripts\play-rig.ps1`) starts `darner.exe play` with its output piped and read line by line (`& $runner @playArgs 2>&1 | ForEach-Object`); its input is still the console. A question printed without a new line (`print!`, then `read_line`) never reaches the screen there, so the start waits for an answer nobody sees. - **Seen:** on 2026-12-03, a build of 1a5286a78 started from `Play-MyRig.cmd` on an RTX 5080 stopped with nothing more on the screen. A build with this change on top of 85c11db93 went on into the game. - **From the code:** what it waited for was the first-start settings offer (c9925327a), the hang 85c11db93 describes. Since 85c11db93 that offer gives up after 20 s, but under Play-MyRig it is still not shown, so the 20 s look like a hang. The DLSS, FSR and MFG Unlocker download offers and the Direct3D 12 runtime question read their answer the same way, with no time limit. When they are due, a start through Play-MyRig would wait for them unseen with no end. One example is Windows 10 without `D3D12\D3D12Core.dll`, where Play-MyRig's own check says darner.exe will offer to fetch it. Neither was seen. This adds `can_ask()`: stdin and stdout are both a console. Those five questions use it instead of checking stdin alone. When it is false, each takes the path it already takes when stdin is not a console: - the settings offer is not made and stays due for a start from a console (F1 AUTO-DETECT and `darner rig --write` apply the picks at any time); - DLSS and FSR say how to get their files; - MFG Unlocker stays off; - the Direct3D 12 runtime is fetched, as for any start without a console. A start from a console asks exactly as before. `hold_window` is unchanged: only a start in a console of its own reaches it. ## How it was tested - Tested revision: d9f725692 (on 57dea7f23) - Commands and results, on Linux for the Windows target (x86_64-pc-windows-gnu): `cargo clippy -p darner --all-targets --target x86_64-pc-windows-gnu --locked -- -D warnings` passes; `cargo xtask policy`: "asset policy: 553 files ok". - Gameplay: a build with this change on top of 85c11db93, started from `Play-MyRig.cmd` on an RTX 5080: the start went on into the game. - Coverage gaps: the three gates were not run on Windows (MSVC), and `cargo test` was not run. The DLSS, FSR, MFG Unlocker and Direct3D 12 questions were not due on that PC, so their paths under Play-MyRig were not reached. ## Checklist - [x] This PR contains one change based on `main`. - [x] The diff follows `docs/asset-policy.md`. - [x] I recorded this PR's dependencies below. - Depends on: none ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. - Related PRs: none found for this problem. Open pull requests that also change `apps/darner/src/play.rs`, none of them in these functions: #9, #12, #16, #36, #59, #75, #80. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Play-MyRig.cmd (scripts\play-rig.ps1) starts `darner.exe play` with its output
piped and read line by line (`& $runner @playArgs 2>&1 | ForEach-Object`); its
input is still the console. A question printed without a new line never reaches
the screen there, and the start waits for an answer nobody sees. Seen on
2026-12-03 with a build of 1a5286a78 on an RTX 5080: the start stopped with
nothing more on the screen. By the code, it waited at the first-start settings
offer (c9925327a), the hang 85c11db93 describes; since then that offer gives up
after 20 s, still unseen. The DLSS, FSR and MFG Unlocker offers and the
Direct3D 12 runtime question read their answer the same way, with no time limit.

can_ask(): stdin and stdout both a console. Those five questions use it. Not
asked, each takes the path it already takes when stdin is not a console: the
settings offer stays due for a start from a console (F1 AUTO-DETECT and
`darner rig --write` apply the picks at any time), DLSS and FSR say how to get
their files, MFG Unlocker stays off, and the Direct3D 12 runtime is fetched as for
any start without a console. hold_window is left as it is: only a start in a
console of its own reaches it.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01HXFUNBwhfGAyZcqq5dLciz
1rascen changed title from play: ask a question only when it can be seen (Play-MyRig reads the output line by line) to [pr-fix][startup] play: ask a question only when it can be seen (Play-MyRig) 2026-12-03 22:30:30 +00:00
TrustNo1 manually merged commit 10ea02a35a into main 2026-12-04 02:14:00 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
TrustNo1/Darner!132
No description provided.