feat: simplifying the simulation

This commit is contained in:
2026-03-17 16:08:02 -04:00
parent 3234b628ea
commit d5d0a39244
20 changed files with 374 additions and 496 deletions

View File

@@ -196,10 +196,7 @@ export function updateDetailPanel(
return;
}
const parent = describeSelectionParent(selected);
const cargoUsed = ship.cargoItemId
? inventoryAmount(ship.inventory, ship.cargoItemId)
: 0;
const cargoLabel = ship.cargoItemId ?? "none";
const cargoUsed = ship.inventory.reduce((sum, e) => sum + e.amount, 0);
const shipState = describeShipState(world, ship);
const shipAction = describeShipCurrentAction(ship);
detailTitleEl.textContent = ship.label;
@@ -217,7 +214,7 @@ export function updateDetailPanel(
</div>
</div>
` : ""}
<p>Cargo ${cargoLabel} ${cargoUsed.toFixed(0)} / ${ship.cargoCapacity.toFixed(0)}</p>
<p>Cargo ${cargoUsed.toFixed(0)} / ${ship.cargoCapacity.toFixed(0)}</p>
<p>Inventory ${formatInventory(ship.inventory)}</p>
<p>Speed ${formatShipSpeed(ship)}</p>
<p>Camera ${cameraMode === "follow" && cameraTargetShipId === ship.id ? "camera-follow" : "tactical"}<br>Press C to toggle follow</p>