qb-menu icon indicating copy to clipboard operation
qb-menu copied to clipboard

fix(menu): Improve menu focus handling and alt-key reliability

Open ThembaMahlangu opened this issue 11 months ago • 0 comments

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 menuFocus state variable to track menu focus status
  • Created setMenuFocus function to centralize focus state management
  • Modified playerfocus command to prevent duplicate focus attempts
  • Replaced direct SetNuiFocus calls 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]

ThembaMahlangu avatar May 04 '25 11:05 ThembaMahlangu