diff --git a/assets/modern/finance.rcss b/assets/modern/finance.rcss index a741c2d..1bfa22a 100644 --- a/assets/modern/finance.rcss +++ b/assets/modern/finance.rcss @@ -38,3 +38,56 @@ body.midnight .balance-plan-value {background-color:#111f2a80;border-color:#c5d9 /* Balances use semantic money colours in every skin. */ body .balance-native .balance-summary-item.money-amount {color:var(--money);} body .balance-native .balance-summary-item.money-amount.is-negative {color:var(--danger);} + +/* the balance: sums as numerals, every position with its share */ +.balance-tile {position:absolute;border:2dp var(--rule);border-radius:10dp;background-color:var(--panel);display:flex;flex-direction:column;align-items:center;justify-content:center;} +.balance-tile strong {display:block;font-family:Display;font-size:58dp;line-height:72dp;font-weight:bold;white-space:nowrap;} +.balance-tile span {display:block;font-size:32dp;line-height:42dp;color:var(--muted);} +.balance-tile.loss strong {color:var(--loss);} +.balance-tile.gain strong {color:var(--win);} +.balance-scale {position:absolute;left:0;top:224dp;width:2612dp;height:60dp;display:flex;border-radius:8dp;overflow:hidden;} +.balance-scale>div {display:flex;align-items:center;justify-content:center;min-width:0;overflow:hidden;} +.balance-scale span {display:block;font-size:28dp;white-space:nowrap;color:#ffffff;} +.balance-scale .in {background-color:#3f8a63;} +.balance-scale .out {background-color:#b24a4f;} +.balance-panel {top:308dp;height:1330dp;background-color:var(--panel);border-color:var(--rule);border-radius:10dp;} +.balance-panel h2 {font-family:Display;font-size:44dp;line-height:54dp;font-weight:bold;text-align:left;margin:0 0 0 10dp;} +.balance-table {top:96dp;} +.balance-row {align-items:center;height:92dp;border-bottom:2dp var(--rule);font-size:34dp;} +.balance-row>span,.balance-row>span:last-child {width:auto;max-width:none;padding:0 10dp;line-height:44dp;flex-shrink:0;} +.balance-row .name {width:420dp;} +.balance-bar {flex:1;height:22dp;border-radius:11dp;background-color:var(--rule);overflow:hidden;} +.balance-bar>div {height:22dp;border-radius:11dp;background-color:#3f8a63;} +.balance-panel.costs .balance-bar>div {background-color:#b24a4f;} +.balance-row .share {width:110dp;text-align:right;font-size:28dp;color:var(--muted);} +.balance-row .sum {width:330dp;text-align:right;font-family:Display;font-weight:bold;font-size:36dp;} +.balance-row.none {color:var(--muted);} +.balance-row.none .sum {font-weight:normal;} +.balance-games {position:absolute;left:10dp;top:1656dp;width:2592dp;height:44dp;margin:0;line-height:44dp;font-size:30dp;color:var(--muted);} +.balance-row {font-size:40dp;} +.balance-row .name {width:520dp;} +.balance-row .sum {width:400dp;font-size:44dp;} +.balance-row .share {width:130dp;font-size:32dp;} +.balance-bar,.balance-bar>div {height:28dp;border-radius:14dp;} +.balance-tile strong {font-size:66dp;line-height:80dp;} +.balance-tile span {font-size:36dp;} +.balance-games {font-size:34dp;} + +/* the what-if calculation */ +.balance-toggle {left:560dp;width:2052dp;} +.balance-sim-button {position:absolute;left:0;bottom:0;width:536dp;height:94dp;display:flex;align-items:center;justify-content:center;} +.balance-sim {position:absolute;left:0;top:0;right:0;bottom:120dp;} +.balance-sim-controls {position:absolute;left:0;top:0;width:2612dp;height:210dp;display:flex;gap:30dp;} +.balance-sim-control {flex:1;border:2dp var(--rule);border-radius:10dp;background-color:var(--panel);padding:22dp 36dp;} +.balance-sim-label {display:flex;align-items:baseline;justify-content:space-between;height:76dp;font-size:36dp;} +.balance-sim-label span,.balance-sim-label strong {display:block;} +.balance-sim-label strong {font-family:Display;font-size:60dp;font-weight:bold;} +.balance-sim-control input {display:block;width:100%;height:60dp;margin-top:16dp;} +.balance-sim-out {position:absolute;left:0;top:240dp;width:2612dp;height:1480dp;} +.balance-sim-graph {position:absolute;left:0;top:226dp;width:2612dp;height:880dp;border:2dp var(--rule);border-radius:10dp;background-color:var(--panel);padding:18dp 14dp;} +.balance-sim-legend {position:absolute;left:10dp;top:1126dp;height:44dp;display:flex;align-items:center;font-size:32dp;color:var(--muted);} +.balance-sim-legend span {display:block;flex-shrink:0;} +.balance-sim-legend .key {width:60dp;height:12dp;border-radius:6dp;margin:0 14dp 0 0;} +.balance-sim-legend .key.sim {background-color:#25617a;} +.balance-sim-legend .key.now {background-color:#9a7a3a;margin-left:50dp;} +.balance-sim-reading {position:absolute;left:10dp;top:1190dp;width:2592dp;margin:0;font-size:36dp;line-height:50dp;} diff --git a/src/modern/content/ui_contract.cpp b/src/modern/content/ui_contract.cpp index 0cd4564..f33ed87 100644 --- a/src/modern/content/ui_contract.cpp +++ b/src/modern/content/ui_contract.cpp @@ -278,6 +278,25 @@ J squad_data(const ModernState& g, const UiContext& c, int team, const std::stri const bool own = team == team_of(g, c.manager) && team < league_clubs(); const size_t board = size_t(c.manager) * 0x840; const SquadRange r = squad_range(team); + // what the almanac recorded of the running season, by world player id: goals, assists and + // matches in the starting eleven or coming on (no shoot-out kicks) + struct Tally { int goals = 0, assists = 0, games = 0; }; + std::map season; + { + const auto& s = g.almanac.current; + const auto id_of = [&](uint16_t p) { return p < s.players.size() ? s.players[p].id : std::string(); }; + for (const auto& m : s.matches) { + for (const auto& side : m.lineup) + for (size_t i = 0; i < side.size() && i < 11; ++i) + if (side[i] != kAlmanacNone) ++season[id_of(side[i])].games; + for (const auto& e : m.events) { + if (e.kind == AlmanacEventKind::Goal) { + if (e.player != kAlmanacNone) ++season[id_of(e.player)].goals; + if (e.other != kAlmanacNone) ++season[id_of(e.other)].assists; + } else if (e.kind == AlmanacEventKind::Substitution && e.player != kAlmanacNone) ++season[id_of(e.player)].games; + } + } + } A players; for (size_t s = r.first; s < r.first + r.count && s < g.squad_slots.size(); ++s) { const uint16_t e = g.squad_slots[s]; @@ -323,6 +342,9 @@ J squad_data(const ModernState& g, const UiContext& c, int team, const std::stri row["contractRemaining"] = nullptr; } row["contractUntil"] = nullptr; + const auto tally = season.find(pid); + row["season"] = O{{"goals", tally == season.end() ? 0 : tally->second.goals}, {"assists", tally == season.end() ? 0 : tally->second.assists}, + {"games", tally == season.end() ? 0 : tally->second.games}}; players.push_back(std::move(row)); } return O{{"kind", "squad"}, {"team", team_ref(g, team, today)}, {"players", std::move(players)}}; diff --git a/src/modern/ui/controls.inc b/src/modern/ui/controls.inc index 6b0d0ce..60251b4 100644 --- a/src/modern/ui/controls.inc +++ b/src/modern/ui/controls.inc @@ -155,6 +155,7 @@ void App::ProcessEvent(Rml::Event &event) try { if (entry_event(event)) return; if (opening_event(event)) return; if (amount_event(event)) return; + if (balance_simulation_event(event)) return; if (popup_.empty() && settings_event(event)) return; if (popup_.empty() && (files_event(event) || widget_event(event))) return; if ((menu_ == "lineup" || menu_ == "transfer" || scene_ == "manager") && (type == "change" || type == "input")) { diff --git a/src/modern/ui/engine_balance.inc b/src/modern/ui/engine_balance.inc index 18821a4..52f3617 100644 --- a/src/modern/ui/engine_balance.inc +++ b/src/modern/ui/engine_balance.inc @@ -120,6 +120,13 @@ void App::engine_balance_close(const std::string &after) { } bool App::engine_balance_action(const std::string &action, Rml::Element *target) { + if (menu_ == "balance" && action == "balance-sim") { + balance_sim_ = !balance_sim_; + if (balance_sim_) balance_sim_price_ = 0; + focus_after_render_ = "balance-sim"; + refresh(); + return true; + } if (menu_ != "balance") return false; if (action == "balance-discard") { diff --git a/src/modern/ui/engine_controls.inc b/src/modern/ui/engine_controls.inc index 1c30503..12bab66 100644 --- a/src/modern/ui/engine_controls.inc +++ b/src/modern/ui/engine_controls.inc @@ -276,6 +276,7 @@ void App::engine_event(Rml::Event &event) { const auto type = event.GetType(); auto *target = event.GetTargetElement(); if (type == "keydown") keyboard_navigation_ = true; if (type == "mousedown") keyboard_navigation_ = false; + if (balance_simulation_event(event)) return; if (scene_ == "live" && live_.available()) { // The ticker of a played kickoff: only its own controls, nothing of the desk beneath. if (live_event(event)) return; diff --git a/src/modern/ui/engine_dto.cpp b/src/modern/ui/engine_dto.cpp index d35222d..677552f 100644 --- a/src/modern/ui/engine_dto.cpp +++ b/src/modern/ui/engine_dto.cpp @@ -144,6 +144,10 @@ Json engine_lineup_projection(const Json &bundle) { for (const auto *key : {"corner", "free_kick", "tackling", "passing", "shooting", "speed", "teamplay"}) row[key] = raw.at("skills").value(key, Json()); for (const auto *key : {"motivation", "goals", "assists", "games", "grade"}) row[key] = nullptr; + // the season's counts from the almanac, when the engine sends them + if (raw.contains("season") && raw.at("season").is_object()) + for (const auto *key : {"goals", "assists", "games"}) + if (raw.at("season").value(key, Json()).is_number_integer()) row[key] = raw.at("season").at(key); const auto role = roles.at(id).get(); require(role == "starter" || role == "bench" || role == "reserve", "Unbekannter Kaderstatus."); row["status"] = role == "starter" ? "Startelf" : role == "bench" ? "Ersatzbank" : "—"; diff --git a/src/modern/ui/finance_controls.inc b/src/modern/ui/finance_controls.inc index 320c5f5..4ba70b9 100644 --- a/src/modern/ui/finance_controls.inc +++ b/src/modern/ui/finance_controls.inc @@ -10,6 +10,13 @@ bool App::commit_finance(const Json &change, uint64_t revision) { return true; } bool App::finance_action(const std::string &action, Rml::Element *target) { + if (menu_ == "balance" && action == "balance-sim") { + balance_sim_ = !balance_sim_; + if (balance_sim_) balance_sim_price_ = 0; // start again from the booked values + focus_after_render_ = "balance-sim"; + refresh(); + return true; + } if(engine_mode_)return engine_balance_action(action,target); if (menu_ != "balance") return false; if (action == "balance-toggle") { diff --git a/src/modern/ui/finance_screens.inc b/src/modern/ui/finance_screens.inc index 62a97c6..4aeb362 100644 --- a/src/modern/ui/finance_screens.inc +++ b/src/modern/ui/finance_screens.inc @@ -3,7 +3,8 @@ std::string App::render_balance() { const auto rows = balance_rows(); if (!rows.value("ok", false)) throw editor::Error("Die Bilanzdaten sind ungültig."); std::string out = "
"; - if (balance_future_) { + if (balance_sim_) out += render_balance_simulation(); + else if (balance_future_) { out += "

Ausgabenplanung

"; int i = 0; for (const auto &row : rows.at("plan")) { @@ -17,18 +18,47 @@ std::string App::render_balance() { out += "

Geplante Ausgaben" + esc(balance_cash(rows.at("plan_total").get())) + "

"; } else { + // the season's money at a glance: the sums as numerals, then every position with its + // share of its side as a bar + int64_t sums[2] = {0, 0}; + { + int side = 0; + for (const auto &kind : {std::string("income"), std::string("costs")}) { + for (const auto &row : rows.at(kind)) sums[side] += std::max(0, row.at("amount").get()); + ++side; + } + } + const int64_t net = rows.at("balance").get(); + const std::array, 5> tiles{{ + {balance_cash(sums[0]), "Einnahmen", ""}, {balance_cash(sums[1]), "Ausgaben", ""}, + {balance_cash(net), "Saldo der Saison", net < 0 ? "loss" : "gain"}, + {balance_cash(rows.at("cash").get()), "Kontostand", ""}, + {number(rows.at("attendance_average").get()), "Zuschauerschnitt", + ""}}}; + for (size_t i = 0; i < tiles.size(); ++i) + out += "
" + esc(tiles[i][0]) + "" + tiles[i][1] + "
"; + // income against costs as one bar + const double whole = double(std::max(1, sums[0] + sums[1])); + out += "
Einnahmen " + scalar(std::round(sums[0] * 1000.0 / whole) / 10) + + " %
Ausgaben " + scalar(std::round(sums[1] * 1000.0 / whole) / 10) + " %
"; int index = 0; for (const auto &kind : {std::string("income"), std::string("costs")}) { - out += "

" + (kind == "income" ? "Einnahmen" : "Ausgaben") + "

" - "
PositionBetrag
"; - int n = 0; + const int64_t sum = std::max(1, sums[index]); + out += "

" + (kind == "income" ? "Einnahmen" : "Ausgaben") + "

"; + // the rows share the panel's height + const double row_height = std::min(170.0, 1206.0 / double(std::max(1, rows.at(kind).size()))); for (const auto &row : rows.at(kind)) { - out += "
" + - esc(row.at("name").get()) + "" + esc(balance_cash(row.at("amount").get())) + "
"; + const int64_t amount = row.at("amount").get(); + const double part = std::clamp(double(std::max(0, amount)) * 100.0 / double(sum), 0.0, 100.0); + out += "
" + esc(row.at("name").get()) + + "
" + (amount ? scalar(std::round(part)) + " %" : std::string()) + + "" + esc(balance_cash(amount)) + "
"; } out += "
"; } + out += "

" + esc(number(rows.at("league_home_games").get()) + " Liga-Heimspiele · " + number(rows.at("other_home_games").get()) + + " sonstige Heimspiele · Eintrittspreis " + balance_cash(rows.at("ticket").get())) + "

"; const std::array values = { number(rows.at("league_home_games").get()) + " Liga-Heimspiele", number(rows.at("other_home_games").get()) + " sonstige Heimspiele", @@ -36,11 +66,12 @@ std::string App::render_balance() { "Eintrittspreis: " + balance_cash(rows.at("ticket").get()), "Kontostand: " + balance_cash(rows.at("cash").get()), "Saldo: " + balance_cash(rows.at("balance").get())}; - for (int i = 0; i < 6; ++i) + for (int i = 0; i < 0; ++i) out += "

()):std::string()) + "\" style=\"" + rect(26 + (i % 2) * 1310, 1526 + (i / 2) * 68, 1250, 38) + "\">" + esc(values[size_t(i)]) + "

