Table of Contents

Class HotKeyManager

Namespace
Bannerlord.ButterLib.HotKeys
Assembly
Bannerlord.ButterLib.dll

Describes a single HotKey group to which you can add individual HotKeyManager before building.

public abstract class HotKeyManager
Inheritance
HotKeyManager
Inherited Members

Fields

Categories

The available categories in the main menu for your hotkey to appear under.

public static readonly IReadOnlyDictionary<HotKeyCategory, string> Categories

Field Value

IReadOnlyDictionary<HotKeyCategory, string>

Methods

Add<T>()

Adds a hotkey to he manager ready for building.

public abstract T Add<T>() where T : HotKeyBase, new()

Returns

T

A new instance of HotKeyBase

Type Parameters

T

The HotKeyBase derived type to add.

Add<T>(T)

Adds a hotkey to the manager ready for building.

public abstract T Add<T>(T hotkey) where T : HotKeyBase

Parameters

hotkey T

The HotKeyBase to add.

Returns

T

The provided HotKeyBase (now initialized)

Type Parameters

T

The HotKeyBase derived type to add.

Exceptions

ArgumentException

Thrown when a hotkey with the same IdName exists.

Build()

Builds up the hotkeys and registers them with Bannerlord.

public abstract IReadOnlyList<HotKeyBase> Build()

Returns

IReadOnlyList<HotKeyBase>

Returns all the hotkeys that were built up.

Create(string)

Create a new HotKey group for your mod.

public static HotKeyManager? Create(string modName)

Parameters

modName string

The name of your mod.

Returns

HotKeyManager

A HotKeyManager object for you to start adding new HotKeyManager to.

Exceptions

ArgumentException

Thrown if a mod with the same name has already begun registering hotkeys.

CreateWithOwnCategory(string, string)

Create a new HotKey group for your mod with a separate entry on the Options Menu.

public static HotKeyManager? CreateWithOwnCategory(string modName, string categoryName)

Parameters

modName string

The name of your mod.

categoryName string

Category entry name in the Options Menu, supports translation

Returns

HotKeyManager

A HotKeyManager object for you to start adding new HotKeyManager to.

Exceptions

ArgumentException

Thrown if a mod with the same name has already begun registering hotkeys.