Repository navigation
While a demo loads, the demo player bar shows how far along it is (#465) - #758
Conversation
…d_addon Studio copies the user's dod/resource DemoPlayerDialog.res (or the stock valve one) into dod_addon/resource and adds a hidden percent label and progress bar where TimeLabel sits. The user's files are never written. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dodstudio_show_load_progress (on by default) fills the StudioLoadPercent label and StudioLoadProgress bar on the VCR bar while viewdemo is still reading, with the Playback tab's percent, and hides them once loaded. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
In-game smoke test (game_probe, Brain account), DLL game_probe launches the game itself, so the POST: pass.
PRE: pass, same result, with your
Notes:
Reports: |
# Conflicts: # studio/src/console_commands_data.js
|
Merged dev in (7cca6ef); conflicts in studio/src/console_commands_data.js, resolved by regenerating it with goldsrc-hooks/tools/console_names.py (Commands.txt merged cleanly, keeps dodstudio_show_load_progress); local tests/clippy pass, CI green; test DLL rebuilt at local\test-465\ |
|
Re-check on POST after the dev merge. Setup: bc7b639, DLL
|
…_progress Dev's #719 renamed every console name to ds_<area>_...; this PR's show_load_progress becomes ds_demo_show_load_progress per the #555 table. Commands.txt and dodstudio_commands.md take dev's side with the row re-added under DEMO PLAYBACK; console_commands_data.js regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Merged
🤖 Generated with Claude Code |
NEW_SINCE_555 keeps dev's three names and this branch's demo_show_load_progress; console_commands_data.js regenerated. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Brought up to date with dev (unattended pass). Head
In game. DLL
🤖 Generated with Claude Code |
# Conflicts: # goldsrc-hooks/src/lib.rs # native/src/patch/console_prefix.rs # studio/src/console_commands_data.js
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
# Conflicts: # studio/src/console_commands_data.js
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…, refuse UTF-16 With a Game folder other than dod (#402) the game runs with -game <folder> -addons and searches <folder>_addon, so the layout written to dod_addon from dod\resource never loaded. It now reads <folder>\resource (else valve) and writes <folder>_addon. The file's bytes go through unchanged (Latin-1 round trip), so text that isn't UTF-8 no longer becomes U+FFFD, and a UTF-16 file is refused instead of getting ASCII blocks spliced into it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
It runs every frame from HUD_Frame (CLAUDE.md: no blocking mutexes there). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Correctness review (unattended pass, offline only, no game launched). Head What I checked: the whole diff against
Bugs fixed:
Local results:
Open questions for you:
🤖 Generated with Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Smoke test of the rebuilt DLL: rebuild works on PRE and POST. DLL PRE: pass.
POST: pass.
Not this PR, but worth knowing: on PRE the bar has no time label after loading, and the time slider sits on the button row. It is the same with Screenshots in
Reports: |
# Conflicts: # studio/src/console_commands_data.js
Studio rebuilt <game>_addon\resource\DemoPlayerDialog.res at every launch, so a layout saved there from the game's build mode was lost on the next launch. Studio's copy now starts with a // line holding a hash of the rest; a file without it, or whose hash no longer matches, is the user's: the launch adds the two loading controls only if they are missing and otherwise leaves it alone. An unmarked copy identical to what Studio writes counts as Studio's. The hook's missing-controls log line names the addon folder of the running game folder. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Keep edits (your decision): done in 47bde20. dev merged in first (976b3ab; What changed: Studio's
Why a marker in the file rather than a record Studio keeps elsewhere or timestamps: it travels with the file, so a reinstalled Studio, a second checkout or a cleared settings folder still tells the two apart; timestamps change on a copy without the file changing. Also: the hook's "the demo bar has no StudioLoadPercent" line now names Tests: fmt and clippy 1.98.1 (workspace and i686) clean; hooks i686 872 pass; workspace all pass; JS unit 904 pass; 9 new In game (Brain,
The no-time PRE bar from the 10-24 smoke test was #1020: the remembered size from POST squeezing PRE's taller bar, not this PR. Fix in #1046. Verdict: ready to merge. 🤖 Generated with Claude Code |
Release note: New: While a demo loads in the game, the demo player bar shows how far along it is.
Closes #465
What it does
While
viewdemois still reading a demo, the stock demo player (VCR) bar showsn%and a thin progress bar where its time label sits. Both hide once the console says "Demo file completely loaded.", and the time label shows again. The number is the same one the DoD Studio window's Playback tab already shows (#565): the span the demo player has buffered so far, divided by the playback length in the demo's own directory.Studio side:
native/src/demo_bar_res.rs(new)with_loading_controls(res) -> Option<String>inserts two blocks before the top-level object's closing brace: aLabelnamedStudioLoadPercentand aProgressBarnamedStudioLoadProgress. Both start withvisible 0and are placed fromTimeLabel'sxpos/ypos/wide/tall, or the stock place if the layout has noTimeLabel. Everything else in the user's file stays byte for byte, including its line endings and the trailing NUL a build-mode save leaves. A file that already has the controls comes back unchanged.install(game_dir, game_folder)reads<folder>\resource\DemoPlayerDialog.res(dodunless the Game folder setting says otherwise, Setting for the game folder name (-game <mod>), default dod #402), orvalve\resource\DemoPlayerDialog.reswhen that has none, and writes<folder>_addon\resource\DemoPlayerDialog.res. Nothing under the game folder orvalveis ever written. If the target already holds exactly what would be written, it skips the write.// DoD Studio writes this file ... (marker <hash>)line, the FNV-1a hash of the rest of the file. A file without that line (a build-mode save writes no comments) or whose hash no longer matches (a hand edit) is the user's: the launch builds from it instead, adds the two controls only if they're missing (keeping every other byte, and no marker, so it stays the user's), and otherwise leaves it alone. The activity log says "kept your edited ..." or "added the loading progress controls to your edited ...". Deleting the file goes back to the game folder's layout. A UTF-16 edit is left untouched and logged; an empty addon file is rebuilt.prepare(hl_exe)is called fromPatcherConfig::build_hlae_process, so every launch gets it: a batch, Launch Preview and Launch Game. It writes one activity-log line when the file is (re)written, and one when it is skipped (no source file, or one it can't read).Hook side:
goldsrc-hooks/src/demo_bar_progress.rs+studio_panel/hook/demo_bar_progress.rs(new)ds_demo_show_load_progress, default1.studio_panel::hook::pollruns the update before its "is our window open" early return. It readsdemo_seek::buffered_while_loading(), so the cost is one interface lookup and two slot calls while no demo is loading.DemoPlayerDialogpopup (the feat(goldsrc-hooks): resizable GameUI windows that remember their place (#408) #410 walk), sets the label throughLabel::SetTextand the bar throughProgressBar::SetProgress(vftable-checked againstprogress_bar_vftable), and shows both. When loading ends it hides them.-addonsor without Studio's layout).GameUIslots and theprogress_bar_vftablealready sit inBUILDSfor both builds and are checked bytools/verify_studio_panel.py; the demo player slots are the onesdemo_seekalready verifies on PRE and Anniversary.Decisions
1, not0. It only shows anything on the layout Studio's own launch writes, so a game started any other way is unchanged.ds_ui_viewdemo_in_panelandds_ui_console_in_panelare the precedent for default-on window features. Because of the default, Studio's launch does not need to send it.cfg_scantier. It's a harmless setting, andds_ui_viewdemo_in_panelis in no tier list either.ds_ui_viewdemo_in_panelis 1. The bar is parked off screen then, and the Playback tab shows the progress.load_progress::length_of_current_demois nowpub(super), so both progress displays read the demo's length once per demo.demo_list_folders::Setting::newis nowpub(crate)so the new cvar reuses that on/off type.dod_addon\resource\DemoPlayerDialog.resis replaced at the next launch. That file is the experiment with the -10 s / +10 s / x0.5 / x1 / Decals buttons (theirdem_jump/dem_speedcommands do nothing in GoldSrc). The issue's 2026-10-12 decision allows overwriting it. The new file is yourdod\resourcelayout plus the two controls. (On this PC it was already replaced on 10-13 by a test build of this PR; PRE's and POST's addon files now are exactly that output, which the new code recognises as Studio's.)//lines (the stockClientScheme.resstarts with them), and the in-game runs below load the marked file.dod\resource. A later change to the game folder's layout doesn't reach it until you delete the addon file; the activity log line says so on every launch.<folder>_addonfor the running Game folder instead of alwaysdod_addon.Name (after #719)
The cvar is
ds_demo_show_load_progress(the #555 table's name forshow_load_progress). It never shipped, so it has noold_names.rsentry; it is listed inconsole_prefix'sNEW_SINCE_555instead. It sits under DEMO PLAYBACK inCommands.txtanddocs/dodstudio_commands.md.Tests (local, at 47bde20, dev 5bc7b6a merged in)
rustup run 1.98.1 cargo fmt --all --check: cleanrustup run 1.98.1 cargo clippy --workspace --all-targets --locked -- -D warnings: cleanrustup run 1.98.1 cargo clippy -p goldsrc-hooks --target i686-pc-windows-msvc --all-targets --locked -- -D warnings: cleancargo test -p goldsrc-hooks --target i686-pc-windows-msvc: 872 passcargo test --workspace: all pass (native 803; one timing test inshared::pathsfailed once while two builds ran side by side and passed on the rerun)npm run test:unit: 904 passed (104 files)studio_s_copy_carries_a_marker_and_is_rebuilt,a_build_mode_save_with_the_controls_is_left_alone,a_build_mode_save_without_the_controls_gets_them_and_stays_the_user_s,a_hand_edit_that_keeps_the_marker_line_is_still_the_user_s,an_unmarked_copy_studio_would_write_is_studio_s,a_user_s_edit_in_utf16_is_left_as_it_is,a_user_s_edit_that_is_not_utf8_is_kept_byte_for_byte,an_addon_file_with_no_layout_is_rebuilt,the_marker_needs_its_own_hash. The Setting for the game folder name (-game <mod>), default dod #402, non-UTF-8 and UTF-16 tests still pass.local\test-465\dodstudio_goldsrc_hooks.dll(the previous one kept beside it as.prev-3118435c.dll).In game (2026-10-25, game_probe, Brain account,
-addons,ds_ui_viewdemo_in_panel 0,viewdemo solifotw-bewton)The layout step was run as the launch runs it (
demo_bar_res::install(<install>, "dod"), from a throwaway example binary), then the game.dod_addon(PRE'sdod\resourcelayout with Play and Pause swapped, no controls, no marker): step 1AddedToEdit, step 2KeptEdit. Hook log 0 … 90%, then "the demo is loaded"; no "has no StudioLoadPercent". After loading, the bar shows ▶ before ⏸ (the edit) and the time.valve\resource:AddedToEdit, thenKeptEdit; the bar shows32%and the progress bar while loading, with ▶ before ⏸; after loading06:09:09 x1 Playing.Written, thenUnchanged); the file now starts with the//marker line, and the game loads it:0%and the bar while loading, 0 … 90% in the log on both.local\backups\1020\).Reports:
local\game-probe\758-pre-edit\,758-post-edit\,758-pre-marked\,758-post-marked\.The PRE bar with no time after loading, seen in the 10-24 smoke test, was not this PR: it was the remembered window size from POST squeezing PRE's taller bar (#1020, fixed in #1046). These runs set
ds_ui_remember_layout 0to keep that out. No other open PR touchesnative/src/demo_bar_res.rsor the twodemo_bar_progress.rsfiles.User test steps (run on both PRE and POST)
git checkout feat/loading-progress-465and run Studio from it as usual.local\test-465\dodstudio_goldsrc_hooks.dll. Close the game if it's running.Demo bar layout: wrote ...\dod_addon\resource\DemoPlayerDialog.res from ...\dod\resource\DemoPlayerDialog.res(on POST,from ...\valve\resource\...).ds_ui_viewdemo_in_panel 0(so the stock bar is used), thenviewdemo <a 100 MB+ demo>, e.g.viewdemo wsod25_grp2_h1_hltv.n%and a bar filling up while the title says "Loading ...". Both go away when the console prints "Demo file completely loaded.", and the time shows again.demo_bar_progress: loading the demo, 0%…90%, thendemo_bar_progress: the demo is loaded. If it saysthe demo bar has no StudioLoadPercent, the layout wasn't picked up (check-addonsand step 3).ds_demo_show_load_progress 0, thenviewdemoagain: no progress shows.On PRE, the old experiment
dod_addon\resource\DemoPlayerDialog.res(with the -10 s / +10 s / Decals buttons) is replaced by this launch. Yourdod\resourcelayout carries over unchanged.🤖 Generated with Claude Code