"; } - out += btn("balance-toggle", "" + std::string(balance_future_ ? "Zukunft" : "Aktuell") + + out += btn("balance-sim", balance_sim_ ? "Zurück zur Bilanz" : "Simulation", "balance-sim-button report-reset", "id=\"balance-sim\""); + if (!balance_sim_) out += btn("balance-toggle", "" + std::string(balance_future_ ? "Zukunft" : "Aktuell") + "", "balance-toggle report-reset", "id=\"balance-toggle\" aria-label=\"Zwischen aktueller Bilanz und Zukunftsplanung wechseln\""); return out + (engine_mode_?"

"+esc(engine_busy_?engine_operation_:engine_balance_feedback_)+"

":"") + "
"; diff --git a/src/modern/ui/finance_simulation.inc b/src/modern/ui/finance_simulation.inc new file mode 100644 index 0000000..a53205f --- /dev/null +++ b/src/modern/ui/finance_simulation.inc @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: GPL-3.0-only +// A what-if calculation on the balance sheet: the manager sets ticket price and crowd and sees +// where the cash goes over the coming home matches. It is arithmetic on the season's booked +// figures, not the engine's forecast: how the crowd answers a price is the engine's to decide. +std::string App::balance_simulation_result() { + const auto rows = balance_rows(); + if (!rows.value("ok", false)) return {}; + const double unit = engine_mode_ ? 100.0 : double(finance_currency_factor(*world_)); // row units per euro + const double ticket = rows.at("ticket").get() / unit, crowd = rows.at("attendance_average").get(); + const int played = std::max(1, int(rows.at("league_home_games").get() + rows.at("other_home_games").get())); + double costs = 0, other_income = 0; + for (const auto &row : rows.at("costs")) costs += std::max(0, row.at("amount").get()) / unit; + for (const auto &row : rows.at("income")) other_income += std::max(0, row.at("amount").get()) / unit; + other_income = std::max(0.0, other_income - ticket * crowd * played); // everything but the gate + const double cost_per_match = costs / played, other_per_match = other_income / played; + const double cash = rows.at("cash").get() / unit; + const int matches = balance_sim_matches_; + const auto per_match = [&](double price, double people) { return price * people + other_per_match - cost_per_match; }; + const double now = per_match(ticket, crowd), then = per_match(balance_sim_price_, balance_sim_crowd_); + const auto euro = [&](double value) { return esc(balance_cash(int64_t(std::llround(value * unit)))); }; + std::string out; + const std::array, 4> tiles{{ + {euro(balance_sim_price_ * balance_sim_crowd_), "Zuschauereinnahme je Heimspiel", ""}, + {euro(cost_per_match), "Kosten je Heimspiel bisher", ""}, + {euro(then), "Ergebnis je Heimspiel", then < 0 ? "loss" : "gain"}, + {euro(cash + then * matches), "Kontostand nach " + std::to_string(matches) + " Heimspielen", cash + then * matches < 0 ? "loss" : ""}}}; + for (size_t i = 0; i < tiles.size(); ++i) + out += "
" + tiles[i][0] + "" + tiles[i][1] + "
"; + // the cash after each home match: as booked so far, and with the sliders' values + const double base = cash; + (void)base; + const double low = std::min({now * matches, then * matches, 0.0}), high = std::max({now * matches, then * matches, 0.0}); + const double span = std::max(1.0, high - low), floor = low - span * .08, ceiling = high + span * .08; + const auto px = [&](double match) { return 250 + match * 2290.0 / matches; }; + const auto py = [&](double value) { return 760 - (value - floor) / (ceiling - floor) * 720; }; + const double zero = 0; + const std::string line = theme_ == "silver" ? "#25617a" : "#9ac7d8", gold = theme_ == "silver" ? "#9a7a3a" : "#d9bd7c", ink = theme_ == "silver" ? "#3d362a" : "#d5dde3", + faint = theme_ == "silver" ? "#4a433430" : "#dfeaf530"; + std::string svg = ""; + for (int row = 0; row <= 4; ++row) { + const double value = floor + (ceiling - floor) * row / 4; + svg += "" + number(int64_t(std::llround(value / 1000))) + " T€"; + } + svg += ""; + for (int match = 0; match <= matches; match += std::max(1, matches / 8)) + svg += "" + (match ? std::to_string(match) + "." : std::string("heute")) + ""; + const std::string tone = then >= 0 ? "#3f8a63" : "#b24a4f"; + svg += ""; + out += "
" + picture(renderer_.diagram("balance-simulation", svg, 2580), 2580, 840) + "
Veränderung des Kontostands mit diesen Werten" + "wie bisher (" + euro(ticket) + ", " + number(int64_t(crowd)) + " Zuschauer)
"; + const double even = balance_sim_price_ > 0 ? (cost_per_match - other_per_match) / balance_sim_price_ : 0; + out += "

" + std::string(then >= 0 ? "Mit diesen Werten trägt sich jedes Heimspiel. " : "Mit diesen Werten kostet jedes Heimspiel Geld. ") + + (even > 0 ? "Bei " + euro(balance_sim_price_) + " Eintritt deckt ein Schnitt von " + number(int64_t(std::ceil(even))) + " Zuschauern die bisherigen Kosten je Heimspiel." : std::string("Die übrigen Einnahmen decken die Kosten bereits.")) + + " Wie viele Zuschauer bei einem Preis wirklich kommen, entscheidet das Spiel.

"; + return out; +} +std::string App::render_balance_simulation() { + const auto rows = balance_rows(); + const double unit = engine_mode_ ? 100.0 : double(finance_currency_factor(*world_)); + if (balance_sim_price_ <= 0) { // start from the booked values + balance_sim_price_ = std::clamp(int(std::lround(rows.at("ticket").get() / unit)), 5, 60); + balance_sim_crowd_ = std::clamp(int(rows.at("attendance_average").get()) / 500 * 500, 1000, 100000); + balance_sim_matches_ = 17; + } + const auto slider = [&](const char *id, const char *label, int min, int max, int step, int value, const std::string &text) { + return "
" + std::string(label) + "" + text + "
"; + }; + return "
" + + slider("balance-sim-price", "Eintrittspreis", 5, 60, 1, balance_sim_price_, std::to_string(balance_sim_price_) + " €") + + slider("balance-sim-crowd", "Zuschauerschnitt", 1000, 100000, 500, balance_sim_crowd_, number(balance_sim_crowd_)) + + slider("balance-sim-matches", "Heimspiele voraus", 1, 34, 1, balance_sim_matches_, std::to_string(balance_sim_matches_)) + + "
" + balance_simulation_result() + "
"; +} +bool App::balance_simulation_event(Rml::Event &event) { + if (menu_ != "balance" || !balance_sim_ || !popup_.empty()) return false; + const auto type = event.GetType(); + if (type != "change" && type != "input") return false; + auto *target = event.GetTargetElement(); + if (!target || !target->GetId().starts_with("balance-sim-")) return false; + if (setting_menu_markup_) return true; + const auto read = [&](const char *id, int fallback) { + if (auto *input = dynamic_cast(element(id))) { try { return std::stoi(input->GetValue()); } catch (const std::exception &) {} } + return fallback; + }; + balance_sim_price_ = std::clamp(read("balance-sim-price", balance_sim_price_), 5, 60); + balance_sim_crowd_ = std::clamp(read("balance-sim-crowd", balance_sim_crowd_), 1000, 100000); + balance_sim_matches_ = std::clamp(read("balance-sim-matches", balance_sim_matches_), 1, 34); + // the sliders stay as they are under the pointer; only figures and graph are drawn anew + if (auto *node = element("balance-sim-price-value")) node->SetInnerRML(std::to_string(balance_sim_price_) + " €"); + if (auto *node = element("balance-sim-crowd-value")) node->SetInnerRML(number(balance_sim_crowd_)); + if (auto *node = element("balance-sim-matches-value")) node->SetInnerRML(std::to_string(balance_sim_matches_)); + if (auto *node = element("balance-sim-out")) node->SetInnerRML(balance_simulation_result()); + dirty_ = true; + return true; +} diff --git a/src/modern/ui/lineup_screens.inc b/src/modern/ui/lineup_screens.inc index 27abf68..5eb16aa 100644 --- a/src/modern/ui/lineup_screens.inc +++ b/src/modern/ui/lineup_screens.inc @@ -202,7 +202,7 @@ std::string App::render_lineup() { "lineup-head\" role=\"row\">"; const std::array, 2> headings{ {{{"Nr.", "Name", "Pos.", "Ko", "Te", "Fo", "Stärke", "Status", "Land", - "Mot.", "Tore", "Ass."}}, + "Sp.", "Tore", "Vorl."}}, {{"Nr.", "Name", "Alter", "Eck.", "Frei.", "Zwei.", "Pass", "Schuss", "Schn.", "Team", "Spiele", "Note"}}}}; for (int c = 0; c < 12; ++c) @@ -240,7 +240,7 @@ std::string App::render_lineup() { row.at("nation").is_string() ? row.at("nation").get() : "—", - lineup_value(row.at("motivation")), + lineup_value(row.at(engine_mode_ ? "games" : "motivation")), lineup_value(row.at("goals")), lineup_value(row.at("assists"))}; else diff --git a/src/modern/ui/view.cpp b/src/modern/ui/view.cpp index fb7cf21..c87eca2 100644 --- a/src/modern/ui/view.cpp +++ b/src/modern/ui/view.cpp @@ -457,6 +457,12 @@ class App final : public Rml::EventListener { std::string bank_view_ = "entrance", bank_hint_; int bank_property_ = 0, bank_owned_ = 0, bank_stock_ = 11; bool balance_future_ = false; + // the balance sheet's what-if calculation (finance_simulation.inc) + bool balance_sim_ = false; + int balance_sim_price_ = 0, balance_sim_crowd_ = 0, balance_sim_matches_ = 17; + std::string balance_simulation_result(); + std::string render_balance_simulation(); + bool balance_simulation_event(Rml::Event &); Json contract_draft_; std::string contracts_player_, contracts_dialog_, contracts_return_focus_, contracts_notice_; int contracts_tab_ = 2; @@ -776,6 +782,7 @@ class App final : public Rml::EventListener { bank_view_ = "entrance"; bank_hint_.clear(); balance_future_ = false; + balance_sim_ = false; almanac_year_ = 0; almanac_day_.clear(); almanac_match_.clear(); @@ -1683,6 +1690,7 @@ public: #include "modern/ui/engine_friendlies.inc" #include "modern/ui/engine_almanac.inc" #include "modern/ui/engine_reports.inc" +#include "modern/ui/finance_simulation.inc" #include "modern/ui/statistics_analysis.inc" #include "modern/ui/engine_rankings.inc" #include "modern/ui/engine_creation.inc"