InputAPI
Simple Modded Inputs API for Content Warning!
About this mod Author’s original text
CW_InputAPI
Requirements:
- BepInEx LTS (5.4.22)
For Developers:
Extend CWBaseInput to create new inputs. example: Inputs/ExampleInput.cs
using InputAPI;
using UnityEngine;
namespace Example.Inputs
{
internal class ExampleInput: BaseCWInput, IExposedSetting
{
public override KeyCode GetDefaultKey()
{
return KeyCode.BackQuote;
}
public string GetDisplayName()
{
return "FooBar";
}
public SettingCategory GetSettingCategory()
{
return SettingCategory.Controls;
}
protected override void OnHeld(Player player)
{
// Implementation goes here.
}
protected override void OnKeyDown(Player player)
{
// Implementation goes here.
}
protected override void OnKeyUp(Player player)
{
// Implementation goes here.
}
}
}
And to use it you can simply do this inside of your Plugin.cs!
[BepInPlugin(MyPluginInfo.PLUGIN_GUID, MyPluginInfo.PLUGIN_NAME, MyPluginInfo.PLUGIN_VERSION)]
[BepInDependency("com.visualerror.inputapi", BepInDependency.DependencyFlags.HardDependency)] // Be sure to have this!!
public class Plugin: BaseUnityPlugin
{
internal ExampleInput Example = new ExampleInput();
}
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.