-
Notifications
You must be signed in to change notification settings - Fork 112
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: switch from utils to lib (#318)
* feat: switch from utils to lib * fix: armsWithoutGloves issue? * fix: move armsWithoutGloves to shared * fix: spawnVehicle usage * fix(config/server): lib.string.random * Update server/commands.lua Co-authored-by: David Malchin <malchin459@gmail.com> * Update config/server.lua Co-authored-by: David Malchin <malchin459@gmail.com> * Update config/server.lua Co-authored-by: David Malchin <malchin459@gmail.com> * Update bridge/qb/client/functions.lua Co-authored-by: David Malchin <malchin459@gmail.com> * Update bridge/qb/server/main.lua Co-authored-by: David Malchin <malchin459@gmail.com> * Update bridge/qb/server/main.lua Co-authored-by: David Malchin <malchin459@gmail.com> * fix: manifest and GetPeds * fix: GetPlate and GetVehicleDisplayName * fix: Trim, FirstToUpper, and Cardinal Direction * fix: add string.split from utils to bridge * fix: GetPlayers * fix: SpawnClear * fix: GetClosestPlayer, GetClosestVehicle, and GetClosestObject * fix: GetPlayerFromCoords * feat(lint): new lib * fix(bridge): qb closestped compat * tweak(bridge): simplify SpawnClear * tweak(bridge): don't redefine heading * tweak: wrap cardinal direction instead * fix(server/events): use table instead of old func * perf(server/commands): reuse variable instead * fix: lint --------- Co-authored-by: David Malchin <malchin459@gmail.com> Co-authored-by: BerkieBb <82737367+BerkieBb@users.noreply.github.com>
- Loading branch information
1 parent
386e7a3
commit c5d6575
Showing
16 changed files
with
523 additions
and
214 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,36 +1,53 @@ | ||
local qbShared = require 'shared.main' | ||
|
||
---@deprecated use CommaValue from imports/utils.lua | ||
qbShared.CommaValue = CommaValue | ||
|
||
---@deprecated use RandomLetter from imports/utils.lua | ||
qbShared.RandomStr = RandomLetter | ||
|
||
---@deprecated use RandomNumber from imports/utils.lua | ||
qbShared.RandomInt = RandomNumber | ||
|
||
---@deprecated use string.split from imports/utils.lua | ||
qbShared.SplitStr = string.split | ||
|
||
---@deprecated use string.trim from imports/utils.lua | ||
qbShared.Trim = string.trim | ||
|
||
---@deprecated use string.firstToUpper from imports/utils.lua | ||
qbShared.FirstToUpper = string.firstToUpper | ||
|
||
---@deprecated use math.round from imports/utils.lua | ||
qbShared.Round = math.round | ||
|
||
---@deprecated use ChangeVehicleExtra from imports/utils.lua | ||
qbShared.ChangeVehicleExtra = ChangeVehicleExtra | ||
|
||
---@deprecated use SetVehicleExtras from imports/utils.lua | ||
qbShared.SetDefaultVehicleExtras = SetVehicleExtras | ||
|
||
---@deprecated use MaleNoGloves from imports/utils.lua | ||
qbShared.MaleNoGloves = MaleNoGloves | ||
|
||
---@deprecated use FemaleNoGloves from imports/utils.lua | ||
qbShared.FemaleNoGloves = FemaleNoGloves | ||
---@deprecated use lib.math.groupdigits from ox_lib | ||
qbShared.CommaValue = lib.math.groupdigits | ||
|
||
---@deprecated use lib.string.random from ox_lib | ||
qbShared.RandomStr = function(length) | ||
if length <= 0 then return '' end | ||
local pattern = math.random(2) == 1 and 'a' or 'A' | ||
return qbShared.RandomStr(length - 1) .. lib.string.random(pattern) | ||
end | ||
|
||
---@deprecated use lib.string.random from ox_lib | ||
qbShared.RandomInt = function(length) | ||
if length <= 0 then return '' end | ||
return qbShared.RandomInt(length - 1) .. lib.string.random('1') | ||
end | ||
|
||
---@deprecated use string.strsplit with CfxLua 5.4 | ||
qbShared.SplitStr = function(str, delimiter) | ||
local result = table.pack(string.strsplit(delimiter, str)) | ||
result.n = nil | ||
return result | ||
end | ||
|
||
---@deprecated use qbx.string.trim from modules/lib.lua | ||
qbShared.Trim = function(str) | ||
if not str then return nil end | ||
return qbx.string.trim(str) | ||
end | ||
|
||
---@deprecated use qbx.string.capitalize from modules/lib.lua | ||
qbShared.FirstToUpper = function(str) | ||
if not str then return nil end | ||
return qbx.string.capitalize(str) | ||
end | ||
|
||
---@deprecated use qbx.math.round from modules/lib.lua | ||
qbShared.Round = qbx.math.round | ||
|
||
---@deprecated use qbx.setVehicleExtra from modules/lib.lua | ||
qbShared.ChangeVehicleExtra = qbx.setVehicleExtras | ||
|
||
---@deprecated use qbx.setVehicleExtra from modules/lib.lua | ||
qbShared.SetDefaultVehicleExtras = qbx.setVehicleExtras | ||
|
||
---@deprecated use qbx.armsWithoutGloves.male from modules/lib.lua | ||
qbShared.MaleNoGloves = qbx.armsWithoutGloves.male | ||
|
||
---@deprecated use qbx.armsWithoutGloves.female from modules/lib.lua | ||
qbShared.FemaleNoGloves = qbx.armsWithoutGloves.female | ||
|
||
return qbShared |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.