-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Vehicle Hotkey Fix #38381
Conversation
src/veh_interact.cpp
Outdated
@@ -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++){ |
There was a problem hiding this comment.
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.
What happens if a user reassigns the specified keys in keybinding menu? Please test it. |
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 |
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.