BepisResoniteWrapper
Common hooks and events library for BepInEx Resonite mods. Provides essential events like OnEngineReady to simplify mod development.
模組介紹 作者原文
BepisResoniteWrapper
A Resonite BepInEx library (not a standalone mod) that provides commonly-used hooks and events for other BepInEx mods. This library simplifies mod development by offering ready-to-use events like OnEngineReady.
Installation (Manual)
- Install BepisLoader for Resonite.
- Download the latest release ZIP file (e.g., ResoniteModding-BepisResoniteWrapper-1.0.0.zip) from the Releases page.
- Extract the ZIP and copy the plugins folder to your BepInEx folder in your Resonite installation directory:
- Default location: C:\Program Files (x86)\Steam\steamapps\common\Resonite\BepInEx\
- Start the game. If you want to verify that the mod is working you can check your BepInEx logs.
Usage for Developers
Adding BepisResoniteWrapper to Your Mod
- Add the NuGet package reference to your mod's.csproj file:
- Add it as a dependency in your.toml:
[package.dependencies]
ResoniteModding-BepisResoniteWrapper = "1.0.0"
Using the Events
Subscribe to events in your BepInEx plugin:
using BepisResoniteWrapper;
public class MyMod: BasePlugin
{
public override void Load()
{
// Subscribe to the OnEngineReady event
ResoniteHooks.OnEngineReady += OnEngineReady;
}
private void OnEngineReady()
{
// The Resonite engine is now fully initialized
// Safe to access FrooxEngine classes and functionality
Log.LogInfo("Engine is ready with version: " + Engine.Current.VersionString);
}
}
Available Events
- OnEngineReady - Fired when the Resonite engine has finished.
- No parameters - the engine instance can be accessed via Engine.Current
For Library Contributors
To add new hooks to this library:
- Create a new hook class in the BepisResoniteWrapper/Hooks/ folder
- Add the corresponding event to the ResoniteHooks class in Api.cs
- Follow the pattern used in EngineReadyHook.cs:
- Use [HarmonyPatchCategory] attribute for organization
- Use [HarmonyPatch] to target the method to hook
- Implement Prefix/Postfix methods as needed
- Call the appropriate event from ResoniteHooks
安裝與使用 安裝:按包內說明操作
- 解壓本站下載的壓縮包,先讀包內的 readme / 說明檔案。
- 多數模組依賴遊戲的模組載入器:常見做法是用社群模組管理器(如 r2modman)選中本遊戲安裝,由管理器自動處理載入器與依賴。
- 手動安裝時,把模組檔案放進遊戲目錄下對應的 Mod / plugins 資料夾。
- 啟動遊戲確認載入成功;帶「前置依賴」的模組需要把依賴一併安裝。
不同模組的安裝位置差異較大,包內說明是最可靠的依據。
下面這些內容需要先安裝,否則該模組不會生效: