forked from ebkr/r2modmanPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request ebkr#1079 from ethangreen-dev/votv-and-shimloader
Add Palworld + Voices of the Void support, initial Unreal engine support
- Loading branch information
Showing
22 changed files
with
453 additions
and
55 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
name: Build | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build: | ||
name: Test on ${{ matrix.platform }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- kind: linux | ||
os: ubuntu-latest | ||
platform: linux | ||
- kind: windows | ||
os: windows-latest | ||
platform: win | ||
- kind: mac | ||
os: macos-11 | ||
platform: osx | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Node | ||
uses: actions/setup-node@v3 | ||
with: | ||
# The talk on the street says this might be a good version for building. | ||
node-version: 14.20.1 | ||
cache: yarn | ||
|
||
- name: Install Yarn dependencies | ||
run: yarn install --frozen-lockfile | ||
|
||
- name: Run tests | ||
run: > | ||
node test/folder-structure-testing/populator.mjs && | ||
yarn run test:unit:ci |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
import { InstallArgs, PackageInstaller } from "./PackageInstaller"; | ||
import path from "path"; | ||
import FsProvider from "../providers/generic/file/FsProvider"; | ||
import FileTree from "../model/file/FileTree"; | ||
import FileUtils from "../utils/FileUtils"; | ||
import R2Error from "../model/errors/R2Error"; | ||
import { InstallRuleInstaller } from "./InstallRuleInstaller"; | ||
|
||
export class ShimloaderInstaller extends PackageInstaller { | ||
/** | ||
* Handle installation of unreal-shimloader | ||
*/ | ||
async install(args: InstallArgs) { | ||
const { | ||
mod, | ||
packagePath, | ||
profile, | ||
} = args; | ||
|
||
const fs = FsProvider.instance; | ||
const fileRelocations = new Map<string, string>(); | ||
|
||
const targets = [ | ||
["dwmapi.dll", "dwmapi.dll"], | ||
["UE4SS/ue4ss.dll", "ue4ss.dll"], | ||
["UE4SS/UE4SS-settings.ini", "UE4SS-settings.ini"], | ||
]; | ||
|
||
const ue4ssTree = await FileTree.buildFromLocation(path.join(packagePath, "UE4SS/Mods")); | ||
if (ue4ssTree instanceof R2Error) { | ||
throw ue4ssTree; | ||
} | ||
|
||
for (const subFile of ue4ssTree.getRecursiveFiles()) { | ||
const relSrc = path.relative(path.join(packagePath, "UE4SS/Mods"), subFile); | ||
|
||
targets.push([path.join("UE4SS/Mods", relSrc), path.join("shimloader/mod", relSrc)]); | ||
} | ||
|
||
for (const targetPath of targets) { | ||
const absSrc = path.join(packagePath, targetPath[0]); | ||
const absDest = path.join(profile.getPathOfProfile(), targetPath[1]); | ||
|
||
await FileUtils.ensureDirectory(path.dirname(absDest)); | ||
await fs.copyFile(absSrc, absDest); | ||
|
||
fileRelocations.set(absSrc, targetPath[1]); | ||
} | ||
|
||
// The config subdir needs to be created for shimloader (it will get cranky if it's not there). | ||
const configDir = path.join(profile.getPathOfProfile(), "shimloader", "cfg"); | ||
if (!await fs.exists(configDir)) { | ||
await fs.mkdirs(configDir); | ||
} | ||
} | ||
} | ||
|
||
export class ShimloaderPluginInstaller extends PackageInstaller { | ||
readonly installer = new InstallRuleInstaller({ | ||
gameName: "none" as any, // This isn't acutally used for actual installation but needs some value | ||
rules: [ | ||
{ | ||
route: path.join("shimloader", "mod"), | ||
isDefaultLocation: true, | ||
defaultFileExtensions: [], | ||
trackingMethod: "SUBDIR", | ||
subRoutes: [], | ||
}, | ||
{ | ||
route: path.join("shimloader", "pak"), | ||
defaultFileExtensions: [], | ||
trackingMethod: "SUBDIR", | ||
subRoutes: [], | ||
}, | ||
{ | ||
route: path.join("shimloader", "cfg"), | ||
defaultFileExtensions: [], | ||
trackingMethod: "NONE", | ||
subRoutes: [], | ||
} | ||
] | ||
}); | ||
|
||
async install(args: InstallArgs) { | ||
await this.installer.install(args); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
21 changes: 21 additions & 0 deletions
21
src/r2mm/launching/instructions/instructions/loader/ShimloaderGameInstructions.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import GameInstructionGenerator from '../GameInstructionGenerator'; | ||
import { GameInstruction } from '../../GameInstructions'; | ||
import Game from '../../../../../model/game/Game'; | ||
import Profile from '../../../../../model/Profile'; | ||
import * as path from 'path'; | ||
|
||
export default class ShimloaderGameInstructions extends GameInstructionGenerator { | ||
|
||
public async generate(game: Game, profile: Profile): Promise<GameInstruction> { | ||
const shimloader = path.join(profile.getPathOfProfile(), "shimloader"); | ||
|
||
const luaDir = path.join(shimloader, "mod"); | ||
const pakDir = path.join(shimloader, "pak"); | ||
const cfgDir = path.join(shimloader, "cfg"); | ||
|
||
return { | ||
moddedParameters: `--mod-dir "${luaDir}" --pak-dir "${pakDir}" --cfg-dir "${cfgDir}"`, | ||
vanillaParameters: "" | ||
} | ||
} | ||
} |
Oops, something went wrong.