mirror of
https://github.com/qbcore-fivem/qb-core.git
synced 2026-08-28 22:01:33 +00:00
74ac036d4a
Major refactor to centralize QBCore and replace the web UI stack: - Move QBConfig into a unified QBCore.Config and initialize QBCore.PlayerData; add shared/functions.lua. - Remove legacy client/main.lua and server/main.lua exports and update fxmanifest to include shared/functions and drop those main scripts. - Update client event handling: adapt player data events to QBCore:Client:OnPlayerUpdated and trigger job/gang update events; remove deprecated exploitable handlers. - Web UI rewrite: remove Vue/Quasar dependency and config module; implement a lightweight vanilla JS notification system (html/js/app.js) with updated html and css assets, plus drawtext tweaks. - CSS overhaul for notification styling and animations; HTML head/meta/font cleanup. - Server fixes: use QBCore.Shared.Locations in teleport command and strengthen numeric parsing/validation for coords. - Add .gitattributes for consistent text/eol handling and small code cleanups (thread/comment removal). These changes consolidate config/shared logic under QBCore, simplify the frontend dependencies, and fix a few parsing/event issues.
29 lines
885 B
Lua
29 lines
885 B
Lua
QBCore.Shared = {}
|
|
QBCore.ClientCallbacks = {}
|
|
QBCore.ServerCallbacks = {}
|
|
|
|
--- @param filters ('Config'|'Shared'|'ClientCallbacks'|'ServerCallbacks'|'PlayerData'|'Functions'|'Players'|'PlayersByCitizenId'|'Player_Buckets'|'Entity_Buckets'|'UsableItems'|'Commands')[]?
|
|
--- @return table
|
|
local function GetCoreObject(filters)
|
|
if not filters then return QBCore end
|
|
local results = {}
|
|
for i = 1, #filters do
|
|
local key = filters[i]
|
|
if QBCore[key] then
|
|
results[key] = QBCore[key]
|
|
end
|
|
end
|
|
return results
|
|
end
|
|
exports('GetCoreObject', GetCoreObject)
|
|
|
|
--- @param namespace 'Vehicles' | 'VehicleHashes' | 'Items' | 'Gangs' | 'Jobs' | 'Locations' | 'Weapons'
|
|
--- @param item string
|
|
--- @return table
|
|
function GetShared(namespace, item)
|
|
local ns = QBCore.Shared[namespace]
|
|
return ns and ns[item]
|
|
end
|
|
|
|
exports('GetShared', GetShared)
|