Fix: RadialMenu seat changing menu and add missing language options in en locale #66
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does your pull request change?
This pull request addresses the issue with the vehicle seat changing menu in qbx_radialmenu. The original implementation relied on a loop that checked continuously for a vehicle, which was inefficient. The code has been refactored to remove the default loop, streamline the logic, and improve performance.
The updated code registers the seat change menu only when the player enters a vehicle and ensures that the correct seats are available based on the vehicle's configuration.
Why should it be merged?
This refactor improves performance by eliminating the unnecessary loop that ran continuously. It also makes the vehicle seat changing menu more efficient by only triggering when the player is in a vehicle. Additionally, the code was reorganized to improve readability and maintainability.
Does it fix an issue?
Yes, it resolves Issue #49 regarding the vehicle seat changing menu.
Changes:
while true
loop, which was inefficient.Before:
The previous implementation continuously checked if the player was in a vehicle and was inefficient because it used a loop to detect this, even when the player wasn’t interacting with the vehicle.
After:
The new implementation registers the vehicle seat menu only when the player is in a vehicle, making the system more efficient. It also ensures that the vehicle seat options are dynamically generated based on the number of seats available in the vehicle.