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:
2026-07-08 19:31:29 +02:00
committed by mlangkabel
parent 53af44db04
commit 94b5d941ba
5 changed files with 47 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
#pragma once
#include "Event.h"
// Emitted by GameWorldView once per frame after queued player commands have been
// drained and applied to the simulation. It lets presentation widgets refresh
// even while the game is paused (no tick advances, so no TickAdvancedEvent), for
// example so a shipyard's layout preview appears immediately after its schematic
// is chosen. It is a UI notification only and never feeds back into the command
// queue, so it has no effect on replay recording or determinism.
class PlayerCommandsAppliedEvent : public Event
{
};