Skip to content

Button binding check should only error if both types of bind are missing #643

@Ungeziefi

Description

@Ungeziefi

Describe the bug
The !GameInputPatcher.BindableButtons.Contains check here passes even if just a controller bind or just a keyboard bind is missing. As an example with one of my mods, the error is the following:

Button 'TransferAllItemsButton' has a category but wasn't set to be bindable. Please set the button to be bindable first.

And the code for it is:

            TransferAllItemsButton = EnumHandler.AddEntry<GameInput.Button>("TransferAllItemsButton")
                .CreateInput("Transfer all items", "Hold this key and click an item to transfer all items.")
                .WithKeyboardBinding(InputPaths.Keyboard.Shift)
                .WithCategory("Container Utilities");

Which makes the error misleading. I think it should be thrown only if there are no WithKeyboardBinding and no WithControllerBinding.

To Reproduce
Steps to reproduce the behavior:

  1. Create a button in your mod that only has a keyboard bind or only has a controller bind
  2. Run the game
  3. Check the log
  4. See error

Expected behavior
Nautilus will throw the error in LogOutput.log.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions