IdleSlayerMods.Common
1.1.4-ML
See the version list below for details.
dotnet add package IdleSlayerMods.Common --version 1.1.4-ML
NuGet\Install-Package IdleSlayerMods.Common -Version 1.1.4-ML
<PackageReference Include="IdleSlayerMods.Common" Version="1.1.4-ML" />
<PackageVersion Include="IdleSlayerMods.Common" Version="1.1.4-ML" />
<PackageReference Include="IdleSlayerMods.Common" />
paket add IdleSlayerMods.Common --version 1.1.4-ML
#r "nuget: IdleSlayerMods.Common, 1.1.4-ML"
#:package IdleSlayerMods.Common@1.1.4-ML
#addin nuget:?package=IdleSlayerMods.Common&version=1.1.4-ML&prerelease
#tool nuget:?package=IdleSlayerMods.Common&version=1.1.4-ML&prerelease
Core library for my idle slayer mods
Getting started
In order to get started, simply download the mod from Nexus or from Nuget, then include it as a reference in your plugin project.
Current features:
Mod Utils
| static class ModUtils | Mod utility class, used for registering custom components |
|---|---|
| GameObject RegisterComponent<T> : where T is Component | Registers a unity component into the mod loader so that it is usable in the code |
Your unity components must be registered via this method before they are usable in your code.
RegisterComponent() can be called at any point, but must be called at any point before accessing your component.
For example:
var obj = new GameObject();
obj.AddComponent<MyCustomBehaviour>();
This code will break. The code below will also break, as the component is registered AFTER the call to add it to a GameObject
var obj = new GameObject();
obj.AddComponent<MyCustomBehaviour>();
ModUtils.RegisterComponent<MyCustomBehaviour>();
So that leaves, of course, registering your component BEFORE adding it to a GameObject
ModUtils.RegisterComponent<MyCustomBehaviour>();
var obj = new GameObject();
obj.AddComponent<MyCustomBehaviour>();
Mod Helper
| class ModHelper : MonoBehaviour | Instantiated Mod Helper that gets injected into the Game scene |
|---|---|
| event ModHelperMounted | Event that gets fired when the class has successfully been added to the Game scene |
| void ShowNotification() | Display a message in the center of the screen, similar to an event message |
| void ShowDialog() | Show a customisable dialog popup message |
| void ShowAchievement() | Show a customisable achievement style popup |
| void AddPanelButton() | Adds a button to the info panel. The same place as Achievements, Options, etc. |
Achievement Helper
| class AchievementHelper | Achievement helper class to manage achievements |
|---|---|
| static Achievement AddAchievement() | Instantiates a new Achievement scriptable object, and returns this object |
BaseConfig:
| abstract class BaseConfig | Base configuration class which can be inherited from |
|---|---|
| abstract void SetBindings | Takes in a ConfigFile and assigns it to the class instance |
| virtual MelonPreferences_Entry<T> Bind | Creates and assigns a new setting of type T |
Planned:
- Modded Achievement section in options
- Global list of modded achievements that can be appended to
- Simple UI button creation
- Custom random box events
- Custom plugin wrapper to make class injection and scene based component adding simpler
Usage
The ModHelper class is currently only accessible in the Game scene of Idle Slayer.
In order to make use of the ModHelper behaviour object, you can either:
- Make use of the
ModHelperMountedevent. - Find the injected
GameObjectand useGetComponent<ModHelper>().
Using the ModHelperMounted event (Method 1)
In your Plugin.cs, you'll need to add a static ModHelper variable. This is so that your MonoBehaviour classes will have access to the helper, via the Plugin class.
You then need to create a event delegate for the event handler which will return the ModHelper instance that exists in the game.
See example:
using IdleSlayerMods.Common;
public class Plugin : MelonMod
{
internal static ModHelper ModHelperInstance;
public override void OnInitializeMelon()
{
ModHelper.ModHelperMounted += SetModHelperInstance;
}
private static void SetModHelperInstance(ModHelper instance) => ModHelperInstance = instance;
}
To access within a MonoBehaviour script will then be as simple as:
using UnityEngine;
public class CustomBehaviour : MonoBehaviour
{
void Awake()
{
Plugin.ModHelperInstance.ShowNotification("Custom message!");
}
}
Using BaseConfig
Using the base config simplifies mod settings creation.
See Using BaseConfig
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net6.0 is compatible. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net6.0
- LavaGang.MelonLoader (>= 0.7.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | |
|---|---|---|---|
| 1.4.0-ML | 41 | 10/17/2026 | |
| 1.3.2-ML | 86 | 6/22/2026 | |
| 1.3.1-ML | 67 | 3/26/2026 | |
| 1.3.0-ML | 88 | 3/19/2026 | |
| 1.2.5-ML | 126 | 2/24/2026 | |
| 1.2.4-ML | 77 | 2/20/2026 | |
| 1.2.3-ML | 120 | 1/30/2026 | |
| 1.2.2-ML | 101 | 1/6/2026 | |
| 1.2.1-ML | 84 | 10/4/2025 | |
| 1.2.0-ML | 115 | 5/23/2025 | |
| 1.1.9-ML | 137 | 4/18/2025 | |
| 1.1.8-ML | 183 | 4/10/2025 | |
| 1.1.7-ML | 270 | 4/10/2025 | |
| 1.1.6-ML | 162 | 4/10/2025 | |
| 1.1.5-ML | 179 | 4/9/2025 | |
| 1.1.4-ML | 146 | 3/27/2025 | |
| 1.1.3-ML | 469 | 3/26/2025 | |
| 1.1.2-ML | 472 | 3/26/2025 | |
| 1.1.1-ML | 497 | 3/25/2025 |