Methods
-
registerGame( context )
-
Description
Registers the game with the provided context.
Parameters
Name Type Description contextObject The modding context object.
Details
-
registerInstallers( context )
-
Description
Registers the installers for the module.
Parameters
Name Type Description contextObject The modding context object.
Details
-
setupEventListeners( context )
-
Description
Sets up event listeners for the module.
Parameters
Name Type Description contextObject The modding context object.
Details
-
main( context ) → {boolean}
-
Description
The main function of the module.
Parameters
Name Type Description contextObject 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 discoveryObject 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 discoveryObject 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 discoveryObject The game discovery object containing the path to check.
isNewEngineboolean 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 discoveryObject 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 discoveryObject 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 filesArray.<string> An array of file paths.
gameIdstring The ID of the game.
modPathstring 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 filesArray.<string> An array of file paths.
gameIdstring The ID of the game.
modPathstring 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 filesArray.<string> The files to be installed.
Returns
Details
-
prepareFilesOldEngine( files ) → {Array.<Object>}
-
Description
Prepares files for the old engine.
Parameters
Name Type Description filesArray.<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 filesArray.<string> The files to be installed.
Returns
Details
-
prepareFilesNewEngine( files ) → {Array.<Object>}
-
Description
Prepares files for the new engine.
Parameters
Name Type Description filesArray.<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 filesArray.<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 gameIdstring The ID of the game.
archiveIdstring The ID of the mod archive (unused).
modIdstring The ID of the mod.
contextObject 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 filePathstring 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 modPathstring 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 folderPathstring The path of the folder to search in.
Returns
Details