PreloadManager

版本 v1.0.1·更新於 2024-02-08

Lightweight preload patcher utility

截圖 共 5 張

模組介紹 作者原文

Preload Manager

Lightweight preload patcher utility

_IMPORTANT_: If used incorrectly you can really break plugins, I am not responsible for you breaking something in your pack. This should really only be used by modpack creators and mod developers who want an easy way to disable a plugin if it exists.

Why this exists

I had a request for my other plugins to remove LethalConfig as a dependency package to support a single use case.

Both other plugins have LethalConfig as a soft dependency so it can be removed if wanted, however, there is one use case where manually uninstalling it doesn't help.

That use case is when a modpack creator publishes a modpack with LethalConfig removed, when that modpack is installed via a mod manager, all dependencies are also downloaded even when not listed in the modpack.

This means a modpack creator who wants a specific experience, with a dependency removed, doesn't have a way to do that other than sharing a profile code.

Now obviously the best way to fix this is to have implement some way to ignore a specific dependency in the modpack config, but that doesn't exist right now from what I understand.

So I decided to write a small preload patching utility which lets anyone disable a plugin from loading if they want to.

Features

  • Disables the awake method in plugins that are configured in the config file
  • Easy usage by other mod developers who don't want to learn how to do this themselves
  • Feel free to fork it if you want to use this as a base for your own preload patcher (GitHub link can be found in the link at the top right)
  • Pattern protection so no one can just use wildcards to disable all mods
  • Ability to add a json file with plugin names if desired
  • See guide below

Potential Future Features

  • Allow a mod developer to...
  • Load their own methods at preload
  • Run their own methods for every plugin load event
  • I'll probably think of more later

Compatibility

This should be compatible with any mod, however, if you are trying to disable a mod which has its own preload patcher - you likely will have a bad time...

JSON Information

To make things easier I have created an extremely fast and efficient parallel recursive file search for any files named exactly.json in the Config or Plugin folder.

Using an exact file name ensures that it doesn't attempt to read just any json file, it will also ensure the least amount of required processing.

This also means anyone can make this mod a dependency for their mod and just add a single json file in their mods zip file to disable some other mod (or mods) for what ever reason.

JSON format

The format is very simple and is just a single string array you can learn more Here

[

"ModName",

"SomeOtherModName",

"AnotherOne"

]

Configuration

The config file is named.PreloadManager.cfg and will be located in the normal Config directory (also accessible via the mod manager config tab)

Disable Preloader

Want to disable this preloader entirely? Set this to true and it will just harmlessly return when initialized.

This will disable this preloader entirely

Setting type: Boolean

Default value: false

Disable Preloader = false

Disable Json Search

This will disable the parallel recursive file search for any files named exactly.json in the Config or Plugin folder. I use a very fast and performant method which searches even a modpack with 200+ mods extremely fast and efficiently (average time between 0.10 and 0.20 seconds).

Disable searching for any 'PreloadManager.json' files in the config and plugin directories

Setting type: Boolean

Default value: false

Disable Json Search = false

Mod List

This is where a modpack creator can list the mod names to disable, or path to a specific json file using the built in internal location/path variables (This can be used with 'Disable Json Search' if you don't want the file search but still want to use a json file). If this config item is empty (default) then this prel

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

BepInEx-BepInExPack

檔案與校驗

檔案名稱
PreloadManager-1.0.1.zip
檔案大小
71.4 KiB