Refresh selected-building panel when paused player commands drain
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
This commit is contained in:
@@ -31,6 +31,7 @@ SET(HDRS
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/BeamFiredEvent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/DebugDrawToggledEvent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CommandRequestedEvent.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/PlayerCommandsAppliedEvent.h
|
||||
PARENT_SCOPE
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user