Fix silent proposal-popover repaint bug; add underground target marker
"Accept as..." (proposal type-picker) and "Change type" (entity-edit) opened to a visibly empty/unchanged popover with no traceback: swapping an already-open Popover's child and re-popup()ing it reported the right size internally but the compositor never repainted the reused surface. Confirmed live via temporary debug instrumentation, not guessed. Fixed by popping the old popover down and opening a genuinely new one at the same anchor point instead of resizing in place. Also adds a Target.underground_tier (1-3) marker: a "Mark underground" entry in the entity-edit popover, rendered as the game's own Armor-tier additive badge stacked directly on the unit icon. The badge is scaled/positioned off its real opaque content (PIL bbox), not its PNG canvas, since the additive art carries a lot of off-center transparent padding; and overlaps down into the icon by a fixed pixel amount, since both shapes taper to a point at the seam and exact bbox-touching still read as a visible gap. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -119,6 +119,35 @@ Status legend: [x] fixed+tested, [~] partially addressed, [ ] open/needs input
|
||||
accept attempt after that silently died before the ally/target
|
||||
ever got added, popover already closed by the time it happened.
|
||||
Fixed there; not a separate bug.
|
||||
- [x] "Accept as…" (the type-picker submenu on a proposal, and "Change
|
||||
type" on an already-placed entity) opening to a visibly empty/
|
||||
unchanged popover. This one left no traceback at all -- confirmed
|
||||
live with temporary debug prints that the button's `clicked` signal
|
||||
fires, the icon grid builds successfully (all N types), and
|
||||
`Popover.set_child()` on the already-open outer popover reports the
|
||||
right `visible=True`/width/height afterward... but the compositor
|
||||
never actually repaints that reused surface, so nothing new ever
|
||||
appeared on screen. Fixed by not resizing the existing open
|
||||
popover at all: popping it down and opening a genuinely new one
|
||||
(fresh native surface) at the same anchor point instead. Same fix
|
||||
applied to both call sites (`_open_proposal_menu`'s `show_type`,
|
||||
`_open_entity_menu`'s `show_type`, the latter refactored to share
|
||||
the same `_reopen_with()` helper).
|
||||
- [x] New: mark a Target as underground, at a hardening tier (1-3),
|
||||
rendered as the game's own Armor-tier additive badge stacked on
|
||||
the icon. `Target.underground_tier: int | None`, a "Mark
|
||||
underground" entry in the entity-edit popover (tier picker reusing
|
||||
the same fresh-popover fix above), and `GridCanvas` draws the
|
||||
badge above the marker's icon, overlapping down into it by
|
||||
`_ADDITIVE_OVERLAP_PX` -- both the diamond icon's top corner and
|
||||
the badge's bottom are tapered to a near-point, not a flat edge,
|
||||
so bbox-exact touching still read as a gap; a real pixel overlap
|
||||
is what actually looks contiguous (confirmed against the game's
|
||||
own stacked-badge screenshots). Badge is scaled/positioned off the
|
||||
art's real opaque content (PIL `getbbox()`), not its PNG canvas --
|
||||
the additive files carry a lot of off-center transparent padding
|
||||
that made the badge look tiny and floating if sized off the raw
|
||||
canvas.
|
||||
|
||||
## Needs more scope / your input before I keep going
|
||||
|
||||
|
||||
Reference in New Issue
Block a user