Bind friendly planning quotes bookings and explicit hotseat consent (by Codex)

This commit is contained in:
Codex committed 2026-10-28 16:28:46 +01:00
1 parent cbde7b367e
commit 15d2ac0a4d
20 files changed
+422 -22

No files matched your search

+10 -1
View File
@@ -16,6 +16,7 @@ App::report_picker_items(const std::string &kind) const {
std::vector<std::pair<std::string, std::string>> items;
if (!world_ || !report_picker_kind(kind))
return items;
if (engine_mode_ && menu_ == "friendlies") return engine_friendly_picker_items(kind);
if (menu_ == "statistics")
return statistics_picker_items(kind);
if (kind == "scorer-scope") {
@@ -83,6 +84,12 @@ std::string App::report_picker_value(const std::string &kind) const {
const auto *row = world_->find("competitions", league);
return row ? row->value("nation", "") : "";
}
if (engine_mode_ && menu_ == "friendlies") {
if (kind == "league") return engine_friendly_league_;
const auto items = engine_friendly_picker_items("country");
for (const auto &[id, caption] : items) { const auto leagues = engine_friendly_picker_items(id); for (const auto &[league, name] : leagues) if (league == engine_friendly_league_) return id; }
return {};
}
const auto reports = snap().state.at("reports");
if (kind == "filter" || kind == "competition")
return std::to_string(reports.at(kind).get<int>());
@@ -207,7 +214,9 @@ bool App::report_picker_action(const std::string &action, Rml::Element *target)
? Json(std::stoi(value)) : Json(value);
close_report_picker(false);
// Commit even an unchanged country: the Gold resets its first league.
if (menu_ == "statistics") {
if (engine_mode_ && menu_ == "friendlies") {
engine_friendly_filter(kind, value);
} else if (menu_ == "statistics") {
statistics_picker_select(kind, value);
} else if (kind == "year" && menu_ == "almanac") {
almanac_year_ = std::stoi(value);