Modern UI contract: press journal for business events
Business events cannot be derived from the almanac later, so a saved journal notes them once: squad changes of the human clubs at a kickoff (signed, free, sold, contract ended; clubs compared by identity across the season's new draw positions), toto settlements, season change, contract renewals and resigning. The news read merges it with the almanac events. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
9c436c753e
commit
651d262546
9 files changed
+318
-4
No files matched your search
@@ -2,6 +2,7 @@
|
||||
#include "formats/executable_layout.hpp"
|
||||
#include "modern/game/modern_state.hpp"
|
||||
#include "modern/app/modern_session.hpp"
|
||||
#include "modern/content/press_journal.hpp"
|
||||
#include "modern/content/world_expand.hpp"
|
||||
#include "modern/content/world_package.hpp"
|
||||
#include "modern/content/world_save.hpp"
|
||||
@@ -9341,6 +9342,7 @@ cli::Json ModernSession::finish_live(const std::string& request_id, uint64_t pre
|
||||
}
|
||||
g_.contract_screen = run.previous_contract_hook;
|
||||
contract_expiry_presenter_installed_ = run.previous_contract_installed;
|
||||
modern::journal_advance(g_, run.saved_state);
|
||||
modern::ensure_ui_identities(g_);
|
||||
ui_last_advance_ = std::make_pair(run.from_date, g_.date);
|
||||
ui_last_awards_ = std::move(run.awards);
|
||||
@@ -9845,6 +9847,7 @@ cli::Json ModernSession::ui_command(const cli::Json& request, uint64_t& revision
|
||||
return refuse(r.kind == TurnDeskKind::WaitingAtDesk ? "decision_pending" : "advance_failed",
|
||||
"Weiter nicht möglich: " + reason);
|
||||
}
|
||||
modern::journal_advance(g_, saved_state);
|
||||
modern::ensure_ui_identities(g_);
|
||||
revision = previous + 1;
|
||||
ui_last_advance_ = std::make_pair(saved_state.date, g_.date); // what read_live replays
|
||||
@@ -10055,6 +10058,12 @@ cli::Json ModernSession::ui_command(const cli::Json& request, uint64_t& revision
|
||||
answer = modern::ui_command_result(request_id, previous, revision, {"contracts", "squad", "desktop"},
|
||||
result.feedback.empty() ? (result.accepted ? "Vertrag verlängert." : "Angebot abgelehnt.")
|
||||
: result.feedback);
|
||||
if (result.accepted) {
|
||||
const int club = g_.manager_teams[size_t(manager)];
|
||||
modern::note_press(g_, "contract.extended", modern::ui_team_id(g_, club),
|
||||
cli::Json::Object{{"team", modern::press_team(g_, club)}, {"player", modern::press_player(g_, r.player_id)},
|
||||
{"years", int(r.term_column + 1)}, {"wage", modern::ui_money(r.monthly_salary)}});
|
||||
}
|
||||
if (!result.accepted) std::get<cli::Json::Object>(answer.value)["outcome"] = "offer_rejected";
|
||||
}
|
||||
} else if (kind == "advertising.accept" || kind == "budget.commit") {
|
||||
@@ -10337,6 +10346,9 @@ cli::Json ModernSession::ui_command(const cli::Json& request, uint64_t& revision
|
||||
? g_.memory.u8(::bmh::layout::OriginalManagerCount) : int(g_.manager_teams.size());
|
||||
if (humans > 1)
|
||||
return refuse("resign_not_supported_yet", "Aufgeben bei mehreren menschlichen Managern folgt noch.");
|
||||
if (const int club = g_.manager_teams[size_t(manager)]; club >= 0)
|
||||
modern::note_press(g_, "career.manager_resigned", modern::ui_team_id(g_, club),
|
||||
cli::Json::Object{{"team", modern::press_team(g_, club)}, {"manager", modern::ui_manager_id(g_, manager)}});
|
||||
turn_driver_.stage = TurnDriver::Stage::CareerComplete;
|
||||
revision = previous + 1;
|
||||
answer = modern::ui_command_result(request_id, previous, revision, {"session", "desktop"},
|
||||
|
||||
Reference in new issue
Block a user