SetInjectionFlagPlugin
Allows players to flag that mods are installed for BouncyRock
About this mod Author’s original text
Set Injection Flag Plugin
This is a plugin for TaleSpire using BepInEx. This plugin lets BouncyRock developers know that logs being generated are from vanilla or modded instances.
There is additional functionality for developers to enable dynamic auto-binding of plugin dependencies via Bepinex Chainloader.
Install
Easiest way to install this is via R2Modman
Usage
Just install, this will automatically update TaleSpire so the devs know you are doing modding work.
How to Compile / Modify
Open.sln in Visual Studio.
Build the project (Now using Nuget for package dependency).
Browse to the newly created /Debug or /Release folders and copy the.dll to \steamapps\common\TaleSpire\BepInEx\plugins
Developer usage of DependencyUnityPlugin
There is a new generic abstract class DependencyUnityPlugin that can be used instead of BaseUnityPlugin to help manage dependencies and plugin lifecycle better.
This class implements some new virtual methods that can be overridden to handle configuration setup, Awake and Destroy events that respects the bepinex chainloader.
By using the generic abstract class, Bepinex ChainLoader is respected whenever plugins are dynamically added/removed from the mod list, and the plugin can be enabled/disabled via config.
This is designed so the developer does not need to implement checks for whether the plugin is enabled/disabled or not, and can focus on the actual plugin logic.
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using ModdingTales;
using PluginUtilities;
// Before/Basic Implementation without Chainload binding or enabling/disabling
[BepInPlugin(Guid, Name, Version)]
[BepInDependency(SetInjectionFlag.Guid)]
MyPluginA: BaseUnityPlugin
{
// Consts to describe the plugin
public const string Guid = "Your.PluginA.Guid.Here";
public const string Name = "Your PluginA Name";
public const string Version = "0.0.0.0";
// Config Entries
internal static ConfigEntry Value;
void Awake()
{
Value = Config.Bind("General", nameof(Value), 100);
Logger.LogInfo($"In Awake for {Name}");
harmony = new Harmony(Guid);
harmony.PatchAll();
// Registers Plugin in Mod List UI (Automatically added/removed if use DependencyUnityPlugin or DependencyUnityPlugin)
ModdingUtils.AddPluginToMenuList(this);
// Do Some Other Work Here
}
}
// After/Proper Implementation with Chainload binding and enabling/disabling plus config setup and lifecycle management
[BepInPlugin(Guid, Name, Version)]
[BepInDependency(SetInjectionFlag.Guid)]
MyPluginB: DependencyUnityPluginB
{
// Consts to describe the plugin
public const string Guid = "Your.PluginB.Guid.Here";
public const string Name = "Your PluginB Name";
public const string Version = "0.0.0.0";
// tracking Harmony here for unpatching on destroy
internal static Harmony harmony;
// Config Entries
internal static ConfigEntry Value;
// Config Entry Callbacks
private static void ConfigEntryUpdateCallback(object _)
{
// Something to do when config entry is updated (not to be confused with enabled which is from UnityEngine.Behaviour)
if (Enabled) {
// Plugin is enabled so we should do something
} else {
// Plugin is disabled so we can ignore the callback
}
}
// Implement your config binding here
protected override void OnSetupConfig(ConfigFile config)
{
// Create attribute for config entry
ConfigurationAttributes configurationAttributes = new ConfigurationAttributes
{
CallbackAction = ConfigEntryUpdateCallback
};
// Create description for config entry
ConfigDescription myConfigDescription = new ConfigDescription("", null, configurationAttributes);
// Bind with description and attributes
Value = Config.Bind("General", nameof(Value), 100, myConfigDescription);
}
// Implement code to run on Awake here (if the plugin is enabled)
protected override void OnAwake()
{
Logger.LogInfo($"In Awake for {Name}");
harmony = new Harmony(Guid);
harmony.PatchAll();
// Do Some Other Work Here
}
// Implement code to run on Destr
Install & use Install: follow the bundled instructions
- Unzip the archive from playbuff and read the bundled readme / instructions first.
- Most mods rely on the game's mod loader — the usual route is a community mod manager (such as r2modman): pick this game, install, and it handles the loader and dependencies.
- For a manual install, put the mod files into the matching Mod / plugins folder inside the game directory.
- Launch the game to confirm it loaded; mods with listed dependencies need those installed as well.
Install locations vary a lot between mods — the bundled readme is the most reliable guide.
Install these first, or the mod will not work: