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.
Description
Implements a new Qbox library as per #301.
All functions have been tested except for audio & statebag related functions.
Most functions have been refactored a bit, so the code should be reviewed.
Usage of the library and the deprecation of the utils module will come in following PRs.
Shared Functions
GetCoordsFromEntity
=> not carried over (feels useless)GetPlate
=>qbx.getVehiclePlate
(removed a nil check)CommaValue
=> not carried over (lib.math.groupdigits
exists in ox_lib)string.split
=> not carried over (string.strsplit
exists in CfxLua 5.4)string.trim
=>qbx.string.trim
(removed a nil check and an unneeded return value)string.firstToUpper
=>qbx.string.capitalize
(ditto)math.round
=>qbx.math.round
RandomLetter
=> not carried over (lib.string.random
exists in ox_lib)RandomNumber
=> not carried over (ditto)RandomNumberOrLetter
=> not carried over (ditto)GenerateRandomPlate
=>qbx.generateRandomPlate
(pattern param is now optional)MapTableBySubfield
=>qbx.table.mapBySubfield
GetCardinalDirection
=>qbx.getCardinalDirection
(converted from client-only to shared, art was added to the docs because I thought it would be funny, altho keeping this one is questionable)Server Functions
SpawnVehicle
=>qbx.spawnVehicle
(now with table params)KickWithReason
=> not carried over (it isn't being used)IsLicenseInUse
=> not carried over (it is only ever used inplayerConnecting
)Client Functions
DrawText2D
=>qbx.drawText2d
(now with table params)DrawText3D
=>qbx.drawText3d
(now with table params)GetEntityAndNetIdFromBagName
=>qbx.getEntityAndNetIdFromBagName
EntityStateHandler
=>qbx.entityStateHandler
PlayAnim
=> not carried over (unused, by us at least)GetEntities
=> not carried over (either unused at all or used withoutignoreList
)GetVehicles
=> not carried over (ditto)GetObjects
=> not carried over (ditto)GetPeds
=> not carried over (ditto)GetPickups
=> not carried over (ditto)GetPlayersInScope
=> not carried over (ditto)GetClosestEntity
=> not carried over (lib.getClosest...
functions exist in ox_lib)GetClosestPed
=> not carried over (lib.getClosestPed
exists in ox_lib)GetClosestVehicle
=> not carried over (lib.getClosestVehicle
exists in ox_lib)GetClosestObject
=> not carried over (lib.getClosestObject
exists in ox_lib)DeleteVehicle
=>qbx.deleteVehicle
(the one that started it all)GetClosestObject
=> not carried over (lib.getClosestPlayer
exists in ox_lib)GetPlayersFromCoords
=> not carried over (lib.getNearbyPlayers
exists in ox_lib)GetClosestBone
=> not carried over (unused from my understanding)GetBoneDistance
=> not carried over (ditto)AttachProp
=> not carried over (ditto)GetVehicleDisplayName
=>qbx.getVehicleDisplayName
GetVehicleMakeName
=>qbx.getVehicleMakeName
IsVehicleSpawnClear
=> not carried over (lib.getNearbyVehicles
exists in ox_lib)StartParticleAtCoord
=> not carried over (unused from my understanding)StartParticleOnEntity
=> not carried over (ditto)GetStreetNameAtCoords
=>qbx.getStreetName
(keeping this one is questionable)GetZoneAtCoords
=>qbx.getZoneName
(ditto)GetCurrentTime
=> not carried over (unused and feels useless)GetGroundZCoord
=> not carried over (feels useless)ClearAllVehicleExtras
=>qbx.resetVehicleExtras
(not sure about keeping extras functions but policejob uses one of them)ChangeVehicleExtra
=>qbx.setVehicleExtra
(ditto)SetVehicleExtras
=>qbx.setVehicleExtras
(ditto)MaleNoGloves
=>qbx.armsWithoutGloves.male
(table is now frozen to modification)FemaleNoGloves
=>qbx.armsWithoutGloves.female
(ditto)IsWearingGloves
=>qbx.isWearingGloves
LoadAudioBank
=>qbx.loadAudioBank
PlayAudio
=>qbx.playAudio
(now with table params)Checklist