syyePhenomenol / ControllerFixes

A Hollow Knight mod that fixes some controller issues and adds related features.
1 stars 2 forks source link

Face buttons are switched in the Nintendo Layout #1

Open Clozent opened 8 months ago

Clozent commented 8 months ago

When looking at the controller settings and viewing button prompts with the button skin type set to 1, it appears that the Y and X buttons are switched (It says X to attack and Y for Dream Nail, for example). Turning on Steam Nintendo Layout in the settings makes the X and Y mappings correct, but switches A and B instead.

Edit: In the Controller settings, all of the face buttons are actually in the wrong positions, no matter if Steam Nintendo Layout is enabled or not.

syyePhenomenol commented 7 months ago

Hi, thanks for the report. Sorry for addressing this quite late.

If you can, could you check if the following build fixes your problem? Unzip and copy the "ControllerFixes" folder into your "Mods" folder.

ControllerFixes.zip

Clozent commented 7 months ago

Sorry for the delay, I kept forgetting to test this. The build you provided makes all of the buttons flipped: image And the Steam Nintendo Layout option now does nothing...

syyePhenomenol commented 7 months ago

Thanks for the update. I'm not the original author of this part of the code so I am trying to work it out as we go.

But from what I noticed, the code never does anything to change the mapping shown in the layout UI.

The swapped mapping you see in the layout UI is actually the "true" mapping, but in the remap menu the shown sprites are wrong.

syyePhenomenol commented 7 months ago

ControllerFixes.zip

Please try the attached build. Reset your controller mappings first and then let me know if things are working as they should.

Clozent commented 7 months ago

Okay, quick update: I am dumb, and didn't check the first patch in actual gameplay. I forgot it doen't really reflect in the Controller settings screen.

So:

In my opinion, the release version (and, by extension, the first patch of this issue) have the better Controller settings screen, because if it can't be correct anyways, it's better to at least get the controller sprite right. The first patch is better than the second because it actually works in gameplay.

Sorry for the hassle, by the way. I should have been more thorough with my testing...

syyePhenomenol commented 7 months ago

Thanks for the further testing. (and no problem with the mixup since there is some on my side as well)

The first "patch" actually swapped the sprites for the Xbox controller remapping (my mistake) so in your case there was effectively no change compared to the release version. The only versions worth comparing are release and patch 2.

Based on what you said, would it be better if, in the controller menu (NOT the remapping menu), instead of the position of the A/B and X/Y sprites swapping, the position of the bindings were swapped?

Clozent commented 7 months ago

Based on what you said, would it be better if, in the controller menu (NOT the remapping menu), instead of the position of the A/B and X/Y sprites swapping, the position of the bindings were swapped?

If by that you mean the line that points to the name of the action, then yes, absolutely.

syyePhenomenol commented 7 months ago

ControllerFixes.zip Please reset your mappings then see if this version has the controller menu working as intended.

Clozent commented 7 months ago

Okay, so this patch does switch the positions of the bindings to be correct in the controller menu (when using the Steam Nintendo Layout), which is awesome. The problem is, it is now the same as before in actual gameplay: A and B are switched in button prompts, such as in the map.

Clozent commented 6 months ago

Hey, I've been waiting for a while for your response. If you don't have time to work on the mod, do you mind giving me the source code of the three patches you've posted here? Since two of them individually fix one of the two problems, I can try to combine them and make a pull request.

syyePhenomenol commented 6 months ago

Hi, I apologise for the late response, I have been quite busy with other work. When I get home I will make a branch of the latest code for you to experiment with. Thanks

syyePhenomenol commented 6 months ago

The branch with the latest fix is up. I'm not sure if the changes I made prior to that will help with what you want. I want to ask for more clarification first.

I think the underlying problem (and source of confusion) is that the menu bindings are independent of the controller mappings, but depend on the controller used. From what I understand Nintendo controllers normally have A (right position) for select and B (down position) for cancel. And B is jump and A is focus by default.

Whereas on Xbox A (down position) is select and B (right position) is cancel, and A is jump and B is focus.

When you toggle Nintendo Layout from Steam (outside of the game) while using a Nintendo controller, do the menu bindings also swap or remain the same?

Clozent commented 6 months ago

Here are some clarifications that I forgot to mention:

The official gamepad layout (the default) for Hollow Knight in steam looks like this:

Without Nintendo Button Layout With Nintendo Button Layout
The button mappings without Nintendo Button Layout The button mappings with Nintendo Button Layout

In game (without the mod, with Nintendo Button Layout enabled), the controls work as expected. Pressing B, the bottom face button, closes the map, for example. The button prompts, though, display the buttons that are in the correct position, but on an Xbox controller, so instead of prompting me to close the map with B, it displays the A button (Since it's the bottom face button on an Xbox controller).

I fixed the mod, though, thanks to the branch you added. The changes to the binding positions in the controller menu were already implemented, so all that was left was to change the button prompts themselves. The code that changes the button prompts is pretty easy to understand, so I tried to switch the A and B buttons and it worked right away. I have made a pull request to the v1.0.3 branch with the fix.

syyePhenomenol commented 6 months ago

https://github.com/syyePhenomenol/ControllerFixes/releases/download/v1.0.3/ControllerFixes.zip

I added a toggle to override the menu prompts. If you are happy with how it functions now, I will update the public build.

Thanks a lot for the help!