commit 0b2c7409d7105d3a42fb0e253dcdde719923466c Author: tganter Date: Fri Apr 17 11:55:23 2026 +0000 Upload files to "/" diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..13275f1 --- /dev/null +++ b/.gitignore @@ -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 \ No newline at end of file diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..3c577b0 --- /dev/null +++ b/LICENSE @@ -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 \ No newline at end of file diff --git a/gameart.jpg b/gameart.jpg new file mode 100644 index 0000000..fd6e3c7 Binary files /dev/null and b/gameart.jpg differ diff --git a/index.js b/index.js new file mode 100644 index 0000000..cd01174 --- /dev/null +++ b/index.js @@ -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, +}; \ No newline at end of file diff --git a/info.json b/info.json new file mode 100644 index 0000000..1382395 --- /dev/null +++ b/info.json @@ -0,0 +1 @@ +{ "name": "Derail Valley", "author": "TotenKnopf", "version": "1.0.0", "description": "Support for Derail Valley" } \ No newline at end of file