Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 22 additions & 0 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: Prettier

on:
pull_request:
push:
branches:
- main

jobs:
prettier:
name: Check Formatting
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: "22.x"
- run: npm install -g yarn
- run: yarn install
- name: Run Prettier
run: |
yarn format:check
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22.x'
node-version: "22.x"
- run: npm install -g yarn
- run: yarn install
- run: yarn build
Expand Down
3 changes: 3 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Ignore artifacts:
build
dist
1 change: 1 addition & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{}
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tainted Grail - The Fall of Avalon Vortex Extension

This extension adds support for managing BepInEx mods for Tainted Grail: The Fall of Avalon in Vortex Mod Manager.
This extension adds support for managing BepInEx mods for Tainted Grail: The Fall of Avalon in Vortex Mod Manager.

## Build

Expand All @@ -16,4 +16,4 @@ Copy the contents of `dist` to `%APPDATA%\Vortex\plugins\tgfoadev`
rmdir /S /Q %APPDATA%\Vortex\plugins\tgfoadev
mkdir %APPDATA%\Vortex\plugins\tgfoadev
xcopy /Y /E /I dist %APPDATA%\Vortex\plugins\tgfoadev
```
```
4 changes: 2 additions & 2 deletions assets/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Game: Tainted Grail: The Fall of Avalon",
"author": "jonanoj",
"version": "1.1.0",
"version": "1.2.0",
"description": "Support for Tainted Grail: The Fall of Avalon mods using BepInEx"
}
}
40 changes: 20 additions & 20 deletions copyassets.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
import fs from 'fs/promises';
import path from 'path';
import { fileURLToPath } from 'url';
import fs from "fs/promises";
import path from "path";
import { fileURLToPath } from "url";

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const assetPath = path.join(__dirname, 'assets');
const destPath = path.join(__dirname, 'dist');
const assetPath = path.join(__dirname, "assets");
const destPath = path.join(__dirname, "dist");

async function start() {
try {
const assets = await fs.readdir(assetPath);
for (const asset of assets) {
try {
await fs.copyFile(path.join(assetPath, asset), path.join(destPath, asset));
}
catch (err) {
console.error('Error copying asset', { asset, err });
}
}

}
catch (err) {
console.error('Failed to copy assets!', err);
try {
const assets = await fs.readdir(assetPath);
for (const asset of assets) {
try {
await fs.copyFile(
path.join(assetPath, asset),
path.join(destPath, asset),
);
} catch (err) {
console.error("Error copying asset", { asset, err });
}
}
} catch (err) {
console.error("Failed to copy assets!", err);
}
}

await start();
await start();
4 changes: 4 additions & 0 deletions deploy-dev.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
set -x
rm -rf "$APPDATA/Vortex/plugins/tgfoadev"
mkdir -p "$APPDATA/Vortex/plugins/tgfoadev"
cp -r dist/* "$APPDATA/Vortex/plugins/tgfoadev/"
48 changes: 27 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,28 @@
{
"name": "tgfoa-bepinex",
"version": "1.1.0",
"description": "Support for Tainted Grail: The Fall of Avalon mods using BepInEx",
"author": "jonanoj",
"main": "./out/index.js",
"scripts": {
"copyassets": "node copyassets.js",
"build": "webpack --config webpack.config.js && extractInfo && yarn copyassets"
},
"repository": "git@github.com:jonanoj/TGFoAVortexExtension.git",
"license": "MIT",
"dependencies": {},
"devDependencies": {
"modtype-bepinex": "Nexus-Mods/extension-modtype-bepinex",
"ts-loader": "^9.5.2",
"typescript": "^5.8.3",
"vortex-api": "Nexus-Mods/vortex-api",
"webpack": "^5.99.9",
"webpack-cli": "^6.0.1"
}
}
"name": "tgfoa-bepinex",
"version": "1.2.0",
"description": "Support for Tainted Grail: The Fall of Avalon mods using BepInEx",
"author": "jonanoj",
"main": "./out/index.js",
"scripts": {
"copyassets": "node copyassets.js",
"build": "webpack --config webpack.config.js && extractInfo && yarn copyassets",
"format": "prettier --write .",
"format:check": "prettier --check ."
},
"repository": "git@github.com:jonanoj/TGFoAVortexExtension.git",
"license": "MIT",
"dependencies": {
"redux-act": "^1.8.0"
},
"devDependencies": {
"@types/redux": "^3.6.0",
"modtype-bepinex": "Nexus-Mods/extension-modtype-bepinex",
"prettier": "3.6.2",
"ts-loader": "^9.5.2",
"typescript": "^5.8.3",
"vortex-api": "Nexus-Mods/vortex-api",
"webpack": "^5.99.9",
"webpack-cli": "^6.0.1"
}
}
6 changes: 6 additions & 0 deletions src/actions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { createAction } from "redux-act";

export const setMonoMigrationNextReminderTime = createAction(
"SET_TGFOA_MONO_MIGRATION_NEXT_REMINDER_TIME",
(nextReminder: number) => ({ nextReminder }),
);
57 changes: 57 additions & 0 deletions src/consts.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
import { INexusDownloadInfo } from "modtype-bepinex/src/types";
import path from "path";
import { fs, util } from "vortex-api";
import { IGame } from "vortex-api/lib/types/api";

export const STEAM_ID = "1466060";
export const GOG_ID = "1887281589";
export const GAME_DATA_DIR = "Fall of Avalon_Data";
export const IL2CPP_DIR = path.join(GAME_DATA_DIR, "il2cpp_data");
export const MANAGED_DLL_DIR = path.join(GAME_DATA_DIR, "Managed");
export const GAME_EXE_FILENAME = "Fall of Avalon.exe";
export const MOD_PATH = path.join("BepInEx", "plugins");

export const GAME: IGame = {
id: "taintedgrailthefallofavalon",
name: "Tainted Grail: The Fall of Avalon",
shortName: "TG:FoA",
mergeMods: true,
queryPath: () =>
util.GameStoreHelper.findByAppId([STEAM_ID, GOG_ID]).then(
(game) => game.gamePath,
),
setup: (discovery) => fs.ensureDirAsync(path.join(discovery.path, MOD_PATH)),
logo: "gameart.png",
queryModPath: () => MOD_PATH,
executable: () => GAME_EXE_FILENAME,
requiredFiles: [GAME_EXE_FILENAME],
environment: {
SteamAPPId: STEAM_ID,
},
details: {
steamAppId: STEAM_ID,
gogAppId: GOG_ID,
},
};

export const BEPINEX5_DOWNLOAD_INFO: INexusDownloadInfo = {
gameId: GAME.id,
domainId: GAME.id,
modId: "50",
fileId: "162",
archiveName: "BepInEx Mono Windows x64-50-5-4-23-3-1752802821.zip",
architecture: "x64",
version: "5.4.23.3",
allowAutoInstall: false,
};

export const BEPINEX6_DOWNLOAD_INFO: INexusDownloadInfo = {
gameId: GAME.id,
domainId: GAME.id,
modId: "16",
fileId: "100",
archiveName: "BepinEx-16-6-0-0-be-735b-1749459702.zip",
architecture: "x64",
version: "6.0.0-be+735b", // Semver compliant version https://semver.org/#backusnaur-form-grammar-for-valid-semver-versions
allowAutoInstall: false,
};
Loading