Fix ShipWindow selection interactions

This commit is contained in:
2026-03-12 11:18:26 -04:00
parent 9db53f1b48
commit 7e41274620

View File

@@ -102,6 +102,7 @@ export class GameApp {
private readonly fleetWindowTitleEl: HTMLHeadingElement;
private readonly debugWindowEl: HTMLDivElement;
private readonly sessionActionsEl: HTMLDivElement;
private lastShipWindowMarkup = "";
private universe: UniverseDefinition;
constructor(container: HTMLElement) {
@@ -2123,7 +2124,11 @@ export class GameApp {
this.ordersEl.dataset.mode = this.selectedStation ? "station" : this.selection.length > 0 ? "ships" : "none";
this.fleetWindowEl.dataset.open = this.windowState["fleet-command"] ? "true" : "false";
this.fleetWindowTitleEl.textContent = "Ships";
this.fleetWindowBodyEl.innerHTML = getShipWindowMarkup(this.ships, this.selection);
const shipWindowMarkup = getShipWindowMarkup(this.ships, this.selection);
if (shipWindowMarkup !== this.lastShipWindowMarkup) {
this.fleetWindowBodyEl.innerHTML = shipWindowMarkup;
this.lastShipWindowMarkup = shipWindowMarkup;
}
this.debugWindowEl.dataset.open = this.windowState.debug ? "true" : "false";
}