map_vision.py: marker shape test only matched diamonds, so friendly
(rectangle) markers could never be detected regardless of color match.
diamonds() now takes a per-side ideal shape (diamond for hostile, full
rectangle for friendly) with fill-ratio bands measured off real markers.
Merged tests/fixtures/map_shots/more/ into the main fixture set: 2
screenshots that solve fine (now 15.png/16.png, with hand-transcribed
ground truth) and 8 that are too low native resolution for the label
reader (same class as the existing 12.png) into too_hard/ as
17.png-24.png, with an explanatory README entry. Updated map_vision.py's
docstring numbers (9/12 solve, 104/131 points correct) to match.
TargetType: expanded from 11 to 44 members to cover every icon in
assets/icons/targets/{enemy,friendly}/, including 7 friendly-only types
(King, Police, General, Hospital, Fort, Civil-Military, Mechanized
Anti-Tank) with no enemy equivalent. UNKNOWN/ENEMY stay icon-less by
design (both are literal words the game's OCR'd text uses, confirmed via
ocr.py's _TYPE_BY_SHORT, so neither can be dropped without breaking real
parsing) and draw the same plain-dot fallback the map itself uses.
icons.py: collapsed the icon lookup into one canonical table
(_TARGET_ICON: TargetType -> (enemy_basename, friendly_basename), one
explicit row per type) instead of a basename table plus two exception
dicts layered on top -- with a startup assertion that every TargetType
has a row. Added build_target_type_grid(), an icon-grid picker (icon +
name, same idea as the existing Shell picker) that replaces the old
plain-text dropdown/list everywhere a type is chosen, and only offers
types the given side actually has real art for.
coord_dialog.py: Add/Edit Target and Add Ally now use the icon grid
instead of Adw.ComboRow. Fixed a resulting horizontal-scroll bug (an
unbreakable long word was blowing out cell width) and locked the
coordinate pickers back to 5 columns.
app.py: right-click quick-add now offers Spotter/RP alongside
Target/Ally/Strike, opens a real modal (not a Popover, which turned out
unreliable for a wide multi-row grid) to ask for a type instead of
silently defaulting to UNKNOWN, and doesn't repeat the coordinate on
every row. The type grid listens for "clicked" rather than "toggled" --
a grouped ToggleButton doesn't emit "toggled" when you click the one
that's already active, which meant confirming the pre-selected default
type silently did nothing.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
739 lines
7.7 KiB
JSON
739 lines
7.7 KiB
JSON
{
|
|
"_comment": [
|
|
"Ground truth for the map-vision fixtures, transcribed by hand from the",
|
|
"screenshots. Each entry is [cell_label, x, y] in NATIVE pixel coordinates",
|
|
"of the corresponding file in map_shots/, where (x, y) is roughly the",
|
|
"centre of the drawn cell label glyphs.",
|
|
"",
|
|
"The invariant being asserted is simply: the pixel (x, y) lies inside the",
|
|
"map cell named by cell_label. That is enough to catch every failure mode",
|
|
"seen so far (wrong lattice scale, wrong integer offset, badly misfitted",
|
|
"homography) without needing sub-pixel corner annotation.",
|
|
"",
|
|
"Positions were read off a ruler overlay by eye, so treat them as accurate",
|
|
"to roughly +/-15 native px. The cell IDENTITIES are exact.",
|
|
"",
|
|
"Game UI constant, useful for the estimator: a cell's label is drawn with",
|
|
"about 9% of the cell size as padding from the cell's left edge and 6% from",
|
|
"its top edge, so label_top_left - (0.09, 0.06) * cell_size lands on the",
|
|
"cell's top-left corner."
|
|
],
|
|
"01.png": [
|
|
[
|
|
"G10",
|
|
899,
|
|
294
|
|
],
|
|
[
|
|
"H10",
|
|
996,
|
|
294
|
|
],
|
|
[
|
|
"I10",
|
|
1083,
|
|
294
|
|
],
|
|
[
|
|
"J10",
|
|
1168,
|
|
294
|
|
],
|
|
[
|
|
"K10",
|
|
1270,
|
|
294
|
|
],
|
|
[
|
|
"L10",
|
|
1355,
|
|
294
|
|
],
|
|
[
|
|
"M10",
|
|
1446,
|
|
294
|
|
],
|
|
[
|
|
"N10",
|
|
1537,
|
|
294
|
|
],
|
|
[
|
|
"O10",
|
|
1628,
|
|
294
|
|
],
|
|
[
|
|
"P10",
|
|
1716,
|
|
294
|
|
],
|
|
[
|
|
"G9",
|
|
882,
|
|
366
|
|
],
|
|
[
|
|
"I9",
|
|
1072,
|
|
366
|
|
],
|
|
[
|
|
"K9",
|
|
1266,
|
|
366
|
|
],
|
|
[
|
|
"M9",
|
|
1456,
|
|
366
|
|
],
|
|
[
|
|
"O9",
|
|
1650,
|
|
366
|
|
],
|
|
[
|
|
"H8",
|
|
965,
|
|
445
|
|
],
|
|
[
|
|
"J8",
|
|
1168,
|
|
445
|
|
],
|
|
[
|
|
"L8",
|
|
1370,
|
|
445
|
|
],
|
|
[
|
|
"N8",
|
|
1572,
|
|
445
|
|
],
|
|
[
|
|
"H7",
|
|
953,
|
|
536
|
|
],
|
|
[
|
|
"J7",
|
|
1166,
|
|
536
|
|
],
|
|
[
|
|
"L7",
|
|
1379,
|
|
536
|
|
],
|
|
[
|
|
"N7",
|
|
1592,
|
|
536
|
|
],
|
|
[
|
|
"H6",
|
|
935,
|
|
637
|
|
],
|
|
[
|
|
"J6",
|
|
1166,
|
|
637
|
|
],
|
|
[
|
|
"L6",
|
|
1391,
|
|
637
|
|
],
|
|
[
|
|
"N6",
|
|
1619,
|
|
637
|
|
]
|
|
],
|
|
"02.png": [
|
|
[
|
|
"I9",
|
|
54,
|
|
28
|
|
],
|
|
[
|
|
"J9",
|
|
329,
|
|
28
|
|
],
|
|
[
|
|
"K9",
|
|
608,
|
|
30
|
|
],
|
|
[
|
|
"L9",
|
|
880,
|
|
28
|
|
],
|
|
[
|
|
"M9",
|
|
1155,
|
|
28
|
|
],
|
|
[
|
|
"I8",
|
|
37,
|
|
257
|
|
],
|
|
[
|
|
"J8",
|
|
320,
|
|
257
|
|
],
|
|
[
|
|
"K8",
|
|
620,
|
|
257
|
|
],
|
|
[
|
|
"L8",
|
|
902,
|
|
257
|
|
],
|
|
[
|
|
"M8",
|
|
1197,
|
|
257
|
|
],
|
|
[
|
|
"I7",
|
|
11,
|
|
517
|
|
],
|
|
[
|
|
"J7",
|
|
316,
|
|
517
|
|
],
|
|
[
|
|
"K7",
|
|
626,
|
|
517
|
|
],
|
|
[
|
|
"L7",
|
|
936,
|
|
517
|
|
],
|
|
[
|
|
"M7",
|
|
1248,
|
|
517
|
|
],
|
|
[
|
|
"J6",
|
|
313,
|
|
805
|
|
],
|
|
[
|
|
"K6",
|
|
638,
|
|
805
|
|
],
|
|
[
|
|
"L6",
|
|
968,
|
|
805
|
|
],
|
|
[
|
|
"M6",
|
|
1295,
|
|
805
|
|
]
|
|
],
|
|
"03.png": [
|
|
[
|
|
"H8",
|
|
224,
|
|
229
|
|
],
|
|
[
|
|
"I8",
|
|
856,
|
|
229
|
|
],
|
|
[
|
|
"J8",
|
|
1496,
|
|
229
|
|
],
|
|
[
|
|
"K8",
|
|
2136,
|
|
229
|
|
],
|
|
[
|
|
"H7",
|
|
216,
|
|
853
|
|
],
|
|
[
|
|
"I7",
|
|
896,
|
|
853
|
|
],
|
|
[
|
|
"J7",
|
|
1555,
|
|
853
|
|
],
|
|
[
|
|
"K7",
|
|
2224,
|
|
853
|
|
]
|
|
],
|
|
"04.png": [
|
|
[
|
|
"N8",
|
|
243,
|
|
180
|
|
],
|
|
[
|
|
"O8",
|
|
1119,
|
|
180
|
|
],
|
|
[
|
|
"P8",
|
|
1996,
|
|
180
|
|
],
|
|
[
|
|
"N7",
|
|
232,
|
|
1038
|
|
],
|
|
[
|
|
"O7",
|
|
1135,
|
|
1038
|
|
],
|
|
[
|
|
"P7",
|
|
2051,
|
|
1038
|
|
]
|
|
],
|
|
"05.png": [
|
|
[
|
|
"M3",
|
|
261,
|
|
213
|
|
],
|
|
[
|
|
"N3",
|
|
1160,
|
|
213
|
|
]
|
|
],
|
|
"07.png": [
|
|
[
|
|
"J8",
|
|
460,
|
|
285
|
|
],
|
|
[
|
|
"K8",
|
|
1221,
|
|
285
|
|
],
|
|
[
|
|
"L8",
|
|
1973,
|
|
285
|
|
],
|
|
[
|
|
"J7",
|
|
456,
|
|
1036
|
|
],
|
|
[
|
|
"K7",
|
|
1256,
|
|
1036
|
|
],
|
|
[
|
|
"L7",
|
|
2053,
|
|
1036
|
|
]
|
|
],
|
|
"08.png": [
|
|
[
|
|
"L8",
|
|
184,
|
|
417
|
|
],
|
|
[
|
|
"M8",
|
|
1085,
|
|
417
|
|
],
|
|
[
|
|
"N8",
|
|
1983,
|
|
417
|
|
],
|
|
[
|
|
"L7",
|
|
176,
|
|
1341
|
|
],
|
|
[
|
|
"M7",
|
|
1121,
|
|
1341
|
|
]
|
|
],
|
|
"09.png": [
|
|
[
|
|
"O9",
|
|
1348,
|
|
180
|
|
],
|
|
[
|
|
"P9",
|
|
1520,
|
|
180
|
|
],
|
|
[
|
|
"Q9",
|
|
1692,
|
|
180
|
|
],
|
|
[
|
|
"M8",
|
|
993,
|
|
336
|
|
],
|
|
[
|
|
"N8",
|
|
1172,
|
|
336
|
|
],
|
|
[
|
|
"O8",
|
|
1352,
|
|
336
|
|
],
|
|
[
|
|
"P8",
|
|
1536,
|
|
336
|
|
],
|
|
[
|
|
"Q8",
|
|
1718,
|
|
336
|
|
],
|
|
[
|
|
"M7",
|
|
982,
|
|
513
|
|
],
|
|
[
|
|
"N7",
|
|
1175,
|
|
513
|
|
],
|
|
[
|
|
"O7",
|
|
1366,
|
|
513
|
|
],
|
|
[
|
|
"P7",
|
|
1557,
|
|
513
|
|
],
|
|
[
|
|
"Q7",
|
|
1748,
|
|
513
|
|
]
|
|
],
|
|
"11.png": [
|
|
[
|
|
"J9",
|
|
174,
|
|
133
|
|
],
|
|
[
|
|
"K9",
|
|
996,
|
|
133
|
|
],
|
|
[
|
|
"L9",
|
|
1803,
|
|
133
|
|
],
|
|
[
|
|
"J8",
|
|
159,
|
|
956
|
|
],
|
|
[
|
|
"K8",
|
|
999,
|
|
956
|
|
],
|
|
[
|
|
"L8",
|
|
1832,
|
|
956
|
|
]
|
|
],
|
|
"13.png": [
|
|
[
|
|
"L4",
|
|
182,
|
|
213
|
|
],
|
|
[
|
|
"M4",
|
|
509,
|
|
197
|
|
],
|
|
[
|
|
"O4",
|
|
1129,
|
|
157
|
|
],
|
|
[
|
|
"P4",
|
|
1425,
|
|
133
|
|
],
|
|
[
|
|
"Q4",
|
|
1711,
|
|
117
|
|
],
|
|
[
|
|
"L3",
|
|
146,
|
|
441
|
|
],
|
|
[
|
|
"M3",
|
|
511,
|
|
412
|
|
],
|
|
[
|
|
"N3",
|
|
863,
|
|
388
|
|
],
|
|
[
|
|
"O3",
|
|
1209,
|
|
359
|
|
],
|
|
[
|
|
"P3",
|
|
1538,
|
|
329
|
|
],
|
|
[
|
|
"L2",
|
|
106,
|
|
724
|
|
],
|
|
[
|
|
"M2",
|
|
518,
|
|
687
|
|
],
|
|
[
|
|
"N2",
|
|
914,
|
|
651
|
|
],
|
|
[
|
|
"O2",
|
|
1304,
|
|
615
|
|
],
|
|
[
|
|
"P2",
|
|
1664,
|
|
580
|
|
],
|
|
[
|
|
"L1",
|
|
37,
|
|
1100
|
|
],
|
|
[
|
|
"M1",
|
|
521,
|
|
1053
|
|
],
|
|
[
|
|
"N1",
|
|
985,
|
|
1005
|
|
],
|
|
[
|
|
"O1",
|
|
1428,
|
|
953
|
|
],
|
|
[
|
|
"P1",
|
|
1852,
|
|
910
|
|
]
|
|
],
|
|
"_excluded": {
|
|
"note": "moved to map_shots/too_hard/, see its README",
|
|
"06.png": [
|
|
[
|
|
"L5",
|
|
542,
|
|
616
|
|
]
|
|
],
|
|
"12.png": [
|
|
[
|
|
"M3",
|
|
151,
|
|
160
|
|
],
|
|
[
|
|
"N3",
|
|
535,
|
|
136
|
|
],
|
|
[
|
|
"M2",
|
|
163,
|
|
469
|
|
],
|
|
[
|
|
"N2",
|
|
580,
|
|
440
|
|
]
|
|
],
|
|
"14.png": [
|
|
[
|
|
"J7",
|
|
1557,
|
|
1659
|
|
]
|
|
]
|
|
},
|
|
"15.png": [
|
|
[
|
|
"N8",
|
|
140,
|
|
859
|
|
],
|
|
[
|
|
"N9",
|
|
153,
|
|
2
|
|
],
|
|
[
|
|
"O8",
|
|
1042,
|
|
859
|
|
],
|
|
[
|
|
"P8",
|
|
1949,
|
|
859
|
|
]
|
|
],
|
|
"16.png": [
|
|
[
|
|
"J5",
|
|
62,
|
|
573
|
|
],
|
|
[
|
|
"J6",
|
|
80,
|
|
289
|
|
],
|
|
[
|
|
"J7",
|
|
97,
|
|
31
|
|
],
|
|
[
|
|
"K5",
|
|
370,
|
|
572
|
|
],
|
|
[
|
|
"K6",
|
|
374,
|
|
289
|
|
],
|
|
[
|
|
"K7",
|
|
377,
|
|
31
|
|
],
|
|
[
|
|
"L5",
|
|
678,
|
|
572
|
|
],
|
|
[
|
|
"L6",
|
|
667,
|
|
289
|
|
],
|
|
[
|
|
"L7",
|
|
657,
|
|
31
|
|
],
|
|
[
|
|
"M5",
|
|
985,
|
|
572
|
|
],
|
|
[
|
|
"M6",
|
|
959,
|
|
288
|
|
],
|
|
[
|
|
"M7",
|
|
936,
|
|
31
|
|
],
|
|
[
|
|
"N5",
|
|
1293,
|
|
571
|
|
],
|
|
[
|
|
"N6",
|
|
1252,
|
|
288
|
|
],
|
|
[
|
|
"N7",
|
|
1215,
|
|
31
|
|
]
|
|
]
|
|
} |