diff --git a/old-ui/package.json b/old-ui/package.json index f27bd239..4111169a 100644 --- a/old-ui/package.json +++ b/old-ui/package.json @@ -1,6 +1,6 @@ { "name": "@gaia-project/old-ui", - "version": "1.2.26", + "version": "1.2.27", "scripts": { "serve": "vite --port 5193", "build": "vite build", diff --git a/old-ui/src/components/PlayerInfo.vue b/old-ui/src/components/PlayerInfo.vue index a4ce7a96..b47703de 100644 --- a/old-ui/src/components/PlayerInfo.vue +++ b/old-ui/src/components/PlayerInfo.vue @@ -35,6 +35,7 @@ :faction="player.faction" :data="playerData" :height="height" + :reference-engine="engine" /> { for (let i = 1; i < sortedXs.length; i++) { expect(sortedXs[i] - sortedXs[i - 1]).to.equal(17); } - // the ship name is spelled out in the left tab: a first-letter hex badge + the rest of the name - expect(twilight.querySelector(".lost-fleet-ship__name-letter").textContent).to.equal("T"); - expect(twilight.querySelector(".lost-fleet-ship__name-rest").textContent).to.equal("WILIGHT"); + // The insignia is separate from the FULL name, never a replacement for its first letter. + expect(twilight.querySelector(".lost-fleet-ship__name-letter")).to.equal(null); + expect(twilight.querySelector(".spaceship-emblem").getAttribute("aria-label")).to.contain("Twilight"); + expect(twilight.querySelector(".lost-fleet-ship__name-rest").textContent).to.equal("TWILIGHT"); slots.forEach((slot) => { expect(slot.querySelector(".lost-fleet-ship__slot-ordinal")).to.equal(null); }); diff --git a/viewer/src/components/LostFleetShips.vue b/viewer/src/components/LostFleetShips.vue index 5ceb719b..4ef039c4 100644 --- a/viewer/src/components/LostFleetShips.vue +++ b/viewer/src/components/LostFleetShips.vue @@ -164,14 +164,12 @@ + the ship color. The insignia precedes the FULL name: replacing the old initial must not + remove the first letter from the visible title. The alternate UI owns its own template. --> - - {{ shipFirstLetter(ship) }} - {{ shipNameRest(ship) }} + + {{ shipHeaderName(ship) }} + + {{ label }} + + {{ + remaining + }} + + + + + + diff --git a/viewer/src/components/PlayerBoard/Info.spec.ts b/viewer/src/components/PlayerBoard/Info.spec.ts new file mode 100644 index 00000000..0a6fe6e8 --- /dev/null +++ b/viewer/src/components/PlayerBoard/Info.spec.ts @@ -0,0 +1,119 @@ +import Engine, { Building, Faction, GaiaHex, Planet } from "@gaia-project/engine"; +import { fireEvent, render } from "@testing-library/vue"; +import BootstrapVue from "bootstrap-vue"; +import { expect } from "chai"; +import Vue from "vue"; +import { MapModeType } from "../../data/actions"; +import { makeStore } from "../../store"; +import PlayerBoardInfo from "./Info.vue"; + +Vue.use(BootstrapVue); + +function setup(lostFleet = true, faction = Faction.Terrans) { + const engine = new Engine(["init 2 compact-board-stats", `p1 faction ${faction}`, "p2 faction xenos"], { lostFleet }); + const player = engine.players[0]; + const store = makeStore(); + store.commit("receiveData", engine); + return { engine, player, store, props: { player, faction: player.faction, data: player.data, height: 21.4 } }; +} + +function colony(sector: string, q: number) { + return new GaiaHex(q, 0, { sector, planet: Planet.Terra, player: 0, building: Building.Mine }); +} + +describe("PlayerBoardInfo Lost Fleet stats", () => { + it("preserves the base-game positions, sizes and comma spacing", () => { + const { props, store } = setup(false); + const { container } = render(PlayerBoardInfo, { props, store }); + expect(container.querySelector(".exploration-supply")).to.equal(null); + expect(container.querySelector('[data-board-stat="deep-space-sectors"]')).to.equal(null); + const satellites = container.querySelector('[data-board-stat="satellites"]'); + const federations = container.querySelector('[data-board-stat="federations"]'); + expect(satellites.getAttribute("transform")).to.equal("translate(15.2, 1.4)"); + expect(satellites.querySelector("text").textContent.trim()).to.equal("0, 25"); + expect(federations.getAttribute("transform")).to.equal("translate(15.2, 3.5)"); + expect(federations.querySelector("image").getAttribute("transform")).to.equal("scale(0.1)"); + expect(federations.querySelector("text").textContent.trim()).to.equal("0, 0"); + expect(container.querySelector('[data-board-stat="sectors"]').getAttribute("transform")).to.equal( + "translate(12.4, 3.5)" + ); + expect(container.querySelectorAll(".research-counter")[5].getAttribute("transform")).to.equal( + "translate(10.6,3.5) scale(1)" + ); + }); + + it("outlines research counters on Lost Fleet Lantids boards without changing base-game counters", () => { + for (const lostFleet of [false, true]) { + const { props, store } = setup(lostFleet, Faction.Lantids); + const { container } = render(PlayerBoardInfo, { props, store }); + const counters = container.querySelectorAll(".research-counter .research-tile"); + expect(counters).to.have.length(6); + for (const counter of Array.from(counters)) { + expect(counter.classList.contains("research-tile--outlined")).to.equal(lostFleet); + } + } + }); + + it("stacks shuttles above satellites and federations without an extra board row", () => { + const { props, store } = setup(); + const { container } = render(PlayerBoardInfo, { props, store }); + expect(container.querySelector(".exploration-supply").getAttribute("transform")).to.equal("translate(15.5, 0.65)"); + const satellites = container.querySelector('[data-board-stat="satellites"]'); + const federations = container.querySelector('[data-board-stat="federations"]'); + expect(satellites.getAttribute("transform")).to.equal("translate(15.5, 2.05)"); + expect(federations.getAttribute("transform")).to.equal("translate(15.5, 3.5)"); + expect(satellites.querySelector("text").textContent.trim()).to.equal("0,25"); + expect(federations.querySelector("text").textContent.trim()).to.equal("0,0"); + expect(federations.querySelector("image").getAttribute("transform")).to.equal("scale(0.075)"); + expect(container.querySelectorAll(".research-counter")[5].getAttribute("transform")).to.equal( + "translate(8.75,3.5) scale(1)" + ); + expect(container.querySelector(".board-info > rect").getAttribute("height")).to.equal("8"); + }); + + it("shows separate ordinary and Deep Space tile counts and keeps the combined sector shortcut", async () => { + const { props, store, player } = setup(); + player.data.occupied.push(colony("s1", 1), colony("s2", 2), ...[0, 1, 2].map((i) => colony(`DS11_${i}`, 3 + i))); + const { container } = render(PlayerBoardInfo, { props, store }); + const normal = container.querySelector('[data-board-stat="sectors"]'); + const deep = container.querySelector('[data-board-stat="deep-space-sectors"]'); + expect(normal.querySelector("text").textContent.trim()).to.equal("2"); + expect(deep.querySelector("text").textContent.trim()).to.equal("1"); + expect(deep.getAttribute("title")).to.contain("Deep Space sectors with a colonized planet"); + expect(deep.querySelectorAll("polygon")).to.have.length(3); + expect(deep.querySelector(".deep-space-sector--white")).not.to.equal(null); + await fireEvent.click(deep.querySelector("polygon")); + expect(store.getters.mapModes).to.deep.equal([{ type: MapModeType.sectors, player: 0 }]); + player.data.occupied.push(colony("DS12_0", 6)); + await Vue.nextTick(); + expect(deep.querySelector("text").textContent.trim()).to.equal("2"); + expect(normal.querySelector("text").textContent.trim()).to.equal("2"); + }); + + it("keeps a zero Deep Space count visible", () => { + const { props, store } = setup(); + const { container } = render(PlayerBoardInfo, { props, store }); + expect(container.querySelector('[data-board-stat="deep-space-sectors"] text').textContent.trim()).to.equal("0"); + }); + + it("uses the displayed reference engine for expansion visibility and shuttle limits", () => { + const { store } = setup(false); + const referenceEngine = new Engine( + [ + "init 4 info-reference", + "p1 faction terrans", + "p2 faction xenos", + "p3 faction firaks", + "p4 faction hadsch-hallas", + ], + { lostFleet: true } + ); + const player = referenceEngine.players[0]; + const { container } = render(PlayerBoardInfo, { + props: { player, faction: player.faction, data: player.data, referenceEngine, preview: true, height: 21.4 }, + store, + }); + expect(container.querySelector(".remaining-count").textContent.trim()).to.equal("3"); + expect(container.querySelector('[data-board-stat="deep-space-sectors"]')).not.to.equal(null); + }); +}); diff --git a/viewer/src/components/PlayerBoard/Info.vue b/viewer/src/components/PlayerBoard/Info.vue index 9f0a9d0d..fe4a7940 100644 --- a/viewer/src/components/PlayerBoard/Info.vue +++ b/viewer/src/components/PlayerBoard/Info.vue @@ -79,7 +79,13 @@ +{{ income("vp") }} - + + - {{ data.satellites + data.buildings.sp }}, {{ satellitesLeft }} + + {{ statPair(data.satellites + data.buildings.sp, satellitesLeft) }} - + - {{ sectors }} + {{ sectors }} + + + + {{ deepSpaceSectors }} @@ -117,12 +153,12 @@ width="22" x="-11" y="-8" - transform="scale(0.1)" + :transform="isLostFleet ? 'scale(0.075)' : 'scale(0.1)'" @click="toggleMapMode('federations')" style="cursor: pointer" /> - {{ player.fedValue }}, {{ player.structureValue - player.fedValue }} + + {{ statPair(player.fedValue, player.structureValue - player.fedValue) }} @@ -158,14 +194,15 @@ import Engine, { + Expansion, Faction, + hasExpansion, MAX_SATELLITES, Player, PlayerData, @@ -193,14 +232,18 @@ import { effectivePreviewPlayer } from "../../data/faction-preview"; import { factionName } from "../../data/factions"; import { researchColor, researchData } from "../../data/research"; import { showIncome } from "../../data/resources"; -import { leechNetwork, sectors } from "../../data/stats"; +import { deepSpaceSectors, leechNetwork, sectors } from "../../data/stats"; import type { CellStyle } from "../../graphics/colors"; +import DeepSpaceSector from "../Conditions/DeepSpaceSector.vue"; import Resource from "../Resource.vue"; import Undo from "../Resources/Undo.vue"; import VictoryPoint from "../Resources/VictoryPoint.vue"; +import ExplorationSupply from "./ExplorationSupply.vue"; @Component({ components: { + DeepSpaceSector, + ExplorationSupply, Resource, VictoryPoint, Undo, @@ -224,8 +267,19 @@ export default class PlayerBoardInfo extends Vue { @Prop({ default: false }) preview: boolean; + @Prop() + referenceEngine: Engine; + get engine(): Engine { - return this.$store.state.data; + return this.referenceEngine ?? this.$store.state.data; + } + + get isLostFleet(): boolean { + return hasExpansion(this.engine.expansions, Expansion.LostFleet); + } + + statPair(first: number, second: number): string { + return `${first},${this.isLostFleet ? "" : " "}${second}`; } get researchFields(): number { @@ -305,6 +359,10 @@ export default class PlayerBoardInfo extends Vue { return sectors(this.player); } + get deepSpaceSectors(): number { + return deepSpaceSectors(this.player); + } + get satellitesLeft(): number { return MAX_SATELLITES - this.data.satellites; } @@ -332,6 +390,14 @@ export default class PlayerBoardInfo extends Vue { text-anchor: middle; } +/* A thin edge separates matching track/faction colors (notably Science on Lantids). + Recent/current-round strokes below keep their stronger highlight styling. */ +.board-info.research-tile--outlined { + stroke: rgba(0, 0, 0, 0.45); + stroke-width: 0.6; + stroke-linejoin: round; +} + .board-info.research-tile.recent { stroke-width: 2; stroke: var(--recent); diff --git a/viewer/src/components/PlayerInfo.spec.ts b/viewer/src/components/PlayerInfo.spec.ts index 4a3ba512..e4ac9602 100644 --- a/viewer/src/components/PlayerInfo.spec.ts +++ b/viewer/src/components/PlayerInfo.spec.ts @@ -22,6 +22,25 @@ import { makeStore } from "../store"; import PlayerInfo from "./PlayerInfo.vue"; for (const component of [PlayerInfo, AlternatePlayerInfo]) { + it("fits Lost Fleet supplies and sector stats in the info panel without adding a row or moving actions", () => { + const engine = new Engine(["init 2 shuttle-layout", "p1 faction terrans", "p2 faction xenos"], { lostFleet: true }); + engine.players[0].data.gaiaformers = 3; + for (let i = 0; i < 7; i++) engine.players[0].loadEvent(new Event("=> 1q"), "test"); + const store = makeStore(); + store.commit("receiveData", engine); + const { container } = render(component, { props: { player: engine.players[0] }, store }); + const groups = container.querySelectorAll(".building-group"); + expect(groups[groups.length - 1].getAttribute("transform")).to.equal("translate(20, 1.2)"); + const supply = container.querySelector(".exploration-supply"); + expect(supply.getAttribute("transform")).to.equal("translate(15.5, 0.65)"); + expect(supply.closest(".board-info")).not.to.equal(null); + expect(container.querySelector('[data-board-stat="deep-space-sectors"]')).not.to.equal(null); + expect(supply.querySelector("rect, circle")).to.equal(null); + expect(supply.querySelectorAll(".shuttle-symbol")).to.have.length(1); + expect(supply.querySelectorAll(".remaining-count")).to.have.length(1); + expect(container.querySelector("[data-player-action]").getAttribute("y")).to.equal("17.4"); + expect(container.querySelector(".player-board").getAttribute("viewBox")).to.equal("-0.2 -0.5 38.5 24.7"); + }); it("shows the Automa faction board and always-visible cards without a human economy", () => { const engine = new Engine(["init 1 automa-panel", "p1 faction terrans", "p2 faction taklons"], { automaSeed: "test", diff --git a/viewer/src/components/PlayerInfo.vue b/viewer/src/components/PlayerInfo.vue index d58243d4..8271aed5 100644 --- a/viewer/src/components/PlayerInfo.vue +++ b/viewer/src/components/PlayerInfo.vue @@ -55,6 +55,7 @@ :faction="player.faction" :data="playerData" :height="height" + :reference-engine="engine" :preview="preview" /> @@ -143,7 +144,7 @@ - - - {{ lostFleetSpaceshipLabel }} + + + ({ components: { Planet, Building, + SpaceshipEmblem, }, }) export default class SpaceHex extends Vue { @@ -768,7 +757,7 @@ svg { } } - // The whole-hex ship-color fill (see template). `fill` is set per-ship inline via + // The alternate UI keeps whole-hex ship colors behind its initials. `fill` comes from // spaceshipColors; pointer-events off so it never intercepts the hex's own click. .lost-fleet-spaceship__hex { stroke: #172e62; diff --git a/viewer/src/components/SpaceMap.spec.ts b/viewer/src/components/SpaceMap.spec.ts index 3148e635..25718220 100644 --- a/viewer/src/components/SpaceMap.spec.ts +++ b/viewer/src/components/SpaceMap.spec.ts @@ -204,7 +204,7 @@ describe("SpaceMap", () => { store.commit("player", { index: 0 }); store.commit("receiveData", engine); const { container } = render(SpaceMap, { store }); - const ship = (name: Spaceship) => container.querySelector(`[data-ship="${name}"]`).parentElement; + const ship = (name: Spaceship) => container.querySelector(`[data-ship="${name}"]`).closest(".space-hex-cell"); const markers = Array.from(ship(Spaceship.Twilight).querySelectorAll(".lost-fleet-spaceship__explorer")); expect(markers.map((marker) => marker.getAttribute("data-player"))).to.deep.equal(["3", "2", "1", "0"]); expect(markers[1].querySelector(".planet-fill.p")).not.to.equal(null); @@ -271,18 +271,18 @@ describe("SpaceMap", () => { }); expect(container.querySelectorAll("g.space-hex-cell .lost-fleet-spaceship").length).to.equal(spaceshipHexCount); // per-hex ship marker fills the whole hex with the ship's identity color (rulebook page 7: - // Twilight purple / Rebellion brown / T F Mars grey / Eclipse yellow) plus a single bold, - // centered letter - no separate orbit ring or "Ship" caption pill on top of it + // Twilight purple / Rebellion brown / T F Mars grey / Eclipse yellow) plus an upright + // insignia - no separate orbit ring or "Ship" caption pill on top of it const mapShipMarker = container.querySelector("g.space-hex-cell .lost-fleet-spaceship"); if (mapShipMarker) { expect(mapShipMarker.querySelector(".lost-fleet-spaceship__orbit")).to.equal(null); expect(mapShipMarker.querySelector(".lost-fleet-spaceship__pill")).to.equal(null); - expect(mapShipMarker.querySelectorAll("text").length).to.equal(1); - expect(mapShipMarker.querySelector("text").textContent).to.match(/^[TRME]$/); - // the ship color fills the whole hex via a hex-shaped , not a small circle + expect(mapShipMarker.querySelectorAll(".spaceship-emblem").length).to.equal(1); + expect(mapShipMarker.querySelector(".spaceship-emblem").getAttribute("aria-label")).to.contain("Twilight"); + // The large medallion identifies the ship; the underlying space hex has no identity-color fill. const cell = mapShipMarker.closest("g.space-hex-cell"); - expect(cell.querySelector(".lost-fleet-spaceship__hex")).to.not.equal(null); - expect(cell.querySelectorAll(".lost-fleet-spaceship circle").length).to.equal(0); + expect(cell.querySelector(".lost-fleet-spaceship__hex")).to.equal(null); + expect(cell.querySelector(".spaceship-emblem > circle")).to.not.equal(null); } // the Lost Fleet legend (Interspace/Deep Space/Ship swatches) was removed entirely diff --git a/viewer/src/components/SpaceshipEmblem.reference.md b/viewer/src/components/SpaceshipEmblem.reference.md new file mode 100644 index 00000000..85f1840a --- /dev/null +++ b/viewer/src/components/SpaceshipEmblem.reference.md @@ -0,0 +1,14 @@ +# Lost Fleet insignia + +`SpaceshipEmblem.vue` contains hand-drawn SVG interpretations, **not original publisher vector assets**. + +Reference: official **Gaia Project: The Lost Fleet rulebook v1.0, page 7**, the four individually named ship boards. The checked-in copy is `docs/lost-fleet/rulebook-v1.0.pdf`. Also checked the [Capstone Games publisher download](https://capstone-games.com/cdn/shop/files/GP_Exp_Rule_EN_V1_Web.pdf?v=6134275372584409409). Both embed the boards at only about 250×77 pixels; enlargement does not recover the fine detail. Page 2 also shows the purple insignia on a ship tile. The owner's tabletop photograph supplies the same high-level shapes and colors. + +- **Twilight / Nautilaks:** white segmented nautilus spiral, purple disc. Supported motif; simplified spiral chambers, not an exact tracing. +- **Eclipse / Eridani Empire:** dark planet/orbital ellipse on gold. Supported motif; simplified orbit intersection. +- **T F Mars / Gaia Federation:** two dark, rising diagonal leaf/slash shapes on pale silver. Supported motif; simplified silhouettes. +- **Rebellion / Vo'Kron:** the owner's subsequent close-up resolves the long tapered U/claw, inner crown and lower angular divisions. The SVG interprets those dark shapes on a pale silver/ivory medallion, with light gaps between the divisions. It replaces the provisional R; the ship-board header retains the ship's brown identity color. + +Primary map and board headers use the same component. Headers keep their full names independently of the symbol (including T F MARS). The primary map no longer fills the underlying ship hex with an identity color. The alternate map keeps E/T/R/M on colored hexes and its board has its own unchanged template; no CSS hiding or shared-template mode is needed. Generic spacecraft controls and action-effect symbols are intentionally untouched. + +The map insignia inherits the existing upright counter-rotation and now fills most of its hex (radius 0.8, up from 0.33 in the first proposal). Explorer tokens retain their original size and positions; they are painted after the emblem and intentionally overlap it. Tooltips and accessible names retain the ship and its faction identity. diff --git a/viewer/src/components/SpaceshipEmblem.spec.ts b/viewer/src/components/SpaceshipEmblem.spec.ts new file mode 100644 index 00000000..04415e91 --- /dev/null +++ b/viewer/src/components/SpaceshipEmblem.spec.ts @@ -0,0 +1,81 @@ +import Engine, { Spaceship } from "@gaia-project/engine"; +import { render } from "@testing-library/vue"; +import { expect } from "chai"; +import AlternateShips from "../../../old-ui/src/components/LostFleetShips.vue"; +import AlternateHex from "../../../old-ui/src/components/SpaceHex.vue"; +import { spaceshipColors, spaceshipNames } from "../data/spaceships"; +import { makeStore } from "../store"; +import SpaceHex from "./SpaceHex.vue"; +import SpaceshipEmblem from "./SpaceshipEmblem.vue"; + +// The alternate UI inherits ship-board methods but owns its template. Exercise that real template, +// not a CSS-hidden variant, to protect its initial markers and unchanged headings. +describe("Spaceship insignia proposal", () => { + it("gives every insignia a graphic and its full accessible ship name, including Rebellion", () => { + for (const ship of [Spaceship.Twilight, Spaceship.Rebellion, Spaceship.TFMars, Spaceship.Eclipse]) { + const { container } = render(SpaceshipEmblem, { props: { ship } }); + expect(container.querySelector('[role="img"]').getAttribute("aria-label")).to.contain(spaceshipNames[ship]); + expect(container.querySelector("text, [data-emblem-pending]")).to.equal(null); + expect(container.querySelector("path")).not.to.equal(null); + } + }); + + it("enlarges upright primary map emblems behind full-size explorers and keeps alternate initials", () => { + const engine = new Engine( + ["init 4 emblem-map", "p1 faction terrans", "p2 faction hadsch-hallas", "p3 faction moweyds", "p4 faction xenos"], + { lostFleet: true } + ); + const store = makeStore(); + store.commit("receiveData", engine); + for (const ship of [Spaceship.Twilight, Spaceship.Rebellion, Spaceship.TFMars, Spaceship.Eclipse]) { + engine.players.forEach((player, i) => { + player.data.explorationShips[ship] = i + 1; + }); + const hex = Array.from(engine.map.grid.values()).find((hex) => hex.data.spaceship === ship); + const props = { hex, contentRotation: 30 }; + const { container } = render(SpaceHex, { store, props }); + const emblem = container.querySelector(".spaceship-emblem"); + expect(emblem.parentElement.parentElement.getAttribute("transform")).to.equal("rotate(-30)"); + expect(container.querySelector(".lost-fleet-spaceship__hex")).to.equal(null); + expect(container.querySelector("title").textContent).to.contain(spaceshipNames[ship]); + expect(emblem.getAttribute("transform")).to.equal("scale(0.08)"); + const layers = Array.from(emblem.parentElement.children); + const explorers = Array.from(container.querySelectorAll(".lost-fleet-spaceship__explorer")); + expect(explorers).to.have.length(4); + for (const explorer of explorers) { + const [x, y] = explorer + .getAttribute("transform") + .match(/-?[\d.]+/g) + .map(Number); + // Overlap is intentional; the original full-size tokens remain above the large insignia. + expect(Math.hypot(x, y)).to.be.lessThan(10 * 0.08 + 0.3); + expect(layers.indexOf(explorer)).to.be.greaterThan(layers.indexOf(emblem)); + expect(explorer.querySelector(".lost-fleet-spaceship__explorer-outline").getAttribute("r")).to.equal("0.3"); + expect(explorer.querySelector(".planet-fill").getAttribute("r")).to.equal("0.25"); + } + const { container: alternate } = render(AlternateHex, { store, props }); + expect(alternate.querySelector(".spaceship-emblem")).to.equal(null); + const color = document.createElement("span"); + color.style.fill = spaceshipColors[ship]; + expect((alternate.querySelector(".lost-fleet-spaceship__hex") as SVGElement).style.fill).to.equal( + color.style.fill + ); + expect(alternate.querySelector(".lost-fleet-spaceship__label").textContent).to.equal( + { twilight: "T", rebellion: "R", tfmars: "M", eclipse: "E" }[ship] + ); + } + }); + + it("leaves the alternate board template and complete legacy names unchanged", () => { + const store = makeStore(); + store.commit("receiveData", new Engine(["init 4 emblem-alternate"], { lostFleet: true })); + const { container } = render(AlternateShips, { store }); + expect(container.querySelector(".spaceship-emblem")).to.equal(null); + expect(Array.from(container.querySelectorAll("header strong")).map((node) => node.textContent)).to.have.members([ + "TWILIGHT", + "REBELLION", + "MARS", + "ECLIPSE", + ]); + }); +}); diff --git a/viewer/src/components/SpaceshipEmblem.vue b/viewer/src/components/SpaceshipEmblem.vue new file mode 100644 index 00000000..061250f8 --- /dev/null +++ b/viewer/src/components/SpaceshipEmblem.vue @@ -0,0 +1,61 @@ + + + diff --git a/viewer/src/data/stats.spec.ts b/viewer/src/data/stats.spec.ts index 6e4fbc65..722d1797 100644 --- a/viewer/src/data/stats.spec.ts +++ b/viewer/src/data/stats.spec.ts @@ -1,6 +1,15 @@ import { Building, Expansion, Faction, GaiaHex, Planet, Player, PlayerEnum } from "@gaia-project/engine"; import { expect } from "chai"; -import { sectors } from "./stats"; +import { deepSpaceSectors, sectors } from "./stats"; + +function mine(sector: string, q = 0): GaiaHex { + return new GaiaHex(q, -q, { + sector, + planet: sector.startsWith("DS") ? Planet.Protoplanet : Planet.Terra, + player: PlayerEnum.Player1, + building: Building.Mine, + }); +} describe("stats", () => { describe("sectors", () => { @@ -19,6 +28,102 @@ describe("stats", () => { ); expect(sectors(player)).to.equal(1); + expect(deepSpaceSectors(player)).to.equal(1); + }); + }); + + describe("deepSpaceSectors", () => { + let player: Player; + + beforeEach(() => { + player = new Player(Expansion.LostFleet, PlayerEnum.Player1); + player.faction = Faction.Terrans; + }); + + it("keeps ordinary sector counts separate from Deep Space counts", () => { + player.data.occupied.push(mine("s1"), mine("s1", 1), mine("s2", 2)); + + expect(sectors(player)).to.equal(2); + expect(deepSpaceSectors(player)).to.equal(0); + + player.data.occupied.push(mine("DS11_0", 3)); + + expect(sectors(player)).to.equal(2); + expect(deepSpaceSectors(player)).to.equal(1); + }); + + it("counts DSx_0, DSx_1 and DSx_2 as one physical Deep Space tile", () => { + player.data.occupied.push(...[0, 1, 2].map((index) => mine(`DS11_${index}`, index))); + + expect(deepSpaceSectors(player)).to.equal(1); + expect(sectors(player)).to.equal(0); + }); + + it("counts distinct Deep Space tiles separately", () => { + player.data.occupied.push(mine("DS11_0"), mine("DS12_1", 1), mine("DS13_2", 2)); + + expect(deepSpaceSectors(player)).to.equal(3); + expect(sectors(player)).to.equal(0); + }); + + it("does not count Interspace hexes as either kind of sector", () => { + player.data.occupied.push(mine("IS1"), mine("IS2", 1)); + + expect(deepSpaceSectors(player)).to.equal(0); + expect(sectors(player)).to.equal(0); + }); + + for (const [label, building, planet] of [ + ["Gaiaformers", Building.GaiaFormer, Planet.Transdim], + ["space stations", Building.SpaceStation, Planet.Empty], + ] as const) { + it(`does not count ${label} as colonizing a sector`, () => { + for (const [index, sector] of ["s1", "DS11_0"].entries()) { + const hex = mine(sector, index); + hex.data.building = building; + hex.data.planet = planet; + player.data.occupied.push(hex); + } + + expect(deepSpaceSectors(player)).to.equal(0); + expect(sectors(player)).to.equal(0); + }); + } + + it("does not count an opponent's colonies in the occupied list", () => { + for (const [index, sector] of ["s1", "DS11_0"].entries()) { + const hex = mine(sector, index); + hex.data.player = PlayerEnum.Player2; + player.data.occupied.push(hex); + } + + expect(deepSpaceSectors(player)).to.equal(0); + expect(sectors(player)).to.equal(0); + }); + + it("counts Lantids shared mines for the guest, deduplicating Deep Space tiles", () => { + player.faction = Faction.Lantids; + for (const [index, sector] of ["s1", "DS11_0", "DS11_1"].entries()) { + const hex = mine(sector, index); + hex.data.player = PlayerEnum.Player2; + hex.data.additionalMine = player.player; + player.data.occupied.push(hex); + } + + expect(deepSpaceSectors(player)).to.equal(1); + expect(sectors(player)).to.equal(1); + + for (const hex of player.data.occupied) { + delete hex.data.additionalMine; + } + + expect(deepSpaceSectors(player)).to.equal(0); + expect(sectors(player)).to.equal(0); + }); + + it("returns zero for a player with no occupied hexes", () => { + expect(deepSpaceSectors(player)).to.equal(0); + expect(sectors(player)).to.equal(0); }); }); }); diff --git a/viewer/src/data/stats.ts b/viewer/src/data/stats.ts index 2c3d744c..1fe5bfc7 100644 --- a/viewer/src/data/stats.ts +++ b/viewer/src/data/stats.ts @@ -1,4 +1,6 @@ -import Engine, { Condition, GaiaHex, Player, PlayerEnum } from "@gaia-project/engine"; +import type Engine from "@gaia-project/engine"; +import type { GaiaHex, Player, PlayerEnum } from "@gaia-project/engine"; +import { Condition } from "@gaia-project/engine"; import { sum } from "../logic/lodash-utils"; import { leechPlanets, upgradableBuildingsOfOtherPlayers } from "../logic/utils"; import { MapModeType } from "./actions"; @@ -10,6 +12,11 @@ export function sectors(player: Player): number { return player.eventConditionCount(Condition.Sector); } +/** Counts colonized physical Deep Space tiles using the engine's scoring rules. */ +export function deepSpaceSectors(player: Player): number { + return player.eventConditionCount(Condition.DeepSpaceSector); +} + export function leechNetwork(engine: Engine, player: PlayerEnum): number { const map = engine.map; const hexes: GaiaHex[] = Array.from(map.grid.values()); diff --git a/viewer/src/localization/da.json b/viewer/src/localization/da.json index 57ee68d8..7f50a791 100644 --- a/viewer/src/localization/da.json +++ b/viewer/src/localization/da.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Forrige planlagte træk", "Next planned move": "Næste planlagte træk", "Edit this move": "Rediger dette træk", - "Return to end": "Tilbage til slutningen" + "Return to end": "Tilbage til slutningen", + "Exploration shuttles remaining: {p0} of {p1}": "Resterende udforskningsfærger: {p0} af {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Rumsektorer med en koloniseret planet. Klik for at fremhæve alle koloniserede sektorer.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Dybrumssektorer med en koloniseret planet. Klik for at fremhæve alle koloniserede sektorer.", + "Twilight — Nautilaks": "Twilight — Nautilakker", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Gaia Føderation", + "Eclipse — Eridani Empire": "Eclipse — Eridani-imperiet" } diff --git a/viewer/src/localization/de.json b/viewer/src/localization/de.json index 3375d2cd..5d5b29fd 100644 --- a/viewer/src/localization/de.json +++ b/viewer/src/localization/de.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Vorheriger geplanter Zug", "Next planned move": "Nächster geplanter Zug", "Edit this move": "Diesen Zug bearbeiten", - "Return to end": "Zum Ende zurückkehren" + "Return to end": "Zum Ende zurückkehren", + "Exploration shuttles remaining: {p0} of {p1}": "Verbleibende Erkundungsshuttles: {p0} von {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Weltraumsektoren mit einem kolonisierten Planeten. Klicken, um alle kolonisierten Sektoren hervorzuheben.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Deep-Space-Sektoren mit einem kolonisierten Planeten. Klicken, um alle kolonisierten Sektoren hervorzuheben.", + "Twilight — Nautilaks": "Twilight — Nautilaks", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Gaia-Föderation", + "Eclipse — Eridani Empire": "Eclipse — Eridani-Imperium" } diff --git a/viewer/src/localization/el.json b/viewer/src/localization/el.json index fc34a729..60dcace6 100644 --- a/viewer/src/localization/el.json +++ b/viewer/src/localization/el.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Προηγούμενη προγραμματισμένη κίνηση", "Next planned move": "Επόμενη προγραμματισμένη κίνηση", "Edit this move": "Επεξεργασία αυτής της κίνησης", - "Return to end": "Επιστροφή στο τέλος" + "Return to end": "Επιστροφή στο τέλος", + "Exploration shuttles remaining: {p0} of {p1}": "Εναπομείναντα σκάφη εξερεύνησης: {p0} από {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Διαστημικοί τομείς με αποικισμένο πλανήτη. Κάντε κλικ για να επισημάνετε όλους τους αποικισμένους τομείς.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Τομείς βαθέος διαστήματος με αποικισμένο πλανήτη. Κάντε κλικ για να επισημάνετε όλους τους αποικισμένους τομείς.", + "Twilight — Nautilaks": "Twilight — Nautilaks", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Ομοσπονδία Gaia", + "Eclipse — Eridani Empire": "Eclipse — Eridani Empire" } diff --git a/viewer/src/localization/en.json b/viewer/src/localization/en.json index 9e1eb7d9..117362c0 100644 --- a/viewer/src/localization/en.json +++ b/viewer/src/localization/en.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Previous planned move", "Next planned move": "Next planned move", "Edit this move": "Edit this move", - "Return to end": "Return to end" + "Return to end": "Return to end", + "Exploration shuttles remaining: {p0} of {p1}": "Exploration shuttles remaining: {p0} of {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Space sectors with a colonized planet. Click to highlight all colonized sectors.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.", + "Twilight — Nautilaks": "Twilight — Nautilaks", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Gaia Federation", + "Eclipse — Eridani Empire": "Eclipse — Eridani Empire" } diff --git a/viewer/src/localization/fa.json b/viewer/src/localization/fa.json index 971963d9..d597248c 100644 --- a/viewer/src/localization/fa.json +++ b/viewer/src/localization/fa.json @@ -4149,5 +4149,12 @@ "Previous planned move": "حرکت برنامه‌ریزی‌شدهٔ قبلی", "Next planned move": "حرکت برنامه‌ریزی‌شدهٔ بعدی", "Edit this move": "ویرایش این حرکت", - "Return to end": "بازگشت به پایان" + "Return to end": "بازگشت به پایان", + "Exploration shuttles remaining: {p0} of {p1}": "شاتل‌های اکتشافی باقی‌مانده: {p0} از {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "بخش‌های فضایی دارای سیارهٔ مستعمره‌شده. برای برجسته‌کردن همهٔ بخش‌های مستعمره‌شده کلیک کنید.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "بخش‌های فضای عمیق دارای سیارهٔ مستعمره‌شده. برای برجسته‌کردن همهٔ بخش‌های مستعمره‌شده کلیک کنید.", + "Twilight — Nautilaks": "Twilight — نوتیلاک", + "Rebellion — Vo'Kron": "Rebellion — وُکرون", + "T F Mars — Gaia Federation": "T F Mars — فدراسیون گایا", + "Eclipse — Eridani Empire": "Eclipse — امپراتوری اریدانی" } diff --git a/viewer/src/localization/fr.json b/viewer/src/localization/fr.json index 70604f2c..e01a77cb 100644 --- a/viewer/src/localization/fr.json +++ b/viewer/src/localization/fr.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Coup planifié précédent", "Next planned move": "Coup planifié suivant", "Edit this move": "Modifier ce coup", - "Return to end": "Revenir à la fin" + "Return to end": "Revenir à la fin", + "Exploration shuttles remaining: {p0} of {p1}": "Navettes d’exploration restantes : {p0} sur {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Secteurs spatiaux avec une planète colonisée. Cliquez pour mettre en évidence tous les secteurs colonisés.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Secteurs de l’espace profond avec une planète colonisée. Cliquez pour mettre en évidence tous les secteurs colonisés.", + "Twilight — Nautilaks": "Twilight — Nautilaks", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Alliance Gaia", + "Eclipse — Eridani Empire": "Eclipse — Empire éridanien" } diff --git a/viewer/src/localization/hi.json b/viewer/src/localization/hi.json index addce96f..113845dc 100644 --- a/viewer/src/localization/hi.json +++ b/viewer/src/localization/hi.json @@ -4149,5 +4149,12 @@ "Previous planned move": "पिछली नियोजित चाल", "Next planned move": "अगली नियोजित चाल", "Edit this move": "इस चाल को संपादित करें", - "Return to end": "अंत पर लौटें" + "Return to end": "अंत पर लौटें", + "Exploration shuttles remaining: {p0} of {p1}": "शेष अन्वेषण शटल: {p1} में से {p0}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "उपनिवेशित ग्रह वाले अंतरिक्ष क्षेत्र। सभी उपनिवेशित क्षेत्रों को हाइलाइट करने के लिए क्लिक करें।", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "उपनिवेशित ग्रह वाले गहरे अंतरिक्ष क्षेत्र। सभी उपनिवेशित क्षेत्रों को हाइलाइट करने के लिए क्लिक करें।", + "Twilight — Nautilaks": "Twilight — नॉटिलैक्स", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — गैया महासंघ", + "Eclipse — Eridani Empire": "Eclipse — एरिडानी साम्राज्य" } diff --git a/viewer/src/localization/it.json b/viewer/src/localization/it.json index e049f5b9..69aa4569 100644 --- a/viewer/src/localization/it.json +++ b/viewer/src/localization/it.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Mossa pianificata precedente", "Next planned move": "Mossa pianificata successiva", "Edit this move": "Modifica questa mossa", - "Return to end": "Torna alla fine" + "Return to end": "Torna alla fine", + "Exploration shuttles remaining: {p0} of {p1}": "Navette di esplorazione rimanenti: {p0} su {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Settori spaziali con un pianeta colonizzato. Clicca per evidenziare tutti i settori colonizzati.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Settori dello spazio profondo con un pianeta colonizzato. Clicca per evidenziare tutti i settori colonizzati.", + "Twilight — Nautilaks": "Twilight — Nautilaks", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Federazione Gaia", + "Eclipse — Eridani Empire": "Eclipse — Impero Eridani" } diff --git a/viewer/src/localization/ko.json b/viewer/src/localization/ko.json index 692d77c7..6b344ac8 100644 --- a/viewer/src/localization/ko.json +++ b/viewer/src/localization/ko.json @@ -4149,5 +4149,12 @@ "Previous planned move": "이전 계획된 수", "Next planned move": "다음 계획된 수", "Edit this move": "이 수 수정", - "Return to end": "끝으로 돌아가기" + "Return to end": "끝으로 돌아가기", + "Exploration shuttles remaining: {p0} of {p1}": "남은 탐사 셔틀: {p1}개 중 {p0}개", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "식민지가 있는 우주 구역. 클릭하면 식민지가 있는 모든 구역이 강조 표시됩니다.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "식민지가 있는 심우주 구역. 클릭하면 식민지가 있는 모든 구역이 강조 표시됩니다.", + "Twilight — Nautilaks": "Twilight — 노틸락", + "Rebellion — Vo'Kron": "Rebellion — 보크론", + "T F Mars — Gaia Federation": "T F Mars — 가이아 연방", + "Eclipse — Eridani Empire": "Eclipse — 에리다니 제국" } diff --git a/viewer/src/localization/lost-fleet-stats.spec.ts b/viewer/src/localization/lost-fleet-stats.spec.ts new file mode 100644 index 00000000..66d60e05 --- /dev/null +++ b/viewer/src/localization/lost-fleet-stats.spec.ts @@ -0,0 +1,29 @@ +import { describe, expect, it } from "vitest"; +import { createTranslator } from "./runtime.js"; + +const modules = import.meta.glob("./*.json", { eager: true, import: "default" }); +const catalogs = Object.fromEntries(Object.entries(modules).map(([path, catalog]) => [path.slice(2, -5), catalog])); + +describe("Lost Fleet counter localization", () => { + for (const locale of Object.keys(catalogs).filter((locale) => locale !== "en")) { + it(`translates dynamic shuttle counts and sector tooltips in ${locale}`, () => { + const translator = createTranslator(catalogs, locale); + for (const remaining of [0, 1, 2, 3]) { + const source = `Exploration shuttles remaining: ${remaining} of 3`; + const translated = translator.translate(source); + expect(translated).not.toBe(source); + expect(translated).not.toMatch(/\{p\d\}/); + } + for (const source of [ + "Space sectors with a colonized planet. Click to highlight all colonized sectors.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.", + ]) { + expect(translator.translate(source)).not.toBe(source); + } + }); + } + it("translates emblem affiliations while retaining ship identities", () => { + const translator = createTranslator(catalogs, "fr"); + expect(translator.translate("T F Mars — Gaia Federation")).toBe("T F Mars — Alliance Gaia"); + }); +}); diff --git a/viewer/src/localization/nl.json b/viewer/src/localization/nl.json index 0fba4785..2dcd8c10 100644 --- a/viewer/src/localization/nl.json +++ b/viewer/src/localization/nl.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Vorige geplande zet", "Next planned move": "Volgende geplande zet", "Edit this move": "Deze zet bewerken", - "Return to end": "Terug naar het einde" + "Return to end": "Terug naar het einde", + "Exploration shuttles remaining: {p0} of {p1}": "Resterende verkenningsshuttles: {p0} van {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Ruimtesectoren met een gekoloniseerde planeet. Klik om alle gekoloniseerde sectoren te markeren.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Dieperuimtesectoren met een gekoloniseerde planeet. Klik om alle gekoloniseerde sectoren te markeren.", + "Twilight — Nautilaks": "Twilight — Nautilaks", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Gaia-federatie", + "Eclipse — Eridani Empire": "Eclipse — Eridani Empire" } diff --git a/viewer/src/localization/pl.json b/viewer/src/localization/pl.json index 2047f38f..c3a7c562 100644 --- a/viewer/src/localization/pl.json +++ b/viewer/src/localization/pl.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Poprzedni zaplanowany ruch", "Next planned move": "Następny zaplanowany ruch", "Edit this move": "Edytuj ten ruch", - "Return to end": "Wróć na koniec" + "Return to end": "Wróć na koniec", + "Exploration shuttles remaining: {p0} of {p1}": "Pozostałe wahadłowce eksploracyjne: {p0} z {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Sektory kosmiczne ze skolonizowaną planetą. Kliknij, aby podświetlić wszystkie skolonizowane sektory.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Sektory głębokiej przestrzeni ze skolonizowaną planetą. Kliknij, aby podświetlić wszystkie skolonizowane sektory.", + "Twilight — Nautilaks": "Twilight — Nautilaks", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Federacja Gaja", + "Eclipse — Eridani Empire": "Eclipse — Imperium Eridanów" } diff --git a/viewer/src/localization/pt-BR.json b/viewer/src/localization/pt-BR.json index dc247efc..fd8097b0 100644 --- a/viewer/src/localization/pt-BR.json +++ b/viewer/src/localization/pt-BR.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Jogada planejada anterior", "Next planned move": "Próxima jogada planejada", "Edit this move": "Editar esta jogada", - "Return to end": "Voltar ao final" + "Return to end": "Voltar ao final", + "Exploration shuttles remaining: {p0} of {p1}": "Naves de exploração restantes: {p0} de {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Setores espaciais com um planeta colonizado. Clique para destacar todos os setores colonizados.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Setores do espaço profundo com um planeta colonizado. Clique para destacar todos os setores colonizados.", + "Twilight — Nautilaks": "Twilight — Nautilaks", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Federação Gaia", + "Eclipse — Eridani Empire": "Eclipse — Império Eridani" } diff --git a/viewer/src/localization/ro.json b/viewer/src/localization/ro.json index 580e3e24..2936c9d6 100644 --- a/viewer/src/localization/ro.json +++ b/viewer/src/localization/ro.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Mutarea planificată anterioară", "Next planned move": "Următoarea mutare planificată", "Edit this move": "Editează această mutare", - "Return to end": "Revino la final" + "Return to end": "Revino la final", + "Exploration shuttles remaining: {p0} of {p1}": "Navete de explorare rămase: {p0} din {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Sectoare spațiale cu o planetă colonizată. Clic pentru a evidenția toate sectoarele colonizate.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Sectoare de spațiu îndepărtat cu o planetă colonizată. Clic pentru a evidenția toate sectoarele colonizate.", + "Twilight — Nautilaks": "Twilight — Nautilaks", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Federația Gaia", + "Eclipse — Eridani Empire": "Eclipse — Imperiul Eridani" } diff --git a/viewer/src/localization/ru.json b/viewer/src/localization/ru.json index a2c594b9..105369d6 100644 --- a/viewer/src/localization/ru.json +++ b/viewer/src/localization/ru.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Предыдущий запланированный ход", "Next planned move": "Следующий запланированный ход", "Edit this move": "Изменить этот ход", - "Return to end": "Вернуться в конец" + "Return to end": "Вернуться в конец", + "Exploration shuttles remaining: {p0} of {p1}": "Осталось исследовательских шаттлов: {p0} из {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Космические секторы с колонизированной планетой. Нажмите, чтобы выделить все колонизированные секторы.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Секторы дальнего космоса с колонизированной планетой. Нажмите, чтобы выделить все колонизированные секторы.", + "Twilight — Nautilaks": "Twilight — Наутилаки", + "Rebellion — Vo'Kron": "Rebellion — Во'Крон", + "T F Mars — Gaia Federation": "T F Mars — Федерация Геи", + "Eclipse — Eridani Empire": "Eclipse — Империя Эридана" } diff --git a/viewer/src/localization/vi.json b/viewer/src/localization/vi.json index 42f27858..2af96db3 100644 --- a/viewer/src/localization/vi.json +++ b/viewer/src/localization/vi.json @@ -4149,5 +4149,12 @@ "Previous planned move": "Nước đi đã lên kế hoạch trước", "Next planned move": "Nước đi đã lên kế hoạch tiếp theo", "Edit this move": "Chỉnh sửa nước đi này", - "Return to end": "Trở về cuối" + "Return to end": "Trở về cuối", + "Exploration shuttles remaining: {p0} of {p1}": "Tàu con thoi thám hiểm còn lại: {p0} trên {p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Các khu vực không gian có hành tinh đã thuộc địa hóa. Nhấp để làm nổi bật tất cả khu vực đã thuộc địa hóa.", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "Các khu vực không gian sâu có hành tinh đã thuộc địa hóa. Nhấp để làm nổi bật tất cả khu vực đã thuộc địa hóa.", + "Twilight — Nautilaks": "Twilight — Nautilaks", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Liên bang Gaia", + "Eclipse — Eridani Empire": "Eclipse — Đế chế Eridani" } diff --git a/viewer/src/localization/zh-CN.json b/viewer/src/localization/zh-CN.json index f6c7e86a..46452ccf 100644 --- a/viewer/src/localization/zh-CN.json +++ b/viewer/src/localization/zh-CN.json @@ -4149,5 +4149,12 @@ "Previous planned move": "上一个计划行动", "Next planned move": "下一个计划行动", "Edit this move": "编辑此行动", - "Return to end": "返回末尾" + "Return to end": "返回末尾", + "Exploration shuttles remaining: {p0} of {p1}": "剩余探索穿梭机:{p0}/{p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "有殖民星球的太空星区。点击以标示所有已殖民星区。", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "有殖民星球的深空星区。点击以标示所有已殖民星区。", + "Twilight — Nautilaks": "Twilight — 鹦鹉螺星人", + "Rebellion — Vo'Kron": "Rebellion — 沃克隆族", + "T F Mars — Gaia Federation": "T F Mars — 盖亚星际联邦", + "Eclipse — Eridani Empire": "Eclipse — 艾瑞达尼帝国" } diff --git a/viewer/src/localization/zh-TW.json b/viewer/src/localization/zh-TW.json index ce48aa28..91575007 100644 --- a/viewer/src/localization/zh-TW.json +++ b/viewer/src/localization/zh-TW.json @@ -4149,5 +4149,12 @@ "Previous planned move": "上一個計畫行動", "Next planned move": "下一個計畫行動", "Edit this move": "編輯此行動", - "Return to end": "返回末尾" + "Return to end": "返回末尾", + "Exploration shuttles remaining: {p0} of {p1}": "剩餘探索穿梭機:{p0}/{p1}", + "Space sectors with a colonized planet. Click to highlight all colonized sectors.": "有殖民星球的太空星區。點擊以標示所有已殖民星區。", + "Deep Space sectors with a colonized planet. Click to highlight all colonized sectors.": "有殖民星球的深空星區。點擊以標示所有已殖民星區。", + "Twilight — Nautilaks": "Twilight — 諾提拉斯", + "Rebellion — Vo'Kron": "Rebellion — Vo'Kron", + "T F Mars — Gaia Federation": "T F Mars — Gaia 聯邦", + "Eclipse — Eridani Empire": "Eclipse — 波江座帝國" } diff --git a/viewer/vitest.config.ts b/viewer/vitest.config.ts index 90c16fec..3fc53cf9 100644 --- a/viewer/vitest.config.ts +++ b/viewer/vitest.config.ts @@ -26,10 +26,10 @@ export default defineConfig({ exclude: ["src/testing/stack-traces.spec.ts"], globals: true, setupFiles: ["./vitest.setup.ts"], - // The suite is big (800+ specs); run all files in ONE forked process sequentially like - // mocha did (avoids 800 module-graph re-instantiations; memory is bounded by one process). + // Bound memory to one worker. Vitest 4 no longer recognizes singleFork; without + // maxWorkers it launches parallel forks and can exhaust memory on the full suite. pool: "forks", - singleFork: true, + maxWorkers: 1, testTimeout: 15000, }, });