Render Gold post-match pages from held read-only review data (by Codex)

This commit is contained in:
Codex authored and Codex committed 2026-10-27 09:12:36 +01:00
1 parent 86f248bbd5
commit 3f1a44b320
13 files changed
+1392 -13

No files matched your search

+10 -4
View File
@@ -10,6 +10,7 @@ bool App::live_open() {
message("Live-Ticker nicht verfügbar: " + fixture.value("error", "invalid_live_fixture")); return false;
}
live_source_ = source_.get(); live_world_ = snapshot.world;
postmatch_data_=Json::object();postmatch_scrolls_=Json::object();postmatch_playing_=false;
live_drafts_ = Json::object(); live_dialog_.clear(); live_dialog_draft_ = Json();
live_coverage_ = "all"; live_filter_ = "all"; live_tab_ = "team";
live_selected_match_ = fixture.at("matches").front().at("id");
@@ -19,10 +20,12 @@ bool App::live_open() {
}
live_review_ = false; live_speed_dragging_ = false;
live_last_tick_ = SDL_GetTicks64(); scene_ = "live"; menu_.clear();
focus_after_render_ = live_.finished() ? "live-review" : "live-next";
if(live_.finished())return postmatch_open();
focus_after_render_ = "live-next";
refresh(); return true;
}
void App::live_close() {
live_review_=false;postmatch_playing_=false;
live_.speed(0); live_dialog_.clear(); live_dialog_draft_ = Json();
live_resume_speed_ = 0; live_speed_dragging_ = false;
scene_ = "desktop"; menu_.clear(); focus_after_render_ = "object-app-kickoff"; refresh();
@@ -48,6 +51,7 @@ void App::live_set_speed(int value) {
void App::live_tick() {
if (scene_ != "live" || !live_.available()) return;
const auto now = SDL_GetTicks64(), elapsed = now - live_last_tick_; live_last_tick_ = now;
if(live_review_){postmatch_tick(now);return;}
if (!popup_.empty() || !live_dialog_.empty() || live_speed_dragging_ || live_review_) return;
const auto current = source_ ? source_->snapshot() : Snapshot();
if (!source_ || source_.get() != live_source_ || current.world != live_world_ ||
@@ -79,6 +83,7 @@ void App::live_dialog_close(bool apply_draft) {
refresh();
}
bool App::live_action(const std::string &action, Rml::Element *target) {
if(action.starts_with("postmatch-"))return postmatch_action(action,target);
if (action == "open:kickoff") { live_open(); return true; }
if (!action.starts_with("live-")) return false;
if (scene_ != "live" || !live_.available()) return true;
@@ -111,9 +116,9 @@ bool App::live_action(const std::string &action, Rml::Element *target) {
} else if (action == "live-pause") {
live_set_speed(live_.speed() ? 0 : 1);
} else if (action == "live-review" && live_.finished()) {
live_review_ = true;
postmatch_open();return true;
} else if (action == "live-review-back") {
live_review_ = false;
postmatch_action("postmatch-ticker",target);return true;
} else if (action == "live-intervene-lineup" || action == "live-intervene-tactics") {
if (live_.finished()) return true;
const auto owner = live_owner(); live_dialog_draft_ = live_owner_state(owner);
@@ -138,6 +143,7 @@ bool App::live_action(const std::string &action, Rml::Element *target) {
refresh(); return true;
}
bool App::live_event(Rml::Event &event) {
if(live_review_)return postmatch_event(event);
if (scene_ != "live" || !live_.available() || !popup_.empty()) return false;
const auto type = event.GetType(); auto *target = event.GetTargetElement();
bool speed_control = false;
@@ -199,7 +205,7 @@ bool App::live_event(Rml::Event &event) {
Json App::live_snapshot() const {
auto status = live_.status(); status["tab"] = live_tab_; status["coverage"] = live_coverage_;
status["selected_match"] = live_selected_match_; status["filter"] = live_filter_;
status["review"] = live_review_; status["dialog"] = live_dialog_;
status["review"] = live_review_; status["postmatch"] = postmatch_snapshot(); status["dialog"] = live_dialog_;
status["drafts"] = live_drafts_; status["dialog_draft"] = live_dialog_draft_;
status["ticker_scroll"] = element("live-ticker") ? element("live-ticker")->GetScrollTop() : live_ticker_scroll_;
status["frame"] = live_.frame();