feat(esx_garage): garage rewrite (backend, migration, exports, NUI)#116
Open
ASTROWwwW wants to merge 90 commits into
Open
feat(esx_garage): garage rewrite (backend, migration, exports, NUI)#116ASTROWwwW wants to merge 90 commits into
ASTROWwwW wants to merge 90 commits into
Conversation
Added a check to ensure the player actually has the weapon before removing it. This prevents players from triggering a bug or exploiting the armory callback. Signed-off-by: Mr Sneaky <123227860+MrSne7aky@users.noreply.github.com>
Added new handcuffs.ydr model and types1.ytyp type definition to the police job props stream for use in ESX police job addon.
Signed-off-by: Mr Sneaky <123227860+MrSne7aky@users.noreply.github.com>
Signed-off-by: OUALI Salah <32158518+OualiS@users.noreply.github.com>
Repo deprecated, moved to ESX-Legacy-Addons
Update client/main.lua
Update client/main.lua
### Description This PR replaces ESX.ShowHelpNotification with the new ESX:TextUI system for better consistency across the ESX framework. ### PR Checklist - [X] My commit messages and PR title follow the [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/?utm_source=chatgpt.com) standard. - [X] My changes have been tested locally and function as expected. - [X] My PR does not introduce any breaking changes. - [X] I have provided a clear explanation of what my PR does, including the reasoning behind the changes and any relevant context.
This PR replaces ESX.ShowHelpNotification with the new ESX:TextUI system for better consistency across the ESX framework.
Added type annotations and refactored some functions.
Rewrote the functions to load the accounts. Also moved the exports there.
fix(server/main.lua): ensure player has weapon before removal
refactor(esx_hud): remove outdated check
refactor(esx_dmvschool/client/main): switch to ESX:TextUI
- Replace Vue 3 UI with React 19 + TypeScript + Zustand - Implement ESX design guidelines (Roboto font, #FB9B04 brand) - Add NUI callback structure for kr3mu integration - Remove backdrop-filter for FiveM CEF compatibility - Use ESX standard shadows, border-radius, transitions
- Use root font-size approach for automatic rem scaling - Remove deprecated react-query v3, keep @tanstack/react-query v5 - Scale Framer Motion animation offset for perfect centering - All components use clean rem values without calc() Technical implementation: - ScaleProvider sets document.documentElement.fontSize - All rem values scale automatically with viewport -Animation offsets multiply by scale factor - Industry-standard approach for maintainability"
feat(esx_garage): modernize NUI with React + TypeScript
Changed the CSS object-position of the vehicle image from 'center bottom' to 'center 120%' to improve image alignment within the VehicleCard component.
Increased the opacity of the vehicle image to 1 and applied brightness and saturation filters for a more vivid display.
Introduces an $active prop to CounterButton, CounterIcon, and CounterText components to visually indicate when a filter is active. Updates filter logic to toggle between active and 'all' states for stored and impounded filters, improving user feedback and interaction clarity.
Adjusted filter logic in GarageHeader to use 'all' instead of false for non-selected filters. Removed the filled star icon from VehicleCard, always displaying the border star icon for favorites, and updated the active color to use theme's primary text color.
feat: add vehicle images to garages
Backend built on ESX.CreateExtendedVehicle/GetExtendedVehicleFromPlate so storing, retrieving, impound and transfer stay server authoritative. - data model aligned with owned_vehicles: stored + parking/pound, plus custom_name, is_favorite, last_used, mileage - idempotent auto migration on start, mirrored in esx_garage.sql - exports to register static garages with per garage access (jobs map plus optional authorize callback), custom logo and color - impound as self service with a configurable per lot fee; a vehicle left out of sync is recovered from an impound only - NUI wired to the backend with error feedback and input validation - hardened server side validation and entity handling across the lifecycle - world cleanup on resource stop and refresh, ground markers at each point
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Finishes the backend for the NUI already on
new-garages, built on the es_extended vehicle class (ESX.CreateExtendedVehicle/ESX.GetExtendedVehicleFromPlate) so spawning, despawning and ownership stay server authoritative.New:
server/modules/{registry,vehicle,migration}.lua.Data model
State lives on
owned_vehicles.storedstays boolean:1when the vehicle is parked or impounded,0when it is out in the world.parkingholds the garage id while it is parked andpoundthe impound lot id while it is impounded, so those two disambiguatestoredand nothing depends on the legacy tri state. Legacystored = 2rows are converted tostored = 1pluspound. The remaining columns are per vehicle metadata:custom_name,is_favorite,last_usedandmileage.Migration runs on start and adds each column only if it is missing.
esx_garage.sqlmirrors it and every statement is guarded, so both are safe to run more than once.A row saying
stored = 0while no entity is left in the world is out of sync. It is recovered from an impound only, against that lot's fee, and every live entity carrying the plate is deleted before respawning so it cannot duplicate.Exports
Plus
registerGarages,unregisterGarage,getGarages,getImpoundsandimpoundVehicle(plate, lot). Access checksjobsfirst, thenauthorizeunderpcall; noaccesstable means public.Events
esx_garage:giveKeys(source, plate), gated byConfig.Settings.vehicleKeysesx_garage:vehicleTransferred(source, targetId, plate, ownerIdentifier, targetIdentifier)Note
storeVehiclewrites the vehicle props itself instead of using the vehicle class setter, and forces model and plate from the server side entity. Please keep it that way.