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:
@@ -50,6 +50,7 @@ import type { LinePrim, PointPrim, PrimitiveID, Style } from "./world";
|
||||
*/
|
||||
export const SHIP_GROUP_ID_OFFSETS = {
|
||||
local: 100_000_000,
|
||||
localLine: 150_000_000,
|
||||
other: 200_000_000,
|
||||
incoming: 300_000_000,
|
||||
incomingLine: 350_000_000,
|
||||
@@ -62,6 +63,13 @@ const STYLE_LOCAL_GROUP: Style = {
|
||||
pointRadiusPx: 3,
|
||||
};
|
||||
|
||||
const STYLE_LOCAL_INSPACE_LINE: Style = {
|
||||
strokeColor: 0xfff176,
|
||||
strokeAlpha: 0.7,
|
||||
strokeWidthPx: 1,
|
||||
strokeDashPx: 4,
|
||||
};
|
||||
|
||||
const STYLE_OTHER_GROUP: Style = {
|
||||
fillColor: 0xff6f40,
|
||||
fillAlpha: 0.9,
|
||||
@@ -93,6 +101,7 @@ const STYLE_UNIDENTIFIED_GROUP: Style = {
|
||||
// so a click on the dashed segment never "wins" over the clickable
|
||||
// point at the interpolated position.
|
||||
const PRIORITY_LOCAL = 5;
|
||||
const PRIORITY_LOCAL_LINE = 0;
|
||||
const PRIORITY_OTHER = 5;
|
||||
const PRIORITY_INCOMING_POINT = 6;
|
||||
const PRIORITY_INCOMING_LINE = 0;
|
||||
@@ -120,6 +129,29 @@ export function shipGroupsToPrimitives(report: GameReport): ShipGroupPrimitives
|
||||
const id = SHIP_GROUP_ID_OFFSETS.local + i;
|
||||
primitives.push(makePoint(id, pos.x, pos.y, PRIORITY_LOCAL, STYLE_LOCAL_GROUP));
|
||||
lookup.set(id, { variant: "local", id: group.id });
|
||||
// Yellow dashed track from the origin planet to the destination
|
||||
// planet. The colour matches the in-space group point so the
|
||||
// player can read both as one entity at a glance. Wrap-aware
|
||||
// like the incoming-line: we unwrap `destination` relative to
|
||||
// `origin`, drawing the segment in a single tile, and PixiJS
|
||||
// repeats the world in torus mode.
|
||||
const origin = planetIndex.get(group.origin!);
|
||||
const destination = planetIndex.get(group.destination);
|
||||
if (origin !== undefined && destination !== undefined) {
|
||||
const dx = torusShortestDelta(origin.x, destination.x, w);
|
||||
const dy = torusShortestDelta(origin.y, destination.y, h);
|
||||
primitives.push({
|
||||
kind: "line",
|
||||
id: SHIP_GROUP_ID_OFFSETS.localLine + i,
|
||||
priority: PRIORITY_LOCAL_LINE,
|
||||
style: STYLE_LOCAL_INSPACE_LINE,
|
||||
hitSlopPx: 0,
|
||||
x1: origin.x,
|
||||
y1: origin.y,
|
||||
x2: origin.x + dx,
|
||||
y2: origin.y + dy,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
for (let i = 0; i < report.otherShipGroups.length; i++) {
|
||||
|
||||
Reference in New Issue
Block a user