Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
d4c8b7b
Initial commit of a campaign system
Hectate Mar 14, 2026
68d251a
Read campaign and mission data from game files in local git repo
Mar 17, 2026
27da658
Update mission model
sorenmarkert Mar 17, 2026
fded305
Add mission Launch button with difficulty selection and startscript g…
sorenmarkert Mar 18, 2026
f7a8d4f
Add missionOptions to modoptions
sorenmarkert Mar 20, 2026
a4e5ac9
Add difficulty settings to campaign, missions can override
sorenmarkert Mar 20, 2026
ef42ee1
Add disableInitialCommanderSpawn and disableFactionPicker
sorenmarkert Mar 20, 2026
f82e19d
Adjust for changed folder structure
sorenmarkert Mar 20, 2026
e693ad1
Refactoring: extract and reuse
sorenmarkert Mar 21, 2026
26be7fc
Refactoring: extract and reuse, and no more 'as any'
sorenmarkert Mar 22, 2026
5259f74
Formatting
sorenmarkert Mar 22, 2026
368deb2
Formatting
sorenmarkert Mar 22, 2026
0f2dcf6
Review comment by Hectate: undo changed imports
sorenmarkert Mar 23, 2026
bb6d223
Add comment
sorenmarkert Mar 24, 2026
a79d814
Review comment by p2004a: reverts, fix duplicates.
sorenmarkert Mar 25, 2026
3598fd1
Review comment by p2004a: reverts
sorenmarkert Mar 25, 2026
ac163e5
.vite ignore, and formatting
sorenmarkert Mar 25, 2026
2a24b00
Review comment by p2004a: no reading game files outside game-content.ts
sorenmarkert Mar 28, 2026
85a04a8
Review comment by p2004a: Convert campaign files to JSON format with …
sorenmarkert Mar 28, 2026
4c21b8e
Review comment by p2004a: Update campaign schema and generate model c…
sorenmarkert Mar 31, 2026
a937f9a
formatting and license
sorenmarkert Mar 31, 2026
a792da2
erroneous license
sorenmarkert Mar 31, 2026
e595e1b
Fix typecheck
sorenmarkert Mar 31, 2026
8fa2cce
Merge branch 'master' into campaigns/use-game-data
sorenmarkert Mar 31, 2026
9634c67
Minor fixes
sorenmarkert Apr 2, 2026
69b3dfa
Add `mission-script-converter.spec.ts`
sorenmarkert Apr 15, 2026
363e530
Replace logger from main with console.log
sorenmarkert Apr 21, 2026
e489ff3
Make mission list scrollable
sorenmarkert Apr 24, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ todo.txt
*.local
thumbs.db

# Auto-generated files (run `npm run generate` to recreate)
/src/main/content/game/generated/

.eslintcache
.browserslistrc
.electron-vendors.cache.json
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ If you change node.js version, you **need** to re-run `npm install`.
- Runs `electron-builder` to create a self-signed cert for Windows apps.
- After selecting "None" in the pop-up, a cert file should be created called `BAR Team.pfx`
- Then run `npm run build:win:dev-cert` to build a signed Windows installer
- `npm run generate-i18n-assets` (run when modifying source translation files)
- `npm run generate:i18n` (run when modifying source translation files)
- Generates transformed asset files for translations in `src/renderer/assets/languages`

