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

+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)},