Skip to content
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

Fix: RadialMenu seat changing menu and add missing language options in en locale #66

Merged
merged 5 commits into from
Dec 18, 2024

Conversation

frostfire575
Copy link
Contributor

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:

  • Replaced the previous loop-based system with event-based logic that triggers when the player enters a vehicle.
  • Removed unnecessary while true loop, which was inefficient.
  • Optimized code structure for better readability and performance.
  • Added missing language options in the menu.

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.

  • I have personally loaded this code into an updated Qbox project and checked all of its functionality.
  • My pull request fits the contribution guidelines & code conventions.

@frostfire575 frostfire575 reopened this Dec 18, 2024
@frostfire575 frostfire575 mentioned this pull request Dec 18, 2024
@Manason Manason merged commit 9ae4101 into Qbox-project:main Dec 18, 2024
2 checks passed
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.

Changing seat
2 participants