Auto-select involved unit on snap-pause events (sub-issue 22-3) #26
Labels
No labels
blocked:needs-attention
blocked:needs-decision
blocked:needs-decompose
blocked:needs-design
blocked:needs-triage
blocked:unclassified
bug
documentation
enhancement
gsd-spec
in-progress
needs-decompose
priority:high
priority:low
priority:medium
quickfix
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/cybertactics#26
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent-Issue: #22
Sub-issue 22-3 — focus-snap event doesn't show which unit the event is about
snapPause()(web/js/game.js:545) setsG.focusand writes a log line butdoes not select the involved unit. After the snap-pause the player sees a
circle pulse but the SELECTED panel still shows whoever was selected
before the event.
For "squad wounded" / "unit down" / "order failed" events the involved unit
should become
G.selectedautomatically so the SELECTED panel updates. Forhostile-contact snaps, the spotted enemy should be selected.
Fix
At each
snapPause(...)call site inweb/js/game.js, also setG.selected = <involved-unit>so the SELECTED panel updates on the nextupdateUI()tick. Look at every call tosnapPauseand confirm a unit isin scope; for events where the involved unit is
null(e.g. a phasetransition), leave
G.selectedunchanged.File(s)
web/js/game.js—snapPause()callersAcceptance
G.selectedunchanged
make cipassesRefs
web/js/game.js:545(snapPause)Closed via triage-runner on commit
7b84793(push 18ced82..7b84793).snapPause(x,y,msg,kind) extended with optional 5th arg
sel; when set it becomes G.selected so the SELECTED panel updates on the next updateUI() tick. snapPause itself stays backwards-compatible.Updated call sites (5):
make test: all 7 smoke scripts PASS.