-
Notifications
You must be signed in to change notification settings - Fork 4
Open
Description
Hi, I'm working on converting all my cheat hotkeys to ButterLib's hotkey implementation.
Unfortunately I am unable to create a custom hotkey category. Whenever I try to set a custom category, the hotkeys do not show up or the game freezes on opening the options menu.
I was trying to do something like this:
public class SubModule : MBSubModuleBase
{
protected override void OnBeforeInitialModuleScreenSetAsRoot()
{
base.OnBeforeInitialModuleScreenSetAsRoot();
var manager = HotKeyManager.CreateWithOwnCategory("BannerlordCheats", "Cheats");
manager.Add<AddMoneyHotkey>();
manager.Build();
}
...
}
public class AddMoneyHotkey : HotKeyBase
{
public AddMoneyHotkey() : base(nameof(AddMoneyHotkey))
{
this.Category = "Cheats";
this.DisplayName = "Add 1.000 Gold";
this.DefaultKey = InputKey.F10;
this.Description = "...";
this.Predicate = () => ScreenManager.TopScreen is GauntletInventoryScreen;
}
protected override string DisplayName { get; }
protected override string Description { get; }
protected override InputKey DefaultKey { get; }
protected override string Category { get; }
...
}
Am I missing something?
Metadata
Metadata
Assignees
Labels
No labels