Annual general meeting and change of club

At the end of a season three groups of members vote on a human manager.
Below half of the votes he has to take over one of up to seven interested
clubs; the same list lets a manager leave on his own from the manager page.
The meeting is shown as a needle that swings between red and green and
comes to rest on the result.

Engine: assembly_vote, club_offers, change_club; read "assembly", command
manager.clubChange, field assembly of session.advance; saved in
state/modern.json. Dismissals are always on until the options offer them.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-17 12:58:36 +01:00
1 parent 811edfa900
commit a2b9770d81
24 files changed
+1016 -7

No files matched your search

+17
View File
@@ -14,6 +14,8 @@ void App::engine_kickoff() {
// kickoff, never after a match the manager has watched and steered.
// this interface answers the bids for listed players: the field says so even while it is empty
if (!engine_advance_payload_.contains("transferOffers")) engine_advance_payload_["transferOffers"] = Json::object();
// ... and shows the annual general meeting at the end of a season
if (!engine_advance_payload_.contains("assembly")) engine_advance_payload_["assembly"] = Json::object();
Json rehearsal = engine_advance_payload_, live = engine_advance_payload_;
rehearsal["dryRun"] = true; live["live"] = true;
const auto probe = engine_advance_command(engine_data_, editor::new_id("request:ui-"), rehearsal);
@@ -163,6 +165,8 @@ void App::engine_accept(EngineReply result) {
engine_expiry_ask(args);
else if (engine_response_.value("code", "") == "decision_pending" && args.is_object() && args.value("decision", "") == "transfer_offers")
engine_offers_ask(args);
else if (engine_response_.value("code", "") == "decision_pending" && args.is_object() && args.value("decision", "") == "assembly")
engine_assembly_ask(args);
}
if (engine_response_.contains("seasonOpening")) {
// a new season began: its draw is shown once the ticker is closed
@@ -213,6 +217,13 @@ void App::engine_poll() {
}
refresh(); return;
}
if (result.response.value("messageType", "") == "assembly_read") {
// the clubs interested in a manager who thinks of leaving
const auto &read = result.response.at("read");
if (read.value("messageType", "") == "error" || !read.contains("data") || !read.at("data").value("available", false)) engine_notice_ = "Hier gibt es keinen Vereinswechsel.";
else { engine_assembly_ = read.at("data"); engine_assembly_clubs(false); }
refresh(); return;
}
if (result.response.value("messageType", "") == "poach_squad") {
// the squad of the club a manager wants to poach from
const auto &read = result.response.at("read");
@@ -466,6 +477,12 @@ void App::engine_event(Rml::Event &event) {
const auto action = node->GetAttribute<Rml::String>("data-action", ""), id = node->GetAttribute<Rml::String>("data-id", "");
if (!popup_.empty()) {
if(action=="balance-discard"){engine_balance_action(action,node);return;}
if (action == "assembly-club") {
const std::string team = id;
popup_.clear(); reset_popup(); confirm_ = {}; dirty_ = true;
engine_assembly_choose(team);
return;
}
if (action == "engine-offer-accept") {
const auto player = engine_offer_player_;
const int index = node->GetAttribute<int>("data-id", -1);