### Mutliplayer
Expand Down
7 changes: 7 additions & 0 deletions REUSE.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,10 @@ path = ["lang/**/*.json", "src/renderer/assets/languages/*.json"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 The BAR Lobby Authors"
SPDX-License-Identifier = "MIT"

[[annotations]]
# JSON does not support comments so SPDX headers are declared here instead
path = ["src/main/content/game/schemas/*.json"]
precedence = "aggregate"
SPDX-FileCopyrightText = "2025 The BAR Lobby Authors"
SPDX-License-Identifier = "MIT"
57 changes: 57 additions & 0 deletions package-lock.json
Comment thread
p2004a marked this conversation as resolved.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@
},
"main": ".vite/build/main.cjs",
"scripts": {
"start": "cross-env NODE_OPTIONS=--enable-source-maps electron-forge start",
"package": "electron-forge package",
"generate:campaign": "node --import=tsx tools/generate-campaign-types.ts",
"generate:i18n": "node --import=tsx tools/generate-i18n-asset-files.ts",
"generate": "npm run generate:campaign",
"start": "npm run generate && cross-env NODE_OPTIONS=--enable-source-maps electron-forge start",
"package": "npm run generate && electron-forge package",
"preview": "electron-forge package && cross-env NODE_OPTIONS=--enable-source-maps NODE_ENV=production electron .",
"build:win": "electron-builder --win",
"buildall:win": "npm run package && npm run build:win",
Expand All @@ -32,9 +35,8 @@
"format:check": "prettier --experimental-cli --check .",
"typecheck:node": "tsc --noEmit -p tsconfig.node.json --composite false",
"typecheck:web": "vue-tsc --noEmit -p tsconfig.web.json --composite false",
"typecheck": "concurrently \"npm run typecheck:node\" \"npm run typecheck:web\"",
"checks": "concurrently \"npm run typecheck:web\" \"npm run typecheck:node\" \"npm run lint\" \"npm run format:check\"",
"generate-i18n-assets": "node --import=tsx tools/generate-i18n-asset-files.ts"
"typecheck": "npm run generate && concurrently \"npm run typecheck:node\" \"npm run typecheck:web\"",
"checks": "concurrently \"npm run typecheck\" \"npm run lint\" \"npm run format:check\""
},
"engines": {
"node": "22.18.0"
Expand Down Expand Up @@ -94,6 +96,7 @@
"eslint-plugin-vue": "^10.3.0",
"globals": "^16.3.0",
"jsdom": "^26.1.0",
"json-schema-to-typescript": "^15.0.4",
"prettier": "^3.6.2",
"sass": "^1.89.2",
"tsx": "^4.20.3",
Expand Down
3 changes: 2 additions & 1 deletion src/main/config/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import path from "path";
import fs from "fs";
import { env } from "process";
import { app } from "electron";
import { homedir } from "os";
import { homedir } from "node:os";

// Should be the same as `productName` in electron-builder.ts
// and in workaround in installer.nsh.
Expand Down Expand Up @@ -113,6 +113,7 @@ export const RAPID_INDEX_PATH = path.join(ASSETS_PATH, "rapid");

// Lobby specific cache path for scenario images. Maybe remove from here?
export const SCENARIO_IMAGE_PATH = path.join(STATE_PATH, "scenario-images");
export const CAMPAIGN_IMAGE_PATH = path.join(STATE_PATH, "campaign-images");

/**
* Get the path to the bundled CA certificate file for pr-downloader.
Expand Down
2 changes: 1 addition & 1 deletion src/main/config/default-versions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@

export const LATEST = "LATEST";
export const LATEST_GAME_VERSION = "byar:test";
export const DEFAULT_ENGINE_VERSION = "2025.04.08";
export const DEFAULT_ENGINE_VERSION = "2026.06.03";
20 changes: 20 additions & 0 deletions src/main/content/game/campaign-model.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
// SPDX-FileCopyrightText: 2025 The BAR Lobby Authors
//
// SPDX-License-Identifier: MIT

import type { CampaignDefinition } from "@main/content/game/generated/campaign";
import type { MissionModel } from "@main/content/game/mission";

/** Difficulty settings as defined in a campaign file. */
export type CampaignDifficulty = CampaignDefinition["difficulties"][string];

/**
* Campaign as returned to the lobby: extends the schema-validated {@link CampaignDefinition}
* with local-cache paths for images and runtime-populated fields.
*/
export type CampaignModel = CampaignDefinition & {
/** Whether this campaign is currently unlocked (from app state, not from the campaign file). */
unlocked?: boolean;
/** Runtime-populated map of missionId to MissionModel. */
missions: Record<string, MissionModel>;
};
Loading
Loading