Fix ally marker detection; expand TargetType icons and pickers
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>
|
After Width: | Height: | Size: 3.2 MiB |
|
After Width: | Height: | Size: 1.7 MiB |
|
After Width: | Height: | Size: 791 KiB |
|
After Width: | Height: | Size: 1.2 MiB |
|
After Width: | Height: | Size: 1.5 MiB |
|
After Width: | Height: | Size: 2.4 MiB |
|
After Width: | Height: | Size: 2.1 MiB |
|
After Width: | Height: | Size: 2.0 MiB |
|
After Width: | Height: | Size: 570 KiB |
|
After Width: | Height: | Size: 2.0 MiB |
@@ -10,5 +10,14 @@ them would mean guessing:
|
||||
- `12.png` — 710x594 native. Too few pixels per cell for the label glyphs to
|
||||
correlate; measured, the best label score stays ~0.44 at every working
|
||||
resolution, so it is not a tuning problem.
|
||||
- `17.png`-`24.png` — same class as `12.png`: native resolution too low (605-1789px
|
||||
wide, vs. 1392-2400px for the fixtures that do solve) for the label glyphs to
|
||||
correlate once warped to the canonical cell size; measured, the best label
|
||||
score stays ~0.45-0.52 at every working resolution tried (including the
|
||||
2400px retry pass), well short of LABEL_ACCEPT (0.62) and inside the
|
||||
documented "wrong read" band (0.40-0.56), not close enough to call it a
|
||||
tuning problem. Two of the ten screenshots this batch came from (now
|
||||
`15.png`/`16.png` in the main set) were high enough resolution to solve --
|
||||
the same camera distance/game zoom just wasn't consistent across the batch.
|
||||
|
||||
"Too zoomed in" and "too low resolution" are legitimate hard rejections.
|
||||
|
||||
@@ -636,5 +636,104 @@
|
||||
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
|
||||
]
|
||||
]
|
||||
}
|
||||