Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FO4 & SkyrimSE & ConanExiles - Add Epic Support #153

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
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
36 changes: 32 additions & 4 deletions game-conanexiles/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@ const { fs, selectors, util } = require('vortex-api');

const GAME_ID = 'conanexiles';
const STEAMAPP_ID = 440900;
const EPICAPP_ID = '';
const STOP_PATTERNS = ['[^/]*\\.pak$'];

function toWordExp(input) {
return '(^|/)' + input + '(/|$)';
}

function queryPath() {
return util.GameStoreHelper.findByAppId([STEAMAPP_ID.toString()])
return util.GameStoreHelper.findByAppId([STEAMAPP_ID.toString(), EPICAPP_ID])
.then(game => game.gamePath);
}

Expand Down Expand Up @@ -50,6 +51,20 @@ async function writeLoadOrder(api, order) {
}
}

async function requiresLauncher(gamePath, store) {

const epicSettings = {
launcher: 'epic',
addInfo: {
appId: EPIC_ID,
}
};

//if (store === 'epic') return epicSettings;
//else return undefined;
return undefined;
}

function main(context) {
context.registerGame({
id: GAME_ID,
Expand All @@ -58,17 +73,31 @@ function main(context) {
mergeMods: true,
queryPath,
queryModPath,
executable: () => path.join('ConanSandbox', 'Binaries', 'Win64', 'ConanSandbox.exe'),
requiredFiles: ['ConanSandbox.exe'],
requiresLauncher,
//executable: () => 'ConanSandbox.exe',
executable: (discoveredPath) => {
try {
const epicPath = path.join('ConanSandboxEgs.exe');
fs.statSync(path.join(discoveredPath, epicPath));
return epicPath;
}
catch (err) {
return path.join('ConanSandbox.exe');
}
},
requiredFiles: ['ConanSandbox'],
setup,
environment: {
SteamAPPId: STEAMAPP_ID.toString(),
EpicAPPId: EPICAPP_ID
},
details: {
steamAppId: STEAMAPP_ID,
epicAppId: EPICAPP_ID,
stopPattern: STOP_PATTERNS.map(toWordExp),
hashFiles: [
'ConanSandbox.exe',
//'ConanSandboxEgs.exe',
'Manifest_UFSFiles_Win64.txt',
'ConanSandbox/AssetRegistry.bin'
]
Expand All @@ -93,4 +122,3 @@ function main(context) {
module.exports = {
default: main
};

4 changes: 2 additions & 2 deletions game-conanexiles/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Game: Conan Exiles",
"author": "Black Tree Gaming Ltd.",
"version": "1.0.0",
"version": "1.1.0",
"description": "Support for Conan Exiles"
}
}
56 changes: 42 additions & 14 deletions game-fallout4/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ const IGNORED_FILES = [ path.join('**', 'PersistantSubgraphInfoAndOffsetData.txt
const MS_ID = 'BethesdaSoftworks.Fallout4-PC';
const GOG_ID = '1998527297';
const EPIC_ID = '61d52ce4d09d41e48800c22784d13ae8';
const STEAM_ID = '377160';

let tools = [
{
Expand Down Expand Up @@ -58,18 +59,40 @@ let tools = [
}
];

function requiresLauncher(gamePath) {
return util.GameStoreHelper.findByAppId([MS_ID], 'xbox')
.then(() => Promise.resolve({
launcher: 'xbox',
addInfo: {
appId: MS_ID,
parameters: [
{ appExecName: 'Game' },
],
}
}))
.catch(err => Promise.resolve(undefined));
async function requiresLauncher(gamePath, store) {
const xboxSettings = {
launcher: 'xbox',
addInfo: {
appId: MS_ID,
parameters: [
{ appExecName: 'Game' },
],
}
};

const epicSettings = {
launcher: 'epic',
addInfo: {
appId: EPIC_ID,
}
};

if (store !== undefined) {
if (store === 'xbox') return xboxSettings;
if (store === 'epic') return epicSettings;
else return undefined;
}

// Store type isn't detected. Try and match the Xbox path.
try {
const game = await util.GameStoreHelper.findByAppId([MS_ID], 'xbox');
const normalizeFunc = await util.getNormalizeFunc(gamePath);
if (normalizeFunc(game.gamePath) === normalizeFunc(gamePath)) return xboxSettings;
else return undefined;
}
catch(err) {
return undefined;
}
}

function main(context) {
Expand All @@ -93,11 +116,16 @@ function main(context) {
],
requiresLauncher,
environment: {
SteamAPPId: '377160',
SteamAPPId: STEAM_ID,
GogAPPId: GOG_ID,
XboxAPPId: MS_ID,
EpicAPPId: EPIC_ID,
},
details: {
steamAppId: 377160,
steamAppId: STEAM_ID,
gogAppId: GOG_ID,
xboxAppId: MS_ID,
epicAppId: EPIC_ID,
ignoreConflicts: IGNORED_FILES,
compatibleDownloads: ['fallout4london'],
hashFiles: [
Expand Down
2 changes: 1 addition & 1 deletion game-fallout4/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Game: Fallout 4",
"author": "Black Tree Gaming Ltd.",
"version": "1.0.6",
"version": "1.0.7",
"description": "Support for Fallout 4"
}
24 changes: 21 additions & 3 deletions game-skyrimse/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ const GAME_ID = 'skyrimse';
const GOG_ID = '1711230643';
const MS_ID = 'BethesdaSoftworks.SkyrimSE-PC';
const EPIC_ID = 'ac82db5035584c7f8a2c548d98c86b2c';
const STEAM_ID = '489830';

const tools = [
{
Expand Down Expand Up @@ -83,11 +84,22 @@ function requiresLauncher(gamePath, store) {
}
};

const epicSettings = {
launcher: 'epic',
addInfo: {
appId: EPIC_ID,
}
};

if (store !== undefined) {
// early out if the app gave us the storeid
if (store === 'xbox') {
return Promise.resolve(xboxSettings);
} else {
}
if (store === 'epic') {
return Promise.resolve(epicSettings);
}
else {
return Promise.resolve(undefined);
}
}
Expand Down Expand Up @@ -159,10 +171,16 @@ function main(context) {
requiresLauncher,
getGameVersion: (gamePath, exePath) => getGameVersion(context.api, gamePath, exePath),
environment: {
SteamAPPId: '489830',
SteamAPPId: STEAM_ID,
GogAPPId: GOG_ID,
XboxAPPId: MS_ID,
EpicAPPId: EPIC_ID,
},
details: {
steamAppId: 489830,
steamAppId: STEAM_ID,
gogAppId: GOG_ID,
xboxAppId: MS_ID,
epicAppId: EPIC_ID,
nexusPageId: 'skyrimspecialedition',
hashFiles: [
'appxmanifest.xml',
Expand Down
4 changes: 2 additions & 2 deletions game-skyrimse/info.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Game: Skyrim: Special Edition",
"author": "Black Tree Gaming Ltd.",
"version": "1.0.5",
"version": "1.0.6",
"description": "Support for The Elder Scrolls V: Skyrim Special Edition"
}
}