" +
- picture(renderer_.diagram("advertising-ground", ad_ground_svg(taken, advertising_selected_ >= 0 && advertising_selected_ < 14 ? advertising_selected_ : -1), 2400), ad_ground_w * 2.25, ad_ground_h * 2.25);
- for (int i = 0; i < 14; ++i) {
- const auto &c = slots[size_t(i)];
- const auto b = ad_board(i);
- const bool on = taken[size_t(i)];
- const auto name = c.at("name").get();
- // the boards at the ends are read from the pitch: their writing stands upright
- const std::string face = " 0 ? " right" : b.turn < 0 ? " left" : "") + "\" style=\"" + (b.turn ? "left:" + pg((b.w - b.h) / 2) + ";top:" + pg((b.h - b.w) / 2) + ";width:" + pg(b.h) + ";height:" + pg(b.w) + ";" : std::string()) +
- "\">BANDE " + std::to_string(i + 1) + "" + esc(on ? name : "Platz frei") + "";
- out += btn("ad-contract", face, std::string("ad-board") + (on ? " on" : "") + (advertising_selected_ == i ? " selected" : ""),
- "id=\"ad-contract-" + std::to_string(i) + "\" data-ad-contract=\"" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) + "\" aria-pressed=\"" + (advertising_selected_ == i ? "true" : "false") + "\" aria-label=\"Bande " + std::to_string(i + 1) + ", " +
- esc(on ? name + ", " + terms(c) : std::string("Platz frei")) + "\" title=\"" + esc(on ? name + " · " + terms(c) : std::string("Platz frei · anklicken für Angebote")) + "\" style=\"left:" + pg(b.x) + ";top:" + pg(b.y) + ";width:" + pg(b.w) + ";height:" + pg(b.h) + ";\"");
- }
- out += "
" + pg_kicker("Vereinsprognose / Monat") + "
";
- for (const auto &[label, key] : std::array
, 3>{{{"Einnahmen", "income"}, {"Ausgaben", "expenses"}, {"Saldo", "balance"}}}) {
- const auto value = view.at(key).get();
- out += "" + std::string(label) + "= 0 ? " ad-plus" : " ad-minus") : "") + "\">" +
- esc((std::string(key) == "balance" && value > 0 ? "+ " : "") + ad_cash(value)) + "
";
- }
- out += "";
- // the five pictures: the pointer shows what stands there, a click goes on
- const auto tile = [&](const std::string &action, const std::string &id, const std::string &attrs, const std::string &art, const std::string &title, const std::string &kicker, const std::string &value, const std::string &detail, bool selected) {
- return btn(action, "
" + img(art, 520, 459, false, true, 1100) + "" + esc(pg_upper(kicker)) + "" + esc(value) + "" + esc(detail) +
- "" + esc(title) + "",
- std::string("ad-tile") + (selected ? " selected" : ""), "id=\"" + id + "\" " + attrs + " aria-label=\"" + esc(title + ": " + value + (detail.empty() ? "" : ", " + detail)) + "\"");
+ // The menu has two pages: the contracts with sponsors, and what the club invests itself.
+ const bool investing = advertising_page_ == "investments";
+ page_title_ = investing ? "Investitionen" : "Werbung";
+ const auto forecast = [&] {
+ std::string row = pg_kicker("Vereinsprognose / Monat") + "
";
+ for (const auto &[label, key] : std::array
, 3>{{{"Einnahmen", "income"}, {"Ausgaben", "expenses"}, {"Saldo", "balance"}}}) {
+ const auto value = view.at(key).get();
+ row += "" + std::string(label) + "= 0 ? " ad-plus" : " ad-minus") : "") + "\">" +
+ esc((std::string(key) == "balance" && value > 0 ? "+ " : "") + ad_cash(value)) + "
";
+ }
+ return row + "";
};
- for (const auto &[slot, art, title] : std::array
, 2>{{{14, "advertising.scene.shirt", "Trikotwerbung"}, {15, "advertising.scene.tv", "TV-Rechte"}}}) {
- const auto &c = slots[size_t(slot)];
- const bool on = c.at("active") == true;
- out += tile("ad-contract", "ad-contract-" + std::to_string(slot), "data-ad-contract=\"" + std::to_string(slot) + "\" data-id=\"" + std::to_string(slot) + "\" aria-pressed=\"" + (advertising_selected_ == slot ? "true" : "false") + "\"", art, title,
- on ? (slot == 14 ? "Aktueller Sponsor" : "Aktueller Sender") : "Platz frei", on ? c.at("name").get() : std::string("Kein Vertrag"), on ? terms(c) : std::string("Anklicken für Angebote"), advertising_selected_ == slot);
- }
- static constexpr std::array spending_art{"advertising.scene.merchandise", "advertising.scene.press", "advertising.scene.fans"};
+ // A picture one can click: the pointer shows what stands there today. `shape` is "", "wide"
+ // or "big"; `amount` stands beside the title where the picture is large enough for it.
+ const auto tile = [&](const std::string &action, const std::string &id, const std::string &attrs, const std::string &art, const std::string &title, const std::string &kicker, const std::string &value, const std::string &detail, bool selected,
+ const std::string &shape = std::string(), const std::string &amount = std::string()) {
+ const double w = shape == "big" ? 921 : shape == "wide" ? 1056 : 520, h = shape == "big" ? 690 : 459;
+ return btn(action, "" + img(art, w, h, false, true, shape.empty() ? 1100 : 1600) + "" + esc(pg_upper(kicker)) + "" + esc(value) + "" + esc(detail) +
+ "" + esc(title) + "" + (amount.empty() ? std::string() : "" + esc(amount) + "") + "",
+ std::string("ad-tile") + (shape.empty() ? "" : " " + shape) + (selected ? " selected" : ""), "id=\"" + id + "\" " + attrs + " aria-label=\"" + esc(title + ": " + value + (detail.empty() ? "" : ", " + detail)) + "\"");
+ };
+ // what the game does not know yet is shown, and says so
+ const std::string soon = "disabled=\"disabled\" aria-disabled=\"true\"";
std::string delivery;
- for (int i = 0; i < 3; ++i) {
- const auto &row = view.at("spending")[size_t(i)];
- const int weeks = row.value("delivery_weeks", 0);
- if (i == 0 && weeks > 0) delivery = "Fanartikel: Die Lieferung läuft noch " + std::to_string(weeks) + (weeks == 1 ? " Woche." : " Wochen.");
- out += tile("ad-spending", "ad-spending-" + std::to_string(i), "data-ad-spending=\"" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) + "\"", spending_art[size_t(i)], row.at("name").get(), i == 0 ? "Bestellung" : "Monatsbudget",
- ad_cash(row.at("amount").get()), i == 0 && weeks > 0 ? "Lieferung läuft noch" : "Anklicken zum Ändern", false);
+ if (const int weeks = view.at("spending")[0].value("delivery_weeks", 0); weeks > 0) delivery = "Fanartikel: Die Lieferung läuft noch " + std::to_string(weeks) + (weeks == 1 ? " Woche." : " Wochen.");
+ std::string out = "";
+ if (investing) {
+ page_hint_ = "Wohin der Verein sein Geld steckt";
+ static constexpr std::array
spending_art{"advertising.scene.merchandise", "advertising.scene.press", "advertising.scene.fans"};
+ std::string rows;
+ out += "";
+ for (int i = 0; i < 3; ++i) {
+ const auto &row = view.at("spending")[size_t(i)];
+ const bool waiting = i == 0 && !delivery.empty();
+ const auto amount = ad_cash(row.at("amount").get
());
+ out += tile("ad-spending", "ad-spending-" + std::to_string(i), "data-ad-spending=\"" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) + "\"", spending_art[size_t(i)], row.at("name").get(), i == 0 ? "Bestellung" : "Monatsbudget", amount,
+ waiting ? "Die Lieferung läuft noch" : "Anklicken zum Ändern", false, "big", amount);
+ rows += "" + esc(row.at("name").get()) + "" + esc(amount) + (i == 0 ? "" : " / Monat") + "
";
+ }
+ out += tile("ad-soon", "ad-spending-international", soon, "investment.scene.international", "Internationale Vermarktung", "Neu", "Noch nicht im Spiel", "Diese Investition folgt", false, "big", "—") + "" + pg_kicker("Investitionen") + rows + "
Internationale Vermarktungfolgt
" +
+ (delivery.empty() ? std::string() : "
" + esc(delivery) + "") + "
" + pg_kicker("Vereinsprognose / Monat") + "
Einnahmen" + esc(ad_cash(view.at("income").get())) +
+ "
Ausgaben" + esc(ad_cash(view.at("expenses").get())) + "
Saldo() >= 0 ? "ad-plus" : "ad-minus") + "\">" +
+ esc((view.at("balance").get() > 0 ? "+ " : "") + ad_cash(view.at("balance").get())) + "
Der Mauszeiger auf einem Bild zeigt den aktuellen Stand, ein Klick öffnet das Zahlenfeld. Fanartikel werden bestellt und geliefert; Öffentlichkeitsarbeit und Fanbetreuung sind Budgets je Monat. ";
+ } else {
+ out += "" +
+ picture(renderer_.diagram("advertising-ground", ad_ground_svg(taken, advertising_selected_ >= 0 && advertising_selected_ < 14 ? advertising_selected_ : -1), 2400), ad_ground_w * 2.25, ad_ground_h * 2.25);
+ for (int i = 0; i < 14; ++i) {
+ const auto &c = slots[size_t(i)];
+ const auto b = ad_board(i);
+ const bool on = taken[size_t(i)];
+ const auto name = c.at("name").get();
+ // the boards at the ends are read from the pitch: their writing stands upright
+ const std::string face = " 0 ? " right" : b.turn < 0 ? " left" : "") + "\" style=\"" + (b.turn ? "left:" + pg((b.w - b.h) / 2) + ";top:" + pg((b.h - b.w) / 2) + ";width:" + pg(b.h) + ";height:" + pg(b.w) + ";" : std::string()) +
+ "\">BANDE " + std::to_string(i + 1) + "" + esc(on ? name : "Platz frei") + "";
+ out += btn("ad-contract", face, std::string("ad-board") + (on ? " on" : "") + (advertising_selected_ == i ? " selected" : ""),
+ "id=\"ad-contract-" + std::to_string(i) + "\" data-ad-contract=\"" + std::to_string(i) + "\" data-id=\"" + std::to_string(i) + "\" aria-pressed=\"" + (advertising_selected_ == i ? "true" : "false") + "\" aria-label=\"Bande " + std::to_string(i + 1) + ", " +
+ esc(on ? name + ", " + terms(c) : std::string("Platz frei")) + "\" title=\"" + esc(on ? name + " · " + terms(c) : std::string("Platz frei · anklicken für Angebote")) + "\" style=\"left:" + pg(b.x) + ";top:" + pg(b.y) + ";width:" + pg(b.w) + ";height:" + pg(b.h) + ";\"");
+ }
+ out += "
" + forecast() + "
";
+ for (const auto &[slot, art, title] : std::array
, 2>{{{14, "advertising.scene.shirt", "Trikotwerbung"}, {15, "advertising.scene.tv", "TV-Rechte"}}}) {
+ const auto &c = slots[size_t(slot)];
+ const bool on = c.at("active") == true;
+ out += tile("ad-contract", "ad-contract-" + std::to_string(slot), "data-ad-contract=\"" + std::to_string(slot) + "\" data-id=\"" + std::to_string(slot) + "\" aria-pressed=\"" + (advertising_selected_ == slot ? "true" : "false") + "\"", art, title,
+ on ? (slot == 14 ? "Aktueller Sponsor" : "Aktueller Sender") : "Platz frei", on ? c.at("name").get() : std::string("Kein Vertrag"), on ? terms(c) : std::string("Anklicken für Angebote"), advertising_selected_ == slot);
+ }
+ out += tile("ad-soon", "ad-contract-naming", soon, "advertising.scene.arena", "Namensrecht Stadion", "Neu", "Noch nicht im Spiel", "Dieser Vertrag folgt", false, "wide") +
+ "WerbungDer Mauszeiger auf einem Bild zeigt den aktuellen Vertrag. Ein Klick auf eine Bande, das Trikot oder die Kamera blättert durch die Angebote. Fanartikel, Öffentlichkeitsarbeit und Fanbetreuung stehen unter Investitionen." +
+ "
" + btn(engine_mode_ ? std::string("engine-open") : std::string("open:investments"), "Zu den Investitionen ›", "pg-btn", "id=\"ad-to-investments\" data-id=\"investments\"") + "
";
}
- out += "Werbung und VereinsausgabenDer Mauszeiger auf einem Bild zeigt den aktuellen Stand. Ein Klick auf eine Bande, das Trikot oder die Kamera blättert durch die Angebote; die drei Ausgaben öffnen das Zahlenfeld." +
- (delivery.empty() ? std::string() : "" + esc(delivery) + "") + "