Bind friendly planning quotes bookings and explicit hotseat consent (by Codex)
This commit is contained in:
1 parent
cbde7b367e
commit
15d2ac0a4d
20 files changed
+422
-22
No files matched your search
@@ -77,6 +77,8 @@ void App::engine_render() {
|
||||
bool calendar_available = false, scheduling_available = false;
|
||||
try { (void)engine_calendar_projection(engine_data_); calendar_available = true; } catch (const std::exception &) {}
|
||||
try { scheduling_available = engine_scheduling_projection(engine_data_).at("allowed"); } catch (const std::exception &) {}
|
||||
bool friendlies_available = false;
|
||||
try { (void)engine_friendly_plan(engine_data_); friendlies_available = true; } catch (const std::exception &) {}
|
||||
init_desktop();
|
||||
for (const auto &[id, o] : desktop_.at("objects").items()) {
|
||||
if (!o.value("visible", false)) continue;
|
||||
@@ -109,11 +111,12 @@ 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 == "calendar" && calendar_available && engine_fresh_) || (route == "postpone" && scheduling_available && engine_fresh_) || (route == "contracts" && contracts_available && engine_fresh_) || (route == "environment" && environment_available && engine_fresh_) || (route == "advertising" && advertising_available && engine_fresh_) || (route == "bank" && bank_available && engine_fresh_) || (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());
|
||||
const bool supported = (route == "friendlies" && friendlies_available && engine_fresh_) || (route == "calendar" && calendar_available && engine_fresh_) || (route == "postpone" && scheduling_available && engine_fresh_) || (route == "contracts" && contracts_available && engine_fresh_) || (route == "environment" && environment_available && engine_fresh_) || (route == "advertising" && advertising_available && engine_fresh_) || (route == "bank" && bank_available && engine_fresh_) || (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_ == "friendlies") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Freundschaftsspiel", friendlies_available ? render_friendlies() : "<div class=\"fill center\">Freundschaftsplanung ist derzeit nicht verfügbar.</div>") + "</div>";
|
||||
if (menu_ == "calendar") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Kalender", calendar_available ? render_calendar() : "<div class=\"fill center\">Der Saisonkalender ist derzeit nicht verfügbar.</div>") + "</div>";
|
||||
if (menu_ == "postpone") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Verlegen", scheduling_available ? render_postpone() : "<div class=\"fill center\">Die Spielverlegung ist derzeit nicht verfügbar.</div>") + "</div>";
|
||||
if (menu_ == "contracts") out += "<div class=\"fill\" style=\"z-index:100;\">" + window("Verträge", render_contracts()) + "</div>";
|
||||
@@ -125,7 +128,7 @@ void App::engine_render() {
|
||||
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_ == "bank" || menu_ == "environment" || menu_ == "advertising" || menu_ == "contracts" || menu_ == "calendar" || menu_ == "postpone") && !amount_ && contracts_dialog_.empty()) out += "<div class=\"panel\" style=\"position:absolute;bottom:12dp;left:700dp;right:700dp;padding:9dp;font-size:25dp;z-index:110;\" id=\"engine-status\">" + esc(engine_busy_ ? engine_operation_ : engine_notice_) + "</div>";
|
||||
if ((menu_ == "bank" || menu_ == "environment" || menu_ == "advertising" || menu_ == "contracts" || menu_ == "calendar" || menu_ == "postpone" || menu_ == "friendlies") && !amount_ && contracts_dialog_.empty() && planning_dialog_.empty()) out += "<div class=\"panel\" style=\"position:absolute;bottom:12dp;left:700dp;right:700dp;padding:9dp;font-size:25dp;z-index:110;\" id=\"engine-status\">" + esc(engine_busy_ ? engine_operation_ : engine_notice_) + "</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();
|
||||
@@ -140,6 +143,10 @@ void App::engine_render() {
|
||||
Rml::ElementList underlay; doc_->QuerySelectorAll(underlay, "#contracts-underlay button,.contracts-actions button,#window-close");
|
||||
for (auto *node : underlay) { node->SetAttribute("disabled", true); node->SetProperty("pointer-events", "none"); }
|
||||
}
|
||||
if (!planning_dialog_.empty() && menu_ == "friendlies") {
|
||||
Rml::ElementList underlay; doc_->QuerySelectorAll(underlay,"#report-underlay button,#report-underlay select,#window-close");
|
||||
for (auto *node : underlay) { node->SetAttribute("disabled",true); node->SetProperty("pointer-events","none"); }
|
||||
}
|
||||
if (amount_) {
|
||||
Rml::ElementList underlay; doc_->QuerySelectorAll(underlay, ".window>.content,.window>.titlebar");
|
||||
for (auto *node : underlay) { node->SetProperty("pointer-events", "none"); node->SetProperty("filter", "blur(10dp)"); }
|
||||
|
||||
Reference in new issue
Block a user