qb-menu
qb-menu copied to clipboard
fix(menu): Improve menu focus handling and alt-key reliability
This PR fixes an issue with the menu focus system where the alt-key functionality becomes unresponsive until script is restarted. The fix implements proper focus state tracking and centralizes focus management to ensure reliable menu interactions.
Key changes:
- Added
menuFocusstate variable to track menu focus status - Created
setMenuFocusfunction to centralize focus state management - Modified
playerfocuscommand to prevent duplicate focus attempts - Replaced direct
SetNuiFocuscalls with the new centralized function
This fix is important for core functionality as it resolves a frustrating user experience where players need to restart the script to regain menu functionality.
Questions (please complete the following information):
- Have you personally loaded this code into an updated qbcore project and checked all it's functionality? [yes]
- Does your code fit the style guidelines? [yes]
- Does your PR fit the contribution guidelines? [yes]