mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-06-21 15:10:43 +00:00
3de5fb4204
**Add approved & assigned issue number here:** N/A — maintainer refactor. ## Description: Makes each map's `info.json` the single source of truth for map metadata — adding a map is now a folder with `image.png` + `info.json`, a `gen-maps` run, and an en.json display name. **info.json / manifest.json carry full map metadata.** Every `map-generator/assets/maps/<map>/info.json` declares `id` (the `GameMapType` enum key), `name` (the enum value — wire format, unchanged for all 94 maps), `translation_key`, `categories`, and `multiplayer_frequency` (the public-playlist weight that used to be the `FREQUENCY` record in MapPlaylist.ts). The generator validates everything and mirrors it into `resources/maps/<map>/manifest.json`. 23 stale info.json `name` values were normalized to the canonical enum value; enum values are byte-identical, so replays and stored game configs are unaffected. **The generator emits the TypeScript and discovers maps itself.** New `map-generator/codegen.go` generates `src/core/game/Maps.gen.ts` (`GameMapType`, `GameMapName`, `mapCategories`, `mapTranslationKeys`, `multiplayerFrequency` — now a full `Record<GameMapName, number>`, killing the old `Partial`) on every run; `Game.ts` re-exports it. The hardcoded map registry in `main.go` is gone — maps are auto-discovered from the `assets/maps` / `assets/test_maps` directories. MapConsistency tests fail with a "run `npm run gen-maps`" message if info.json, manifest.json, and Maps.gen.ts drift. The tracked `map-generator/map-generator` binary is rebuilt to match. **New categories: continents + world/cosmic/tournament/other, multi-category support.** `continental`/`regional`/`fantasy`/`arcade` are replaced by `featured`, `world`, `europe`, `asia`, `north_america`, `africa`, `south_america`, `oceania`, `antarctica`, `cosmic`, `tournament`, and `other`. Maps can list multiple categories, so straddlers (Black Sea, Bosphorus, Caucasus, Between Two Seas, Bering Sea/Strait, Mena, Strait of Gibraltar, Hawaii, Arctic) appear under both regions. Featured is itself a category (same 7 maps as before). MapPlaylist keeps its arcade exclusion via an explicit set. **Map picker UI.** Two tabs: **Featured** (default — featured maps plus a Favorites section when maps are starred) and **All** (one prominent collapsible bar per category with a map count, collapsed by default). The selected map is prepended to the featured grid when it lives elsewhere. `getMapName()` resolves through the generated `mapTranslationKeys`, which also fixes tourney maps never resolving a valid translation key. ## Please complete the following: - [ ] I have added screenshots for all UI updates (maintainer change — picker described above) - [x] I process any text displayed to the user through translateText() and I've added it to the en.json file - [x] I have added relevant tests to the test directory ## Please put your Discord username so you can be contacted if a bug or regression is found: evanpelle 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
386 lines
6.8 KiB
JSON
386 lines
6.8 KiB
JSON
{
|
|
"categories": ["featured", "world"],
|
|
"featured_rank": 1,
|
|
"id": "World",
|
|
"map": {
|
|
"height": 1000,
|
|
"num_land_tiles": 651609,
|
|
"width": 2000
|
|
},
|
|
"map16x": {
|
|
"height": 250,
|
|
"num_land_tiles": 37580,
|
|
"width": 500
|
|
},
|
|
"map4x": {
|
|
"height": 500,
|
|
"num_land_tiles": 158086,
|
|
"width": 1000
|
|
},
|
|
"multiplayer_frequency": 20,
|
|
"name": "World",
|
|
"nations": [
|
|
{
|
|
"coordinates": [484, 284],
|
|
"flag": "us",
|
|
"name": "United States"
|
|
},
|
|
{
|
|
"coordinates": [374, 186],
|
|
"flag": "ca",
|
|
"name": "Canada"
|
|
},
|
|
{
|
|
"coordinates": [375, 374],
|
|
"flag": "mx",
|
|
"name": "Mexico"
|
|
},
|
|
{
|
|
"coordinates": [500, 378],
|
|
"flag": "cu",
|
|
"name": "Cuba"
|
|
},
|
|
{
|
|
"coordinates": [527, 487],
|
|
"flag": "co",
|
|
"name": "Colombia"
|
|
},
|
|
{
|
|
"coordinates": [576, 466],
|
|
"flag": "ve",
|
|
"name": "Venezuela"
|
|
},
|
|
{
|
|
"coordinates": [565, 737],
|
|
"flag": "ar",
|
|
"name": "Argentina"
|
|
},
|
|
{
|
|
"coordinates": [684, 574],
|
|
"flag": "br",
|
|
"name": "Brazil"
|
|
},
|
|
{
|
|
"coordinates": [1280, 975],
|
|
"flag": "aq",
|
|
"name": "Antarctica"
|
|
},
|
|
{
|
|
"coordinates": [709, 57],
|
|
"flag": "gl",
|
|
"name": "Greenland"
|
|
},
|
|
{
|
|
"coordinates": [831, 112],
|
|
"flag": "is",
|
|
"name": "Iceland"
|
|
},
|
|
{
|
|
"coordinates": [925, 186],
|
|
"flag": "gb",
|
|
"name": "United Kingdom"
|
|
},
|
|
{
|
|
"coordinates": [887, 183],
|
|
"flag": "ie",
|
|
"name": "Ireland"
|
|
},
|
|
{
|
|
"coordinates": [908, 264],
|
|
"flag": "es",
|
|
"name": "Spain"
|
|
},
|
|
{
|
|
"coordinates": [1004, 250],
|
|
"flag": "it",
|
|
"name": "Italy"
|
|
},
|
|
{
|
|
"coordinates": [948, 221],
|
|
"flag": "fr",
|
|
"name": "France"
|
|
},
|
|
{
|
|
"coordinates": [990, 195],
|
|
"flag": "de",
|
|
"name": "Germany"
|
|
},
|
|
{
|
|
"coordinates": [1014, 137],
|
|
"flag": "se",
|
|
"name": "Sweden"
|
|
},
|
|
{
|
|
"coordinates": [1031, 193],
|
|
"flag": "pl",
|
|
"name": "Poland"
|
|
},
|
|
{
|
|
"coordinates": [1102, 183],
|
|
"flag": "by",
|
|
"name": "Belarus"
|
|
},
|
|
{
|
|
"coordinates": [1073, 230],
|
|
"flag": "ro",
|
|
"name": "Romania"
|
|
},
|
|
{
|
|
"coordinates": [1123, 272],
|
|
"flag": "tr",
|
|
"name": "Türkiye"
|
|
},
|
|
{
|
|
"coordinates": [969, 133],
|
|
"flag": "no",
|
|
"name": "Norway"
|
|
},
|
|
{
|
|
"coordinates": [1082, 126],
|
|
"flag": "fi",
|
|
"name": "Finland"
|
|
},
|
|
{
|
|
"coordinates": [1135, 210],
|
|
"flag": "ua",
|
|
"name": "Ukraine"
|
|
},
|
|
{
|
|
"coordinates": [1351, 134],
|
|
"flag": "ru",
|
|
"name": "Russia"
|
|
},
|
|
{
|
|
"coordinates": [1500, 203],
|
|
"flag": "mn",
|
|
"name": "Mongolia"
|
|
},
|
|
{
|
|
"coordinates": [1527, 303],
|
|
"flag": "cn",
|
|
"name": "China"
|
|
},
|
|
{
|
|
"coordinates": [1331, 353],
|
|
"flag": "in",
|
|
"name": "India"
|
|
},
|
|
{
|
|
"coordinates": [1279, 207],
|
|
"flag": "kz",
|
|
"name": "Kazakhstan"
|
|
},
|
|
{
|
|
"coordinates": [1238, 309],
|
|
"flag": "ir",
|
|
"name": "Iran"
|
|
},
|
|
{
|
|
"coordinates": [1178, 351],
|
|
"flag": "sa",
|
|
"name": "Saudi Arabia"
|
|
},
|
|
{
|
|
"coordinates": [1679, 657],
|
|
"flag": "au",
|
|
"name": "Australia"
|
|
},
|
|
{
|
|
"coordinates": [1890, 775],
|
|
"flag": "nz",
|
|
"name": "New Zealand"
|
|
},
|
|
{
|
|
"coordinates": [957, 295],
|
|
"flag": "dz",
|
|
"name": "Algeria"
|
|
},
|
|
{
|
|
"coordinates": [1024, 340],
|
|
"flag": "ly",
|
|
"name": "Libya"
|
|
},
|
|
{
|
|
"coordinates": [1094, 340],
|
|
"flag": "eg",
|
|
"name": "Egypt"
|
|
},
|
|
{
|
|
"coordinates": [956, 389],
|
|
"flag": "ne",
|
|
"name": "Niger"
|
|
},
|
|
{
|
|
"coordinates": [1101, 400],
|
|
"flag": "sd",
|
|
"name": "Sudan"
|
|
},
|
|
{
|
|
"coordinates": [1051, 513],
|
|
"flag": "cd",
|
|
"name": "DR Congo"
|
|
},
|
|
{
|
|
"coordinates": [1153, 451],
|
|
"flag": "et",
|
|
"name": "Ethiopia"
|
|
},
|
|
{
|
|
"coordinates": [1075, 707],
|
|
"flag": "za",
|
|
"name": "South Africa"
|
|
},
|
|
{
|
|
"coordinates": [1194, 627],
|
|
"flag": "mg",
|
|
"name": "Madagascar"
|
|
},
|
|
{
|
|
"coordinates": [1036, 420],
|
|
"flag": "td",
|
|
"name": "Chad"
|
|
},
|
|
{
|
|
"coordinates": [1039, 646],
|
|
"flag": "na",
|
|
"name": "Namibia"
|
|
},
|
|
{
|
|
"coordinates": [1632, 465],
|
|
"flag": "ph",
|
|
"name": "Philippines"
|
|
},
|
|
{
|
|
"coordinates": [1502, 415],
|
|
"flag": "th",
|
|
"name": "Thailand"
|
|
},
|
|
{
|
|
"coordinates": [1610, 364],
|
|
"flag": "tw",
|
|
"name": "Taiwan"
|
|
},
|
|
{
|
|
"coordinates": [1710, 290],
|
|
"flag": "jp",
|
|
"name": "Japan"
|
|
},
|
|
{
|
|
"coordinates": [1626, 118],
|
|
"flag": "Siberia",
|
|
"name": "Siberia"
|
|
},
|
|
{
|
|
"coordinates": [422, 95],
|
|
"flag": "Nunavut",
|
|
"name": "Nunavut"
|
|
},
|
|
{
|
|
"coordinates": [419, 975],
|
|
"flag": "aq",
|
|
"name": "West Antarctica"
|
|
},
|
|
{
|
|
"coordinates": [516, 567],
|
|
"flag": "pe",
|
|
"name": "Peru"
|
|
},
|
|
{
|
|
"coordinates": [1097, 598],
|
|
"flag": "zm",
|
|
"name": "Zambia"
|
|
},
|
|
{
|
|
"coordinates": [1067, 168],
|
|
"flag": "lv",
|
|
"name": "Latvia"
|
|
},
|
|
{
|
|
"coordinates": [1419, 338],
|
|
"flag": "bt",
|
|
"name": "Bhutan"
|
|
},
|
|
{
|
|
"coordinates": [1511, 524],
|
|
"flag": "id",
|
|
"name": "Indonesia"
|
|
},
|
|
{
|
|
"coordinates": [1809, 977],
|
|
"flag": "aq",
|
|
"name": "East Antarctica"
|
|
},
|
|
{
|
|
"coordinates": [1255, 382],
|
|
"flag": "om",
|
|
"name": "Oman"
|
|
},
|
|
{
|
|
"coordinates": [886, 327],
|
|
"flag": "ma",
|
|
"name": "Morocco"
|
|
},
|
|
{
|
|
"coordinates": [626, 704],
|
|
"flag": "uy",
|
|
"name": "Uruguay"
|
|
},
|
|
{
|
|
"coordinates": [581, 620],
|
|
"flag": "bo",
|
|
"name": "Bolivia"
|
|
},
|
|
{
|
|
"coordinates": [95, 115],
|
|
"flag": "Alaska",
|
|
"name": "Alaska"
|
|
},
|
|
{
|
|
"coordinates": [243, 131],
|
|
"flag": "Yukon",
|
|
"name": "Yukon"
|
|
},
|
|
{
|
|
"coordinates": [264, 276],
|
|
"flag": "California",
|
|
"name": "California"
|
|
},
|
|
{
|
|
"coordinates": [371, 299],
|
|
"flag": "Texas",
|
|
"name": "Texas"
|
|
},
|
|
{
|
|
"coordinates": [532, 191],
|
|
"flag": "Quebec",
|
|
"name": "Quebec"
|
|
},
|
|
{
|
|
"coordinates": [932, 476],
|
|
"flag": "bj",
|
|
"name": "Benin"
|
|
},
|
|
{
|
|
"coordinates": [845, 425],
|
|
"flag": "sn",
|
|
"name": "Senegal"
|
|
},
|
|
{
|
|
"coordinates": [1152, 522],
|
|
"flag": "ke",
|
|
"name": "Kenya"
|
|
},
|
|
{
|
|
"coordinates": [1320, 282],
|
|
"flag": "pk",
|
|
"name": "Pakistan"
|
|
},
|
|
{
|
|
"coordinates": [1384, 466],
|
|
"flag": "lk",
|
|
"name": "Sri Lanka"
|
|
}
|
|
],
|
|
"translation_key": "map.world"
|
|
}
|