Methods


registerGame( context )

Description

Registers the game with the provided context.

Parameters
Name Type Description
context Object

The modding context object.

Details

registerInstallers( context )

Description

Registers the installers for the module.

Parameters
Name Type Description
context Object

The modding context object.

Details

setupEventListeners( context )

Description

Sets up event listeners for the module.

Parameters
Name Type Description
context Object

The modding context object.

Details

main( context ) → {boolean}

Description

The main function of the module.

Parameters
Name Type Description
context Object

The modding context object.

Returns
  • Returns true if the function executed successfully.
Details

<async> findGame() → {Promise.<string>}

Description

Finds the game path for the specified Steam app ID.

Returns

The game path.

Throws

If the game installation path is not found.

Details

<async> prepareForModding( discovery ) → {Promise.<boolean>}

Description

Prepares for modding by setting the global discovery path and checking the engine version.

Parameters
Name Type Description
discovery Object

The game discovery object.

Returns

A promise that resolves true if the modding setup is ensured successfully.

Details

<async> checkEngineVersion( discovery ) → {Promise.<boolean>}

Description

Checks the engine version by verifying the existence of UnityCrashHandler64.exe file.

Parameters
Name Type Description
discovery Object

The game discovery object containing the path to check.

Returns
  • A promise that resolves true if the engine version is valid, false otherwise.
Details

<async> ensureModdingSetup( discovery, isNewEngine ) → {Promise}

Description

Ensures the modding setup by checking for the existence of the correct mod loader. It checks for either MelonLoader or ModLoader based on the engine version.

Parameters
Name Type Description
discovery Object

The game discovery object containing the path to check.

isNewEngine boolean

Indicates whether the engine version is new or not.

Returns
  • A promise that resolves true if the mod loader check was successful.
Throws
  • If there is an error during the modding setup.
Details

<async> checkForVSModLoader( discovery ) → {boolean}

Description

Checks for the existence of VS Mod Loader.

Parameters
Name Type Description
discovery Object

The game discovery object containing the path to check.

Returns
  • Returns true if VS Mod Loader exists, false otherwise.
Details

<async> checkForMelonLoader( discovery ) → {boolean}

Description

Checks for the existence of MelonLoader.

Parameters
Name Type Description
discovery Object

The game discovery object containing the path to check.

Returns
  • Returns true if MelonLoader exists, false otherwise.
Details

<async> testSupportedContentOldEngine( files, gameId, modPath ) → {Promise.<{supported: boolean, requiredFiles: Array.<string>}>}

Description

Checks if the provided files are supported by the old game engine.

Parameters
Name Type Description
files Array.<string>

An array of file paths.

gameId string

The ID of the game.

modPath string

The path of where the mod is being installed.

Returns
  • An object containing the supported state and required files.
Details

<async> testSupportedContentNewEngine( files, gameId, modPath ) → {Promise.<{supported: boolean, requiredFiles: Array.<string>}>}

Description

Checks if the provided files are supported by the new game engine.

Parameters
Name Type Description
files Array.<string>

An array of file paths.

gameId string

The ID of the game.

modPath string

The path of where the mod is being installed.

Returns
  • An object containing the supported state and required files.
Details

<async> installContentOldEngine( files ) → {Promise.<Array.<Object>>}

Description

Installs the mod files for the old engine.

Parameters
Name Type Description
files Array.<string>

The files to be installed.

Returns
  • An array of objects containing the instructions for copying the files.
Details

prepareFilesOldEngine( files ) → {Array.<Object>}

Description

Prepares files for the old engine.

Parameters
Name Type Description
files Array.<string>

The array of files to be prepared.

Returns
  • The array of prepared files, each containing a source and destination path.
Details

<async> installContentNewEngine( files ) → {Promise.<Array.<Object>>}

Description

Installs the mod files for the new engine.

Parameters
Name Type Description
files Array.<string>

The files to be installed.

Returns
  • An array of objects containing the instructions for copying the files.
Details

prepareFilesNewEngine( files ) → {Array.<Object>}

Description

Prepares files for the new engine.

Parameters
Name Type Description
files Array.<string>

An array of files to be prepared.

Returns
  • An array of prepared files, each containing a source and destination path.
Details

<async> installContent( files ) → {Array.<Object>}

Description

Installs mod files by copying files from source to destination.

Parameters
Name Type Description
files Array.<Object>

An array of file objects containing source and destination paths.

Returns
  • An object containing the instructions for copying the files.
Details

<async> onDidInstallMod( gameId, archiveId, modId, context ) → {Promise}

Description

Handles the event when a mod is installed. When on old engine, it fixes the mod by editing the main mod file, if necessary.

Parameters
Name Type Description
gameId string

The ID of the game.

archiveId string

The ID of the mod archive (unused).

modId string

The ID of the mod.

context Object

The modding context object containing the API and state.

Returns
  • A promise that resolves when the function completes.
Details

fixGetMods( filePath ) → {boolean}

Description

Fixes a mods getMods function by removing the line that makes it fail (old engine only).

Parameters
Name Type Description
filePath string

The path to the mods main file.

Returns
  • Whether the fix was successful or not.
Details

findMainModFile( modPath ) → {string|undefined}

Description

Finds the main mod file in the specified mod path (old engine only).

Parameters
Name Type Description
modPath string

The path to the mod.

Returns
  • The path to the main mod file, or undefined if not found.
Details

findModsFolder( folderPath ) → {string|undefined}

Description

Recursively searches for the "mods" folder within the given folder path (old engine only).

Parameters
Name Type Description
folderPath string

The path of the folder to search in.

Returns
  • The path of the "mods" folder, or undefined if not found.
Details