Skip to content

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

Open
ThembaMahlangu wants to merge 1 commit intoqbcore-framework:mainfrom
ThembaMahlangu:fixes
Open

fix(menu): Improve menu focus handling and alt-key reliability#50
ThembaMahlangu wants to merge 1 commit intoqbcore-framework:mainfrom
ThembaMahlangu:fixes

Conversation

@ThembaMahlangu
Copy link

@ThembaMahlangu ThembaMahlangu commented May 4, 2025

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]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant