Synchronize match reveals and restore pitch input feedback (by Codex)

Hold scoreboard digits through chance animations, retain overview gesture ownership through moved releases, and restore original affinity swatches and colored pointer from each edition. Preserve simulation and RNG boundaries; cover source observer and UI projections.

Refs: #43, #44, #45
This commit is contained in:
Codex committed 2026-11-01 18:03:53 +01:00
1 parent 86e2bfd32a
commit 540178b264
16 files changed
+269 -17

No files matched your search

+24
View File
@@ -2,6 +2,7 @@
#pragma once
#include <filesystem>
#include <optional>
#include <array>
#include <string>
#include <string_view>
@@ -46,6 +47,29 @@ struct LiveMatchdayFrame {
LiveMatchdayFrame live_matchday_frame(int minute, const std::vector<MatchGroup>& groups,
const GameState& state);
// The engine commits a chance before its ball/set-piece/shot presentation. Keep
// the observed preview scores until the result hook, without delaying simulation.
class LiveScoreReveal {
public:
void observe(LiveChanceStage stage, const LiveMatchdayFrame& frame) {
if (stage == LiveChanceStage::preview) preview_ = frame;
else preview_.reset();
}
LiveMatchdayFrame project(LiveMatchdayFrame frame) const {
if (!preview_ || preview_->minute != frame.minute) return frame;
for (auto& row : frame.matches) for (const auto& before : preview_->matches)
if (row.home_team == before.home_team && row.away_team == before.away_team) {
row.home_goals = before.home_goals;
row.away_goals = before.away_goals;
row.score_known = before.score_known;
break;
}
return frame;
}
private:
std::optional<LiveMatchdayFrame> preview_;
};
struct LiveChanceProjection {
LiveChanceStage stage = LiveChanceStage::preview;
int minute = 0, group = 0, match = 0, side = 0;