Bind tactics and training drafts to confirmed engine commits (by Codex)

This commit is contained in:
Codex committed 2026-10-28 09:57:12 +01:00
1 parent 7d3b3f1101
commit f75e0f8e49
18 files changed
+398 -43

No files matched your search

+7 -1
View File
@@ -56,6 +56,9 @@ void App::engine_render() {
esc(engine_price(desk.at("accounts").at("cash"))) + "</strong></div></div>";
bool lineup_available = false;
try { (void)engine_lineup_projection(engine_data_); lineup_available = true; } catch (const std::exception &) {}
bool training_available = false, tactics_available = false;
try { (void)engine_training_projection(engine_data_); training_available = true; } catch (const std::exception &) {}
try { (void)engine_tactics_projection(engine_data_); tactics_available = true; } catch (const std::exception &) {}
init_desktop();
for (const auto &[id, o] : desktop_.at("objects").items()) {
if (!o.value("visible", false)) continue;
@@ -88,16 +91,19 @@ void App::engine_render() {
const auto route = id.substr(4);
const bool camp_allowed = desk.at("menuAvailability").at("camps").value("status", "") == "available";
const auto commands = meta.at("scope").value("allowedCommands", Json::array());
const bool supported = (route == "lineup" && lineup_available && engine_fresh_) || route == "save" || (route == "camp" && engine_fresh_ && camp_allowed && std::find(commands.begin(), commands.end(), Json("camp.book")) != commands.end());
const bool supported = (route == "training" && training_available && engine_fresh_) || (route == "tactics" && tactics_available && engine_fresh_) || (route == "lineup" && lineup_available && engine_fresh_) || route == "save" || (route == "camp" && engine_fresh_ && camp_allowed && std::find(commands.begin(), commands.end(), Json("camp.book")) != commands.end());
out += desktop_button(id, o, "engine-open", supported && !engine_busy_);
}
}
out += "</div>";
if (menu_ == "training") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Training", render_training()) + "</div>";
if (menu_ == "tactics") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Taktik", render_tactics()) + "</div>";
if (menu_ == "lineup") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Aufstellung", render_lineup()) + "</div>";
if (menu_ == "camp") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Trainingslager", render_camp()) + "</div>";
}
if (menu_.empty() || engine_data_.empty()) out += "<div class=\"panel\" style=\"position:absolute;left:850dp;bottom:24dp;right:100dp;padding:18dp;font-size:27dp;\" id=\"engine-status\">" + esc(engine_busy_ ? engine_operation_ : engine_notice_) + "</div>";
element("canvas")->SetInnerRML(out); ++document_generation_;
scale_chalk_shadow();
if (!engine_player_.empty()) {
Rml::ElementList underlay; doc_->QuerySelectorAll(underlay, "#lineup-underlay button,#window-close");
for (auto *node : underlay) { node->SetAttribute("disabled", true); node->SetProperty("pointer-events", "none"); }