Use actual league names in settings groups and search (by Codex)

This commit is contained in:
Codex committed 2026-10-29 20:15:30 +01:00
1 parent 3a1242650f
commit f9f950fc7f
7 files changed
+88 -4

No files matched your search

+1 -1
View File
@@ -119,4 +119,4 @@ Nach der Übergabe (MVP_FOR_CLAUDE.md): A Schreibtisch (dieser Stand) → B Vorb
- `indoor-standings`: reiner Club-Read aus der vorhandenen Originalprojektion. `teamId`, `tournaments`, `rows[{rank, points, team:{id,name}}]` (16 beziehungsweise leer vor dem ersten Turnier), `footer`, `indoor`, `scoring: null | {value, places:[{rank,points}]}`. Die Wertung sind Punkte, keine Geldbeträge; Slot-/Spriteformatierung bleibt aus dem Transport. Keine Qualifikations- oder Ziehungsmutatoren, keine zusätzlichen Commands.
- `settings`: reine 180-Zellen-Projektion mit `code/raw/displayRaw/value/editable/min/max/step/reason`, fünf Automatiken, vorhandenen Aufstellungsslots und Auswahl. Verfügbarkeitsbits/Spezialwerte bleiben getrennt von booleschen Werten; originale Schalter speichern 0 für An/1 für Aus, `value` und Commandwerte sind semantisch 1 für An/0 für Aus. Neunte Spalte angezeigt halbiert, Rohparität erhalten. `settings.commit` übergibt sparse `edits[{code,value}]` und `automation[{id,enabled,formation?}]`; alle Schritte durch bestehende Dispatcher, gesamte Änderung atomar, eine Revision beziehungsweise echter No-op. Nationale Trainingssperre und vorhandene Aufstellungsmasken bleiben bindend. Kein OBW-/OBS-Formatwechsel.
- `settings`: `leagueGroups[{row,competitionId,name}]` bindet A–E an die fünf tatsächlichen deutschen Ligaindizes und ihre Sessionnamen (ID/Name beide `null`, falls unbekannt). Anzeige und Suche verwenden dieselben Namen; keine POC-Namen als tatsächliche Weltbezeichnung. Daneben reine 180-Zellen-Projektion mit `code/raw/displayRaw/value/editable/min/max/step/reason`, fünf Automatiken, vorhandenen Aufstellungsslots und Auswahl. Verfügbarkeitsbits/Spezialwerte bleiben getrennt von booleschen Werten; originale Schalter speichern 0 für An/1 für Aus, `value` und Commandwerte sind semantisch 1 für An/0 für Aus. Neunte Spalte angezeigt halbiert, Rohparität erhalten. `settings.commit` übergibt sparse `edits[{code,value}]` und `automation[{id,enabled,formation?}]`; alle Schritte durch bestehende Dispatcher, gesamte Änderung atomar, eine Revision beziehungsweise echter No-op. Nationale Trainingssperre und vorhandene Aufstellungsmasken bleiben bindend. Kein OBW-/OBS-Formatwechsel.
+6
View File
@@ -20,3 +20,9 @@ Reine Spieländerungen schreiben keine globale Einstellungsdatei. Wird zugleich
Im tatsächlichen Karriereeinstieg ändern die Themeauswahl und deren Speicherung die Gestaltung. Fenstergröße und automatische Anpassung werden als aktuelle Fakten angezeigt; die frei wählbaren POC-Auflösungs-/Skalierungswerte werden nicht als wirksame Hostfunktionen ausgegeben. Sound zeigt die belegten ursprünglichen Spieltonschalter und deren echte Fähigkeiten. Es wird kein neuer Audiotreiber angebunden. Der separate HTML-/Demo-Entwurf und seine geplanten Plattformpräferenzen bleiben erhalten.
OBW/OBS, Matchlogik und Classic bleiben unverändert. Die Speicherrundreise prüft tatsächliche Spielzellen, reservierte Bits, Aufstellungswahl und Automatiken. Dies ist die tatsächliche Anbindung des Einstellungsmenüs, keine Behauptung über bereits vollständige Plattform-/Audiounterstützung.
## Tatsächliche Wettbewerbsgruppen · #28
Die Session liefert `leagueGroups` für die ursprünglichen Ergebnis-/Auslosungsschalter A–E: jeweils ursprüngliche Zeile, tatsächliche Wettbewerbs-ID und deren aktuellen Namen. Die Zuordnung entspricht den fünf in der Engine unterstützten deutschen Ligaindizes; sie wird nicht aus Namen, Tabellenplatz oder künftigen Ligagrößen geraten. Unbekannte IDs/Namen bleiben ausdrücklich unbekannt und bekommen eine neutrale Gruppenbezeichnung.
Der native Adapter prüft vollständige, eindeutige Zuordnungen im selben Karriere-/Welt-/Revisionskontext. Er erstellt eine Präsentationskopie des Katalogs. Gruppenüberschriften und Suche verwenden beide diese Kopie; HTML-/Demo-Katalog und Geometrie bleiben erhalten. Andere ursprüngliche Wettbewerbsgruppen bleiben ihre belegten Schalterbereiche, insbesondere werden gemeinsame Länderbereiche nicht in erfundene getrennte Regler zerlegt. Rohzellen, Grenzen, Speicherwege und Spielregeln ändern sich nicht.
+14 -1
View File
@@ -22,7 +22,19 @@ cli::Json ui_settings_data(const ModernState &state, const LeImage &exe,
using A = J::Array;
const auto view =
ui::settings_from_game(state, manager, revision, exe, sound);
A cells, automation, formations;
A cells, automation, formations, league_groups;
// Source result switches A-E address the five domestic league indices.
// Keep that binding explicit; UI labels must not infer it from league names.
for (size_t i = 0; i < 5; ++i) {
const bool known = i < state.world_league_id.size() &&
i < state.world_league_name.size() &&
!state.world_league_id[i].empty() &&
!state.world_league_name[i].empty();
league_groups.push_back(O{
{"row", std::string(1, char('A' + i))},
{"competitionId", known ? J(state.world_league_id[i]) : J(nullptr)},
{"name", known ? J(state.world_league_name[i]) : J(nullptr)}});
}
for (size_t i = 0; i < view.cells.size(); ++i) {
const int column = int(i % 9), row = int(i / 9), raw = view.cells[i];
ui::SettingsWriteRequest request;
@@ -90,6 +102,7 @@ cli::Json ui_settings_data(const ModernState &state, const LeImage &exe,
{"editable", available}});
}
return O{{"kind", "settings"},
{"leagueGroups", std::move(league_groups)},
{"cells", std::move(cells)},
{"automation", std::move(automation)},
{"formations", std::move(formations)},
+28
View File
@@ -1,6 +1,7 @@
// SPDX-License-Identifier: GPL-3.0-only
#include "modern/ui/demo_settings.hpp"
#include "modern/ui/engine_bridge.hpp"
#include "modern/ui/settings_presentation.hpp"
#include <set>
namespace bmh::modern_ui {
namespace {
@@ -21,6 +22,32 @@ Json engine_settings_projection(const Json &bundle) {
require_settings(read.at("meta").at(key) == meta.at(key),
"Die Einstellungen sind veraltet.");
const auto &data = read.at("data");
require_settings(data.at("leagueGroups").is_array() &&
data.at("leagueGroups").size() == 5,
"Unvollständige Wettbewerbszuordnung.");
Json titles = Json::object();
std::set<std::string> leagues;
for (size_t i = 0; i < 5; ++i) {
const auto &group = data.at("leagueGroups")[i];
const auto row = std::string(1, char('A' + i));
const auto &id = group.at("competitionId"), &name = group.at("name");
require_settings(group.at("row") == row &&
((id.is_null() && name.is_null()) ||
(id.is_string() && !id.get<std::string>().empty() &&
name.is_string() && !name.get<std::string>().empty() &&
leagues.insert(id.get<std::string>()).second)),
"Ungültige Wettbewerbszuordnung.");
titles[row] = name.is_null() ? "Wettbewerb " + row : name.get<std::string>();
}
Json catalogue = live_settings_catalogue();
for (auto &group : catalogue.at("groups"))
if (group.contains("competitions"))
for (auto &competition : group["competitions"]) {
const auto code = competition.at("options").at(0).at("code").get<std::string>();
const auto row = code.substr(0, 1);
if (titles.contains(row))
competition["title"] = titles.at(row);
}
require_settings(data.at("cells").is_array() &&
data.at("cells").size() == 180,
"Unvollständige Spieloptionen.");
@@ -89,6 +116,7 @@ Json engine_settings_projection(const Json &bundle) {
{"formation", data.at("formation")}}},
{"cells", capabilities},
{"automation", auto_caps},
{"catalogue", std::move(catalogue)},
{"formations", data.at("formations")}};
}
Json engine_settings_command(const Json &bundle, const Json &draft,
+6 -2
View File
@@ -127,6 +127,10 @@ std::string App::settings_option(const Json &option) const {
return settings_row(id, option.at("label").get<std::string>(),
option.value("help", ""), control);
}
const Json &App::settings_catalogue_view() const {
return engine_mode_ ? engine_settings_value_.at("catalogue")
: live_settings_catalogue();
}
std::string App::render_settings_groups(int *count) const {
std::istringstream words(settings_search_key(settings_query_));
std::vector<std::string> terms;
@@ -134,7 +138,7 @@ std::string App::render_settings_groups(int *count) const {
terms.push_back(word);
int found = 0;
std::string out;
for (const auto &group : live_settings_catalogue().at("groups")) {
for (const auto &group : settings_catalogue_view().at("groups")) {
std::string rows;
const auto matches = [&](const Json &o, const std::string &competition) {
const auto text = settings_search_key(
@@ -339,7 +343,7 @@ std::string App::render_settings() {
pane += "</div>";
} else {
std::vector<std::pair<std::string, std::string>> groups;
for (const auto &g : live_settings_catalogue().at("groups"))
for (const auto &g : settings_catalogue_view().at("groups"))
groups.emplace_back(g.at("id").get<std::string>(),
g.at("title").get<std::string>());
head += "<div class=\"settings-jump-label\"><span>Zum Abschnitt</span>" +
+1
View File
@@ -16,6 +16,7 @@ void begin_settings();
bool settings_global_only() const;
bool settings_dirty() const;
bool settings_valid() const;
const Json &settings_catalogue_view() const;
std::string render_settings_groups(int *count = nullptr) const;
std::string settings_row(const std::string &, const std::string &,
const std::string &, const std::string &) const;
@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-3.0-only
#include "modern/ui/engine_bridge.hpp"
#include "modern/ui/settings_presentation.hpp"
#include <iostream>
#include <stdexcept>
using namespace bmh::modern_ui;
@@ -41,11 +42,17 @@ int main() try {
b["camps"]["data"]["camps"] = Json::array();
auto &d = b["settings"]["data"];
d.update({{"cells", Json::array()},
{"leagueGroups", Json::array()},
{"automation", Json::array()},
{"formations",
Json::array({{{"value", 2}, {"label", "Synthetic slot 2"}},
{{"value", 6}, {"label", "Synthetic slot 6"}}})},
{"formation", 2}});
for (int i = 0; i < 5; ++i)
d["leagueGroups"].push_back(
{{"row", std::string(1, char('A' + i))},
{"competitionId", "competition:renamed-" + std::to_string(i)},
{"name", "Neue Spielklasse " + std::to_string(i)}});
for (int i = 0; i < 180; ++i)
d["cells"].push_back(
{{"code", std::string(1, char('A' + i / 9)) + char('1' + i % 9)},
@@ -69,7 +76,16 @@ int main() try {
d["automation"].push_back(
{{"id", key}, {"raw", 0}, {"enabled", false}, {"editable", true}});
const auto original = b;
const auto demo_catalogue = live_settings_catalogue();
const auto p = engine_settings_projection(b);
for (const auto &group : p.at("catalogue").at("groups"))
if (group.contains("competitions"))
for (size_t i = 0; i < 5; ++i)
check(group.at("competitions")[i].at("title") ==
"Neue Spielklasse " + std::to_string(i),
"POC league name replaced authoritative session name");
check(live_settings_catalogue() == demo_catalogue,
"actual settings changed demo catalogue");
check(b == original && p.at("local").at("cells")[1].is_null() &&
p.at("local").at("cells")[0] == 1 &&
p.at("local").at("cells")[8] == 65,
@@ -113,6 +129,22 @@ int main() try {
foreign = b;
foreign["settings"]["data"]["automation"][4]["editable"] = false;
rejects([&] { engine_settings_command(foreign, draft, "request:x"); });
foreign = b;
foreign["settings"]["data"]["leagueGroups"][1]["row"] = "A";
rejects([&] { engine_settings_projection(foreign); });
foreign = b;
foreign["settings"]["data"]["leagueGroups"][1]["competitionId"] =
"competition:renamed-0";
rejects([&] { engine_settings_projection(foreign); });
foreign = b;
foreign["settings"]["data"]["leagueGroups"][2]["competitionId"] = nullptr;
rejects([&] { engine_settings_projection(foreign); });
foreign["settings"]["data"]["leagueGroups"][2]["name"] = nullptr;
const auto unknown = engine_settings_projection(foreign);
for (const auto &group : unknown.at("catalogue").at("groups"))
if (group.contains("competitions"))
check(group.at("competitions")[2].at("title") == "Wettbewerb C",
"unknown competition silently used POC league name");
std::cout << "settings raw flags, parity display, sparse edits, explicit "
"slots, owner and readonly checks passed\n";
return 0;