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

refactor!: cleanup #151

Merged
merged 1 commit into from
Oct 26, 2024
Merged

refactor!: cleanup #151

merged 1 commit into from
Oct 26, 2024

Conversation

Manason
Copy link
Member

@Manason Manason commented Oct 26, 2024

Sorry for the large PR. This PR breaks up the shared functions.lua, preferring instead to access config values directly rather than going through a function. This makes the code easier to navigate. In doing so I also ended up noticing some other cleanup things to do in preparation for release. Full list of changes below:

  • broke up shared/functions.lua and renamed to shared/vehicle-config.lua since the only kept function is to get the vehicle's config. Made this a global instead of a module. Also moved some shared functions that were only used by the client to the client as a local function
  • removed client export SetVehicleDoorLock and renamed the internal function to toggleLock as there is no use case for clients deciding the door lock state or skipping the animation.
  • fixed a typo that made shared keys on duty checking always pass

Refactored config/client in preparation for release

  • moved noCarjackWeapons list to the client since this was only used by the client
  • Simplified the default config by removing override default entries. While this could be useful for users to see how to use the config, it also makes it feel overwhelming. Instead, I'm opting for a simple default config.
  • Put the default values in-line to reduce the top level variables now that they aren't used in two places
  • Put sensible default values so that qbx_vehiclekeys is plug and play for most servers without any configuration required.

@Manason Manason merged commit c6f5096 into main Oct 26, 2024
3 of 4 checks passed
@Manason Manason deleted the cleanup-refactor branch October 26, 2024 23:29
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.

2 participants