Upload files to "/"
This commit is contained in:
+30
@@ -0,0 +1,30 @@
|
||||
### IntelliJ IDEA ###
|
||||
out/
|
||||
!**/src/main/**/out/
|
||||
!**/src/test/**/out/
|
||||
.kotlin
|
||||
|
||||
### Eclipse ###
|
||||
.apt_generated
|
||||
.classpath
|
||||
.factorypath
|
||||
.project
|
||||
.settings
|
||||
.springBeans
|
||||
.sts4-cache
|
||||
bin/
|
||||
!**/src/main/**/bin/
|
||||
!**/src/test/**/bin/
|
||||
|
||||
### NetBeans ###
|
||||
/nbproject/private/
|
||||
/nbbuild/
|
||||
/dist/
|
||||
/nbdist/
|
||||
/.nb-gradle/
|
||||
|
||||
### VS Code ###
|
||||
.vscode/
|
||||
|
||||
### Mac OS ###
|
||||
.DS_Store
|
||||
@@ -0,0 +1,24 @@
|
||||
This is free and unencumbered software released into the public domain.
|
||||
|
||||
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||
distribute this software, either in source code form or as a compiled
|
||||
binary, for any purpose, commercial or non-commercial, and by any
|
||||
means.
|
||||
|
||||
In jurisdictions that recognize copyright laws, the author or authors
|
||||
of this software dedicate any and all copyright interest in the
|
||||
software to the public domain. We make this dedication for the benefit
|
||||
of the public at large and to the detriment of our heirs and
|
||||
successors. We intend this dedication to be an overt act of
|
||||
relinquishment in perpetuity of all present and future rights to this
|
||||
software under copyright law.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
OTHER DEALINGS IN THE SOFTWARE.
|
||||
|
||||
For more information, please refer to <https://unlicense.org>
|
||||
BIN
Binary file not shown.
|
After Width: | Height: | Size: 136 KiB |
@@ -0,0 +1,83 @@
|
||||
//Import some assets from Vortex we'll need.
|
||||
const path = require('path');
|
||||
const { fs, log, util } = require('vortex-api');
|
||||
const GAME_ID = 'derailvalley'; // Nexus Mods domain for the game. e.g. nexusmods.com/derailvalley
|
||||
const STEAMAPP_ID = '588030'; //Steam Application ID, you can get this from https://steamdb.info/apps/
|
||||
const MOD_FILE_EXT = ".pak";
|
||||
|
||||
|
||||
function main(context) {
|
||||
//This is the main function Vortex will run when detecting the game extension.
|
||||
|
||||
context.registerGame({
|
||||
id: GAME_ID,
|
||||
name: 'Derail Valley',
|
||||
mergeMods: true,
|
||||
queryPath: findGame,
|
||||
supportedTools: [],
|
||||
queryModPath: () => 'Mods',
|
||||
logo: 'gameart.jpg',
|
||||
executable: () => 'DerailValley.exe',
|
||||
requiredFiles: [
|
||||
'DerailValley.exe',
|
||||
],
|
||||
setup: prepareForModding,
|
||||
environment: {
|
||||
SteamAPPId: STEAMAPP_ID,
|
||||
},
|
||||
details: {
|
||||
steamAppId: STEAMAPP_ID,
|
||||
stopPatterns: [
|
||||
'(^|/)Info.json(/|$)',
|
||||
],
|
||||
},
|
||||
});
|
||||
|
||||
context.registerInstaller('derailvalley-mod', 25, testSupportedContent, installContent);
|
||||
|
||||
function testSupportedContent(files, gameId) {
|
||||
// we check for the existence of an Info.json file in any subdirectory
|
||||
return Promise.resolve({
|
||||
supported: files.some(file => path.basename(file).toLowerCase() === 'info.json'),
|
||||
priority: 25,
|
||||
});
|
||||
}
|
||||
|
||||
function installContent(files, destinationPath, gameId, installOptions) {
|
||||
const infoJson = files.find(file => path.basename(file).toLowerCase() === 'info.json');
|
||||
const rootPath = path.dirname(infoJson);
|
||||
const filteredFiles = files.filter(file => {
|
||||
const isChild = (rootPath === '.') ? true : file.startsWith(rootPath);
|
||||
const isNotDirectory = !file.endsWith('/') && !file.endsWith('\\');
|
||||
return isChild && isNotDirectory;
|
||||
});
|
||||
|
||||
const modName = (rootPath !== '.') ? path.basename(rootPath) : (installOptions.modName || installOptions.name || path.basename(destinationPath) || 'UnknownMod');
|
||||
|
||||
const instructions = filteredFiles.map(file => {
|
||||
const relativePath = (rootPath === '.') ? file : path.relative(rootPath, file);
|
||||
return {
|
||||
type: 'copy',
|
||||
source: file,
|
||||
destination: path.join(modName, relativePath).replace(/\\/g, '/'),
|
||||
};
|
||||
});
|
||||
|
||||
return Promise.resolve({ instructions });
|
||||
}
|
||||
|
||||
function findGame() {
|
||||
return util.GameStoreHelper.findByAppId([STEAMAPP_ID])
|
||||
.then(game => game.gamePath);
|
||||
}
|
||||
|
||||
function prepareForModding(discovery) {
|
||||
return fs.ensureDirWritableAsync(path.join(discovery.path, 'Mods'));
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
default: main,
|
||||
};
|
||||
Reference in New Issue
Block a user