🧰🕷️🔧 💻⚙️
In-game plugin management and settings
A BepInEx plugin for the game SpiderHeck
- Drop-in: drag the .dll into your plugins folder, and that's it!
- Automatic mod detection: enable/disable any installed mod, without needing setup from the developer.
- Settings API: mod developers can register for their own options menu~
- In-game UI: change settings via the in-game UI, without having to search through
every.single.config.file.cfg - Online support: (Planned!)
-
Locate your SpiderHeck install directory
Steam library->Right click SpiderHeck->Manage->Browse local files.
On Windows, it will typically be located at
C:\Program Files (x86)\Steam\steamapps\common\SpiderHeck. -
Install BepInEx 6
-
Install ModManager
- Download the latest release.
- Extract the contents into your SpiderHeck directory.
-
Add a reference to ModManager.dll
Either via NuGet
<ItemGroup> <PackageReference Include="Senyksia.SpiderHeck.ModManager" Version="0.1.*" /> </ItemGroup>
Or by including the .dll manually
<ItemGroup> <Reference Include="ModManager" /> </ItemGroup>
-
Flag ModManager as a dependency
[BepInDependency("senyksia.spiderheck.modmanager", BepInDependency.DependencyFlags.HardDependency)] // ... internal class MyPlugin : BaseUnityPlugin
Registering for an options menu is as simple as
new OptionsMenu("My Mod!");From there, you can add whichever options you need!
OptionsMenu optionsMenu = new OptionsMenu("My Mod!");
optionsMenu.AddToggle("A toggle", Config.Bind<bool>("Main", "aToggle", true))
optionsMenu.AddToggle("Another toggle", Config.Bind<bool>("Main", "anotherToggle", false))As you can see, adding an option element requires a ConfigEntry. This is what will hold the current value of the option - ModManager just handles binding it to a new UI element. For more information on ConfigEntry and BepInEx configuration files, see this article.
A realistic example might look like this:
using BepInEx;
using BepInEx.Configuration;
using ModManager.UI;
namespace HugeSpiders
{
[BepInDependency("senyksia.spiderheck.modmanager", BepInDependency.DependencyFlags.HardDependency)]
[BepInPlugin("senyksia.spiderheck.hugespiders", "HugeSpiders", "1.0.0")]
[BepInProcess("SpiderHeckApp.exe")]
internal class HugeSpiders : BaseUnityPlugin
{
public readonly ConfigEntry<float> sizeMultiplier;
public readonly ConfigEntry<bool> doCollision;
private HugeSpiders() : base()
{
sizeMultiplier = Config.Bind("Main", "SizeMultiplier", 2f, "How much to multiply the spider's radius by.");
doCollision = Config.Bind("Main", "DoCollision", true, "Should the spider's collision box be increased too?");
OptionsMenu optionsMenu = new OptionsMenu("Huge Spiders");
//optionsMenu.AddInputField("Size multiplier", sizeMultiplier); still need to add lol
optionsMenu.AddToggle("Increase spider collision", doCollision);
}
private void Awake()
{
Logger.LogInfo($"Increasing spider size by {sizeMultiplier.Value}x!");
}
}
}-
Clone the latest source code
git clone https://github.com/Senyksia/SH-ModManager.git -
Link to your SpiderHeck directory
Create a file called
ModManager.csproj.usernext toModManager.csproj.<?xml version="1.0" encoding="utf-8"?> <Project> <PropertyGroup> <GameFolder>path\to\SpiderHeck</GameFolder> <!-- User-defined absolute path to SpiderHeck --> <ReferencePath>$(ReferencePath);$(GameFolder)\SpiderHeckApp_Data\Managed</ReferencePath> <!-- Path to the SH game assemblies --> <AssemblySearchPaths>$(AssemblySearchPaths);$(ReferencePath)</AssemblySearchPaths> <!-- Add that path to the assembly search list --> </PropertyGroup> </Project>
Replace
path\to\SpiderHeckwith the absolute path to your SpiderHeck directory. E.g.<GameFolder>C:\Program Files (x86)\Steam\steamapps\common\SpiderHeck</GameFolder>
-
Compile
Using Visual Studio, a copy of the compiled .dll should be placed directly in your mod folder.
Note The game needs to be closed while compiling.
See CHANGELOG.md for version changes.