ui/phase-20: lock after Send + dashed tracks for in-flight & pending sends
Send joins Modernize / Dismantle / Transfer as a lockable command: once any of the four lands in the draft for a group, every action button on its inspector is disabled with a "command pending" tooltip and the banner names the queued kind. Load / Unload / Split / Join Fleet stay non-locking — they stack legitimately on the engine side. Two dashed overlays now run alongside the cargo-route arrows: - Yellow dashed track for own in-space groups, drawn from the origin planet to the destination (matches the in-space point colour so eye reads both as one entity). - Green dashed track for every wire-valid sendShipGroup command in the order draft, drawn from the source group's orbit planet to the chosen destination. Disappears when the command is removed from the order tab, when the engine rejects it, or when the group has left orbit (in-space track replaces it). Both tracks are wrap-aware via torusShortestDelta and never participate in hit-test. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
@@ -92,33 +92,53 @@ every action with `ships are busy ({state})`. Per-action gates:
|
||||
in the same orbit (`fleet.go:135-137`); creating a new fleet
|
||||
always works.
|
||||
|
||||
## Destructive-command lock
|
||||
## State-changing-command lock
|
||||
|
||||
`Modernize`, `Dismantle`, and `Transfer` are *state-changing* at
|
||||
turn cutoff: the engine moves the group into `StateUpgrade`,
|
||||
removes it, or marks it `StateTransfer` respectively. Issuing a
|
||||
follow-up action against the same group during the same draft
|
||||
window would race the engine's pre-condition check, so the
|
||||
inspector locks the group as soon as one of the three commands
|
||||
lands in the draft for that `groupId`:
|
||||
`Send`, `Modernize`, `Dismantle`, and `Transfer` are
|
||||
*state-changing* at turn cutoff: the engine moves the group into
|
||||
`StateLaunched`, `StateUpgrade`, removes it, or marks it
|
||||
`StateTransfer` respectively. Issuing a follow-up action against
|
||||
the same group during the same draft window would race the
|
||||
engine's pre-condition check, so the inspector locks the group
|
||||
as soon as one of the four commands lands in the draft for that
|
||||
`groupId`:
|
||||
|
||||
- every action button on the group's inspector becomes disabled
|
||||
with the "an order is already queued" tooltip;
|
||||
- a banner above the buttons row names the queued command
|
||||
(modernize / dismantle / transfer) and tells the player to
|
||||
cancel it in the order list to issue something else;
|
||||
(send / modernize / dismantle / transfer) and tells the player
|
||||
to cancel it in the order list to issue something else;
|
||||
- removing the queued entry from the order tab releases the lock
|
||||
on the next render — the derivation watches `draft.commands`
|
||||
directly.
|
||||
|
||||
Send, Load, Unload, Split, and Join Fleet do not lock the group:
|
||||
Send is naturally followed by an out-of-orbit state at turn
|
||||
cutoff (the engine's busy check fires next turn anyway), and the
|
||||
other four can stack legitimately during the same window. The
|
||||
group continues to appear in the planet inspector's stationed-
|
||||
ship list while locked — the player can still navigate to the
|
||||
Load, Unload, Split, and Join Fleet do not lock the group: those
|
||||
four can stack legitimately during the same window. The group
|
||||
continues to appear in the planet inspector's stationed-ship
|
||||
list while locked — the player can still navigate to the
|
||||
inspector to read the state and find the order to cancel.
|
||||
|
||||
## Map overlays for in-flight and pending-Send groups
|
||||
|
||||
Two dashed-line overlays run on the same renderer layer as the
|
||||
cargo-route arrows:
|
||||
|
||||
- **Yellow dashed track** for own ship groups currently in
|
||||
hyperspace, drawn from the origin planet to the destination
|
||||
(matches the colour of the in-space group point so the eye
|
||||
reads both as one entity).
|
||||
- **Green dashed track** for every wire-valid `sendShipGroup`
|
||||
command in the order draft — drawn from the source group's
|
||||
orbit planet to the chosen destination. Disappears when the
|
||||
command is removed from the order tab, when the engine flips
|
||||
it `rejected` / `invalid`, or when the group has left orbit
|
||||
(the Send was applied and the in-space track replaces it).
|
||||
|
||||
Both tracks are wrap-aware via `torusShortestDelta` so a route
|
||||
across the seam takes the wrap. Neither participates in
|
||||
hit-test — the player still picks ship groups by clicking the
|
||||
group point, not the track.
|
||||
|
||||
## Modernize cost preview
|
||||
|
||||
The form's preview line calls
|
||||
|
||||
Reference in New Issue
Block a user