Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Vehicle Hotkey Fix #38381

Merged
merged 5 commits into from
Mar 2, 2020
Merged

Vehicle Hotkey Fix #38381

merged 5 commits into from
Mar 2, 2020

Conversation

chrimchim
Copy link
Contributor

@chrimchim chrimchim commented Feb 26, 2020

Summary

SUMMARY: Bugfixes "Skips over reserved keybindings when creating a list for which tank to fill when interacting with vehicles"

Purpose of change

#26467 - Unable to use certain hotkeys when accessing filling tanks from the vehicle interaction menu.

Describe the solution

Uses simple logic to skip over certain keybindings that do not work when pressed.

Describe alternatives you've considered

Finding a way to make these keybindings usable in the fill menu, though I was unable to do this since I couldn't find what was using them

Testing

Created a vehicle with over 30 tanks to test very large hotkey lists, identified hotkeys they were unresponsive and skipped over them. after the normal hotkey list finishes the list moves into capital letters of which none are usable. I'm not sure how to fix this, so it may be a concern in the future.

Additional context

N/A - Fairly simple change.

@chrimchim chrimchim changed the title Veh hotkey Vehicle Hotkey Fix Feb 26, 2020
@ZhilkinSerg ZhilkinSerg added <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. Vehicles Vehicles, parts, mechanics & interactions labels Feb 27, 2020
@@ -1288,6 +1288,12 @@ bool veh_interact::overview( std::function<bool( const vehicle_part &pt )> enabl
if( hotkey == '{' ) {
hotkey = 'A';
}

for (int i = 0; i < 2; i++){
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe better this code?

while( hotkey == 'c' || hotkey == 'g'|| hotkey == 'j'|| hotkey == 'k'|| hotkey == 'l'|| hotkey == 'p'|| hotkey == 'q'|| hotkey == 't'|| hotkey == 'v'|| hotkey == 'x'|| hotkey == 'z' ) {
hotkey += 1;
}

Please do not forget to run Astyle for this code.

@8street
Copy link
Contributor

8street commented Feb 28, 2020

What happens if a user reassigns the specified keys in keybinding menu? Please test it.

@chrimchim
Copy link
Contributor Author

chrimchim commented Feb 28, 2020

There's a strange interaction with global keybindings. If you overwrite a global binding, it will cease to function in the vehicle fill/siphon menu. I'll keep testing to look for problems.

Secondary findings (edit):Completely removing a global binding doesn't have any affect on the menu, only overwriting the preset bindings disrupts bindings in the fill/siphon menu. Re-inputting these bindings resumes normal functions in the refill/siphon menu.

Tertiary findings (edit): When using the original code changing or overwriting the nonfunctional keys does not affect whether or not they work in the fill/siphon menus

@kevingranade kevingranade merged commit b4d7ab4 into CleverRaven:master Mar 2, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
<Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` Info / User Interface Game - player communication, menus, etc. Vehicles Vehicles, parts, mechanics & interactions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants