feat: tactical icons, follow-camera orbit, and ship info panel

This commit is contained in:
2026-03-18 22:45:33 -04:00
parent f98c47a8a7
commit aa4a6930ba
17 changed files with 154 additions and 118 deletions

View File

@@ -46,7 +46,18 @@ export function describeHoverLabel(world: WorldState | undefined, item: Selectab
}
if (item.kind === "ship") {
return world.ships.get(item.id)?.label ?? item.id;
const ship = world.ships.get(item.id);
if (!ship) {
return item.id;
}
const lines = [
ship.label,
`Behavior ${describeShipBehavior(ship)}`,
`State ${describeShipState(world, ship)}`,
`Order ${describeShipOrder(ship)}`,
];
return lines.join("\n");
}
if (item.kind === "station") {
@@ -373,6 +384,27 @@ export function describeShipObjective(objective: string): string {
}
}
export function describeShipBehavior(ship: ShipSnapshot): string {
return ship.behaviorPhase
? `${ship.defaultBehaviorKind} · ${ship.behaviorPhase}`
: ship.defaultBehaviorKind;
}
export function describeShipOrder(ship: ShipSnapshot): string {
const orderParts: string[] = [];
if (ship.orderKind) {
orderParts.push(ship.orderKind);
}
if (ship.commanderObjective) {
orderParts.push(describeShipObjective(ship.commanderObjective));
}
if (orderParts.length > 0) {
return orderParts.join(" · ");
}
return describeControllerTask(ship.controllerTaskKind);
}
export function describeShipCurrentAction(ship: ShipSnapshot): { label: string; progress: number } | undefined {
if (!ship.currentAction) {
return undefined;