Option A made the per-tick refresh authoritative for the shipyard layout
preview and Configure Layout button, but that path is driven by
TickAdvancedEvent, which only fires while the game is running. Choosing a
schematic while paused therefore still left the widgets hidden until the
game was unpaused or the building re-selected, because the queued
SetRecipeCommand drains on the next frame but no tick advances.
Emit a new PlayerCommandsAppliedEvent from GameWorldView::onFrame once per
frame when queued commands were drained, and have SelectedBuildingPanel
refresh its selection display in response. This is a presentation-only
notification: it is emitted only on the live path (not during replay
playback), touches neither the command queue nor the simulation, and its
only handler never enqueues commands -- so replay recording and
determinism are unaffected.
Factor the former TickAdvancedEvent handler body into
refreshSelectionDisplay() and call it from both handlers to avoid
duplication.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyCu8vwChKMbLJQ3xosYEN
Selecting a ship schematic in the shipyard left the layout preview and
Configure Layout button hidden until the building was deselected and
re-selected.
The recipe change is applied via a queued command that only drains on a
later frame, so the immediate rebuild() in onSelectRecipeClicked() still
saw the old (empty) recipe and hid both widgets. The per-tick
refreshBuffers() path then updated the preview's data but never set its
visibility -- that was only ever done in buildSingle() -- so the widgets
stayed hidden until a re-selection re-ran buildSingle().
Extract the shipyard preview/button show-hide-and-populate logic into
updateShipyardLayoutWidgets() and call it from both buildSingle() and
refreshBuffers(), so the per-tick refresh becomes authoritative for
visibility and the widgets appear on the first tick after the command
drains.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DyCu8vwChKMbLJQ3xosYEN
Add deterministic record/playback for a run.
Recording captures `(seed, config hash, ordered tick-tagged commands)` and re-simulates on playback — no state snapshots. `DotaFactory.exe --replay <file>` re-plays a recorded run view-only with manual speed/pause.
Reviewed-on: #4
Co-authored-by: Malte Langkabel <malte.langkabel@gmail.com>
Co-committed-by: Malte Langkabel <malte.langkabel@gmail.com>
Fixes a bug where the selected construction site was not drawn with a border.
Reviewed-on: #2
Co-authored-by: Malte Langkabel <malte.langkabel@gmail.com>
Co-committed-by: Malte Langkabel <malte.langkabel@gmail.com>