Reduce the career's game options to the ones that matter; keep leagues in a running game

The game page of a Dreierpack career offers five options (winter
postponements and their cap, indoor tournaments, the two transfer-news
switches). The cells of the original's presentation, the multi-player and
autosave cells and the switches that take leagues out of a running game are
no longer shown, and settings.commit refuses them. The sound page and the
marking automation are hidden in a career. A mailbox text cut inside a
multi-byte character no longer breaks the news read. modern_live_dump can
commit options and reports their effect.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
This commit is contained in:
MichaelandClaude Fable 5.2 committed 2026-11-14 09:32:01 +01:00
1 parent 6d70a48be8
commit 1de09ba8a6
7 files changed
+135 -12

No files matched your search

+43
View File
@@ -51,7 +51,50 @@ inline const Json &live_settings_catalogue() {
}();
return view;
}
// The game options of a Dreierpack career: only switches that change how the season is
// played or what the manager is told. The stored cells of the original's presentation
// (broadcast panels, animation timings, result boards per competition) have no effect in
// this interface and are not offered; neither is switching leagues off in a running game.
inline const Json &career_settings_catalogue() {
static const Json view = [] {
const auto &all = settings_catalogue();
const auto find = [&](const std::string &code) -> Json {
for (const auto &group : all.at("groups"))
if (group.contains("options"))
for (const auto &row : group.at("options"))
if (row.value("code", "") == code) return row;
throw editor::Error("Unbekannte Spieloption.");
};
const auto option = [&](const char *code, const char *label, const char *help) {
Json row = find(code);
row["label"] = label; row["help"] = help;
return row;
};
Json out = Json::object();
out["groups"] = Json::array(
{{{"id", "rules"}, {"title", "Spielablauf"},
{"options", Json::array({option("P5", "Spielausfälle im Winter", "Bei schlechtem Wetter fallen Spiele aus und werden nachgeholt."),
option("J8", "Höchstens ausgefallene Spiele je Liga und Spieltag", "0 bis 9."),
option("Q5", "Hallenturniere in der Winterpause", "Kann während der Hallensaison nicht umgestellt werden.")})}},
{{"id", "transfers"}, {"title", "Nachrichten"},
{"options", Json::array({option("H6", "Alle Transfers melden", "Jeder Vereinswechsel erscheint in den Nachrichten."),
option("I6", "Nur Transfers der Tabellennachbarn melden", "")})}}});
out["sound"] = Json::array();
Json automation = Json::array();
for (const auto &row : all.at("automation"))
if (row[0] != "marking") automation.push_back(row);
out["automation"] = std::move(automation);
return out;
}();
return view;
}
inline int career_settings_option_count() {
int total = 0;
for (const auto &group : career_settings_catalogue().at("groups")) total += int(group.at("options").size());
return total;
}
inline int live_settings_option_count() {
int total = 0;
for (const auto &group : live_settings_catalogue().at("groups")) {
if (group.contains("options"))