Bind environment and advertising to confirmed engine actions (by Codex)

This commit is contained in:
Codex committed 2026-10-28 11:58:57 +01:00
1 parent dcf42f2da7
commit e9483048f4
19 files changed
+395 -23

No files matched your search

+5
View File
@@ -35,6 +35,7 @@ void App::engine_poll() {
} else if (engine_response_.value("messageType", "") == "saved") {
engine_dirty_ = false; engine_notice_ = "Spielstand als neue OBS-Datei gespeichert.";
} else engine_notice_ = "Spielstand geladen · Weitere Menüs werden schrittweise angebunden.";
if (engine_response_.value("messageType", "") == "command_result") { advertising_selected_ = -1; advertising_offer_ = 0; }
engine_credit_ = engine_data_.value("credit", Json()); engine_credit_edits_ = Json::array();
engine_ticket_bind();
engine_sports_reset();
@@ -98,6 +99,7 @@ void App::engine_event(Rml::Event &event) {
if (ticket_ && ticket_->is_open()) return;
if (amount_event(event)) return;
if (!engine_busy_ && bank_event(event)) return;
if (!engine_busy_ && advertising_event(event)) return;
if (engine_sports_event(event)) return;
Rml::ElementFormControl *range = nullptr;
for (auto *node = target; node && node != doc_; node = node->GetParentNode())
@@ -160,6 +162,8 @@ void App::engine_event(Rml::Event &event) {
if (action == "popup-confirm") { auto callback = std::move(confirm_); popup_.clear(); dirty_ = true; if (callback) callback(); }
return;
}
if (environment_action(action, node)) return;
if (advertising_action(action, node)) return;
if (bank_action(action, node)) return;
if (engine_sports_action(action, id, node)) return;
if (engine_lineup_action(action, id, node)) return;
@@ -168,6 +172,7 @@ void App::engine_event(Rml::Event &event) {
const auto price = engine_ticket_projection(engine_data_);
ticket_->open(node, device_ratio_, price.at("min"), price.at("max")); dirty_ = true;
}
else if (action == "engine-open" && (id == "environment" || id == "advertising")) { menu_ = id; advertising_selected_ = -1; advertising_offer_ = 0; refresh(); }
else if (action == "engine-open" && id == "bank") { bank_view_ = "entrance"; bank_hint_.clear(); menu_ = "bank"; refresh(); }
else if (action == "engine-open" && id == "save") engine_save();
else if (action == "engine-open" && (id == "training" || id == "tactics")) { engine_sports_reset(); menu_ = id; refresh(); }