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
Details
-
<async> findGame() → {Promise.<string>}
-
Description
Finds the game path for the specified Steam app ID.
Returns
Throws
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
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
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
Throws
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
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
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
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
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
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
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
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
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
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
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
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
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
Details