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
@@ -12,6 +12,19 @@ void App::engine_poll() {
|
||||
try {
|
||||
auto result = engine_job_.get();
|
||||
validate_engine_desk(result.bundle);
|
||||
if (result.response.value("messageType", "") == "friendly_preview") {
|
||||
const auto &read = result.response.at("read");
|
||||
if (read.value("messageType", "") == "error") {
|
||||
planning_notice_ = engine_text(read.value("message", Json()));
|
||||
if (planning_notice_.empty() || planning_notice_ == "—") planning_notice_ = "Dieses Freundschaftsspiel ist derzeit nicht verfügbar.";
|
||||
planning_dialog_ = "friendly-error"; focus_after_render_ = "planning-close";
|
||||
} else {
|
||||
const auto quote = engine_friendly_projection(result.bundle,read,result.response.at("opponent"),result.response.at("home"));
|
||||
engine_friendly_read_ = read; planning_dialog_ = "quote";
|
||||
focus_after_render_ = quote.at("days").empty() ? "planning-close" : "friendly-quote-accept";
|
||||
}
|
||||
refresh(); return;
|
||||
}
|
||||
if (result.response.value("messageType", "") == "credit_preview") {
|
||||
const auto &read = result.response.at("read");
|
||||
if (read.value("messageType", "") == "error") engine_notice_ = "Kreditvorschau abgewiesen: " + read.value("code", "unknown_error");
|
||||
@@ -42,6 +55,7 @@ void App::engine_poll() {
|
||||
engine_ticket_bind();
|
||||
engine_contracts_poll();
|
||||
engine_calendar_sync();
|
||||
engine_friendly_sync();
|
||||
engine_sports_reset();
|
||||
const auto &f = engine_data_.at("camps").at("data").at("focus");
|
||||
engine_focus_ = {{"condition", f.at("condition")}, {"technique", f.at("technique")}, {"play", f.at("play")}};
|
||||
@@ -109,6 +123,8 @@ void App::engine_event(Rml::Event &event) {
|
||||
if (!engine_busy_ && bank_event(event)) return;
|
||||
if (!engine_busy_ && advertising_event(event)) return;
|
||||
if (!engine_busy_ && popup_.empty() && contracts_event(event)) return;
|
||||
if (!engine_busy_ && popup_.empty() && engine_friendly_event(event)) return;
|
||||
if (!engine_busy_ && planning_dialog_.empty() && popup_.empty() && menu_ == "friendlies" && report_picker_event(event)) return;
|
||||
if (engine_sports_event(event)) return;
|
||||
Rml::ElementFormControl *range = nullptr;
|
||||
for (auto *node = target; node && node != doc_; node = node->GetParentNode())
|
||||
@@ -171,6 +187,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 (engine_friendly_action(action, node)) return;
|
||||
if (menu_ == "friendlies" && report_picker_action(action,node)) return;
|
||||
if (engine_calendar_action(action, node)) return;
|
||||
if (contracts_action(action, node)) return;
|
||||
if (environment_action(action, node)) return;
|
||||
@@ -184,6 +202,7 @@ void App::engine_event(Rml::Event &event) {
|
||||
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 == "friendlies") { menu_ = id; planning_dialog_.clear(); engine_friendly_sync(); refresh(); }
|
||||
else if (action == "engine-open" && (id == "calendar" || id == "postpone")) { menu_ = id; engine_move_id_.clear(); engine_calendar_sync(); refresh(); }
|
||||
else if (action == "engine-open" && id == "contracts") { menu_ = id; engine_contracts_clear(false); contracts_player_.clear(); engine_contract_scroll_ = 0.f; refresh(); }
|
||||
else if (action == "engine-open" && id == "bank") { bank_view_ = "entrance"; bank_hint_.clear(); menu_ = "bank"; refresh(); }
|
||||
@@ -207,5 +226,5 @@ void App::engine_event(Rml::Event &event) {
|
||||
}
|
||||
Json App::engine_snapshot() const {
|
||||
return {{"mode", engine_mode_}, {"busy", engine_busy_}, {"dirty", engine_dirty_}, {"fresh", engine_fresh_}, {"bundle", engine_data_},
|
||||
{"response", engine_response_}, {"calendar_day", engine_calendar_day_}, {"move_id", engine_move_id_}, {"credit_preview", engine_credit_}, {"credit_edits", engine_credit_edits_}, {"training_draft", engine_training_draft_}, {"tactics_draft", engine_tactics_draft_}, {"player_profile", engine_player_}, {"lineup_selected", lineup_selected_}, {"focus", engine_focus_}, {"selected_camp", engine_camp_}, {"notice", engine_notice_}};
|
||||
{"response", engine_response_}, {"friendly_quote", engine_friendly_read_}, {"friendly_league", engine_friendly_league_}, {"friendly_opponent", engine_friendly_opponent_}, {"friendly_date", engine_friendly_date_}, {"friendly_home", engine_friendly_home_}, {"friendly_stage", engine_friendly_stage_}, {"calendar_day", engine_calendar_day_}, {"move_id", engine_move_id_}, {"credit_preview", engine_credit_}, {"credit_edits", engine_credit_edits_}, {"training_draft", engine_training_draft_}, {"tactics_draft", engine_tactics_draft_}, {"player_profile", engine_player_}, {"lineup_selected", lineup_selected_}, {"focus", engine_focus_}, {"selected_camp", engine_camp_}, {"notice", engine_notice_}};
|
||||
}
|
||||
Reference in new issue
Block a user