CBATeam / CBA_A3

Community Base Addons for Arma 3
https://github.com/CBATeam/CBA_A3/wiki
GNU General Public License v2.0
365 stars 148 forks source link

"Next/Prev Optics State" Block Vanilla keybinds in some cases if no additional optics state is found #1532

Open kennedy4273 opened 2 years ago

kennedy4273 commented 2 years ago

Description: If the binding for CBA "Next/Prev optics state" is bound to the same binding as the vanilla "Optics Mode," and a scope has no valid additional CBA optics state, it will block the use of the vanilla "Optics Mode" keybind. HOWEVER, the default Ctrl+Right Click will work, even if bound to both. This bug only seems to apply to additional keybinds.

Steps to reproduce:

Expected behavior: If no valid additional CBA optics states are found, the vanilla keybind should still switch optics modes. Some modded optics use CBA to switch optics states, some use the vanilla bind to switch optics mode. Since both accomplish the same goal (switching between different optics options), a single keybind able to handle both is ideal. Having this be an unused key means you don't have to do Ctrl+Right click, which can cause issues when moving.

Where did the issue occur? -Editor (Singleplayer) / Editor (Multiplayer) / Virtual Arsenal

Additional context: When you try to use the keybind it makes the noise as if CBA was trying to switch optics states, but nothing happens.

I also tested with a meme keybind like ' which is the vanilla "Sit Down" keybind. With it not bound in CBA, I switch optics and sit down. With it bound in CBA I hear the click as CBA attempts to change optics state, and then nothing happens, including the character NOT sitting down.

The next thing I tested is if I bound my additional key to a Use Action and bound that in CBA, and then the straight keybind in vanilla. Surprisingly that worked with no issues, so there is some weirdness going on here.

Again, the Left Control+Right Click keybind DOES work even if it's bound in both CBA and vanilla.

commy2 commented 2 years ago

This case maybe should not play a sound and return false.

https://github.com/CBATeam/CBA_A3/blob/master/addons/accessory/fnc_switchAttachment.sqf#L90-L95

Idk why it was chosen to be this way, but it seems scary to change it without good reason, since you likely upset people by changing how their keybinds work.