chore(intellisense): improve parameter annotations and add missing comments

Touched up incorrect or missing Intellisense parameter annotations across several functions. Added some missing descriptions to improve editor support. Still more to do, but this is a small step forward for overall developer workflow. Also small fix in picklexp
This commit is contained in:
MrNewb committed 2025-06-07 22:50:13 -04:00
1 parent 866283162b
commit c71a261115
85 files changed
+247 -194

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('esx_skin') == 'missing' then return end
Clothing = Clothing or {}
+5 -3
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('esx_skin') == 'missing' then return end
Clothing = Clothing or {}
Clothing.Players = {}
@@ -49,7 +50,8 @@ function Clothing.GetAppearance(src, fullData)
return completeData.converted
end
---This will save the player's current appearance to the database
---@param src number|string
function Clothing.Save(src)
src = src and tonumber(src)
assert(src, "src is nil")
@@ -134,7 +136,8 @@ function Clothing.Revert(src)
return Clothing.SetAppearance(src, backup)
end
---This will open the menu for the passed src
---@param src number|string
function Clothing.OpenMenu(src)
src = src and tonumber(src)
assert(src, "src is nil")
@@ -180,7 +183,6 @@ Callback.Register('community_bridge:cb:GetAppearance', function(source)
return Clothing.GetAppearance(src)
end)
RegisterCommand('clothing:debug', function(source, args, rawCommand)
local src = source
Clothing.SetAppearance(src, {
+1 -1
View File
@@ -1,4 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('esx_skin') == 'missing' then return end
Clothing = Clothing or {}
+1 -1
View File
@@ -1,4 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('fivem-appearance') == 'missing' then return end
Clothing = Clothing or {}
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('fivem-appearance') == 'missing' then return end
Clothing = Clothing or {}
Clothing.Players = {}
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('illenium-appearance') == 'missing' then return end
Clothing = Clothing or {}
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('illenium-appearance') == 'missing' then return end
Clothing = Clothing or {}
Clothing.Players = {}
+1 -2
View File
@@ -1,8 +1,7 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('qb-clothing') == 'missing' then return end
Clothing = Clothing or {}
function Clothing.OpenMenu()
TriggerEvent('qb-clothing:client:openMenu')
end
+3 -4
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('qb-clothing') == 'missing' then return end
Clothing = Clothing or {}
Clothing.Players = {}
@@ -145,8 +146,6 @@ AddEventHandler('community_bridge:Server:OnPlayerUnload', function(src)
Clothing.Players[strSrc] = nil
end)
--- Event handler for when the resource starts
--- Caches appearance data for all currently connected players
AddEventHandler('onResourceStart', function(resource)
@@ -166,7 +165,7 @@ Callback.Register('community_bridge:cb:GetAppearance', function(source)
return Clothing.GetAppearance(src)
end)
--[[
RegisterCommand('clothing:debug', function(source, args, rawCommand)
local src = source
Clothing.SetAppearance(src, {
@@ -206,7 +205,7 @@ RegisterCommand('clothing:openmenu', function(source, args, rawCommand)
local src = source
Clothing.OpenMenu(src)
end, false)
--]]
-- RegisterCommand('clothing:crowley', function(source, args, rawCommand)
-- local src = source
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
Dispatch = Dispatch or {}
---This will send an alert to currently supported dispatch systems.
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('bub-mdt') == 'missing' then return end
Dispatch = Dispatch or {}
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('cd_dispatch') == 'missing' then return end
Dispatch = Dispatch or {}
+2 -1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('lb-tablet') == 'missing' then return end
Dispatch = Dispatch or {}
@@ -13,7 +14,7 @@ local function getPriorityLevel(priority)
end
end
---commentThis will send an alert to the passed jobs
---This will send an alert to the passed jobs
---@param data table
Dispatch.SendAlert = function(data)
local streetName, _ = Utility.GetStreetNameAtCoords(data.coords)
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('linden_outlawalert') == 'missing' then return end
Dispatch = Dispatch or {}
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('ps-dispatch') == 'missing' then return end
if GetResourceState('lb-tablet') == 'started' then return end
Dispatch = Dispatch or {}
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('qs-dispatch') == 'missing' then return end
Dispatch = Dispatch or {}
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('redutzu-mdt') == 'missing' then return end
Dispatch = Dispatch or {}
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('tk_dispatch') == 'missing' then return end
Dispatch = Dispatch or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
Doorlock = Doorlock or {}
---This will get the closest door to the ped
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "BigDaddy-Fuel"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "cdn-fuel"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "esx-sna-fuel"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "LegacyFuel"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "okokGasStation"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "ox_fuel"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "ps-fuel"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "qs-fuelstations"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "Renewed-Fuel"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "ti_fuel"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "x-fuel"
if GetResourceState(resourceName) == 'missing' then return end
Fuel = Fuel or {}
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
HelpText = HelpText or {}
---This will show a help text message at the screen position passed
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
HelpText = HelpText or {}
---This will show a help text message to the specified player at the screen position passed
+1 -2
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
HelpText = HelpText or {}
local resourceName = "cd_drawtextui"
local configValue = BridgeSharedConfig.HelpText
@@ -8,14 +9,12 @@ if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (c
---@param message string
---@param _position string
---@return nil
---@diagnostic disable-next-line: duplicate-set-field
HelpText.ShowHelpText = function(message, _position)
return TriggerEvent('cd_drawtextui:ShowUI', 'show', message)
end
---This will hide the help text message on the screen
---@return nil
---@diagnostic disable-next-line: duplicate-set-field
HelpText.HideHelpText = function()
return TriggerEvent('cd_drawtextui:HideUI')
end
+1 -2
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
HelpText = HelpText or {}
local resourceName = "jg-textui"
local configValue = BridgeSharedConfig.HelpText
@@ -7,14 +8,12 @@ if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (c
---@param message string
---@param _position string
---@return nil
---@diagnostic disable-next-line: duplicate-set-field
HelpText.ShowHelpText = function(message, _position)
return exports['jg-textui']:DrawText(message)
end
---This will hide the help text message on the screen
---@return nil
---@diagnostic disable-next-line: duplicate-set-field
HelpText.HideHelpText = function()
return exports['jg-textui']:HideText()
end
+1 -2
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
HelpText = HelpText or {}
local resourceName = "lab-HintUI"
local configValue = BridgeSharedConfig.HelpText
@@ -7,14 +8,12 @@ if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (c
---@param message string
---@param _position string
---@return nil
---@diagnostic disable-next-line: duplicate-set-field
HelpText.ShowHelpText = function(message, _position)
return exports['lab-HintUI']:Show(message, "Hint Text")
end
---This will hide the help text message on the screen
---@return nil
---@diagnostic disable-next-line: duplicate-set-field
HelpText.HideHelpText = function()
return exports['lab-HintUI']:Hide()
end
+1 -2
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
HelpText = HelpText or {}
local resourceName = "okokTextUI"
local configValue = BridgeSharedConfig.HelpText
@@ -7,14 +8,12 @@ if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (c
---@param message string
---@param _position string
---@return nil
---@diagnostic disable-next-line: duplicate-set-field
HelpText.ShowHelpText = function(message, _position)
return exports['okokTextUI']:Open(message, 'darkblue', _position, false)
end
---This will hide the help text message on the screen
---@return nil
---@diagnostic disable-next-line: duplicate-set-field
HelpText.HideHelpText = function()
return exports['okokTextUI']:Close()
end
+1 -2
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
HelpText = HelpText or {}
local resourceName = "ox_lib"
local configValue = BridgeSharedConfig.HelpText
@@ -7,7 +8,6 @@ if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (c
---@param message string
---@param position string
---@return nil
---@diagnostic disable-next-line: duplicate-set-field
HelpText.ShowHelpText = function(message, position)
return exports.ox_lib:showTextUI(message, {
position = position or 'top-center'
@@ -16,7 +16,6 @@ end
---This will hide the help text message on the screen
---@return nil
---@diagnostic disable-next-line: duplicate-set-field
HelpText.HideHelpText = function()
return exports.ox_lib:hideTextUI()
end
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "qb-input"
local configValue = BridgeClientConfig.InputSystem
if (configValue == "auto" and GetResourceState(resourceName) == "missing") or (configValue ~= "auto" and configValue ~= resourceName) then return end
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "ox_lib"
local configValue = BridgeClientConfig.InputSystem
if (configValue == "auto" and GetResourceState(resourceName) == "missing") or (configValue ~= "auto" and configValue ~= resourceName) then return end
+16 -8
View File
@@ -34,12 +34,16 @@ Inventory.AddTrunkItems = function(identifier, items)
return false, Prints.Error("This Inventory Has Not Been Bridged For A Trunk Feature.")
end
---This will clear the specified inventory, will return success or failure.
---@param id string
---@return boolean
Inventory.ClearStash = function(id, _type)
if type(id) ~= "string" then return false end
return false, Prints.Error("This Inventory Has Not Been Bridged For A ClearStash Feature.")
end
---This will return a table with the item info, {name, label, stack, weight, description, image}
---This will return a table with the item info,
---example: {name = "coolitem", label = "a cool item name", stack = false, weight = 1000, description = "some item description", image = "coolitem.png"}
---@param item string
---@return table
Inventory.GetItemInfo = function(item)
@@ -47,8 +51,8 @@ Inventory.GetItemInfo = function(item)
end
---This will return the count of the item in the players inventory, if not found will return 0.
---
---if metadata is passed it will find the matching items count.
---example: 0
---@param src number
---@param item string
---@param metadata table
@@ -58,6 +62,7 @@ Inventory.GetItemCount = function(src, item, metadata)
end
---This wil return the players inventory.
---example: {{weight = 10, name = "farts", metadata = {description = "this is a description"}, slot = 1, label = "stinky", count = 1}, {weight = 10, name = "farts", metadata = {description = "this is a description"}, slot = 2, label = "stinky", count = 1}}
---@param src number
---@return table
Inventory.GetPlayerInventory = function(src)
@@ -65,8 +70,7 @@ Inventory.GetPlayerInventory = function(src)
end
---Returns the specified slot data as a table.
---
---format {weight, name, metadata, slot, label, count}
---example {weight = 10, name = "farts", metadata = {description = "this is a description"}, slot = 1, label = "stinky", count = 1}
---@param src number
---@param slot number
---@return table
@@ -152,10 +156,10 @@ Inventory.OpenShop = function(src, shopTitle)
end
-- This will register a shop, if it already exists it will return true.
-- @param shopTitle string
-- @param shopInventory table
-- @param shopCoords table
-- @param shopGroups table
---@param shopTitle string
---@param shopInventory table
---@param shopCoords table
---@param shopGroups table
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
return false, Prints.Error("This Inventory Has Not Been Bridged For A CreateShop Feature.")
end
@@ -167,6 +171,10 @@ Inventory.GetImagePath = function(item)
return "https://avatars.githubusercontent.com/u/47620135"
end
---This will remove the file extension from the item name if present.
---example: "item.png" will become "item"
---@param item string
---@return string
Inventory.StripPNG = function(item)
if string.find(item, ".png") then
item = string.gsub(item, ".png", "")
+4 -4
View File
@@ -193,10 +193,10 @@ Inventory.OpenShop = function(src, shopTitle)
end
-- This will register a shop, if it already exists it will return true.
-- @param shopTitle string
-- @param shopInventory table
-- @param shopCoords table
-- @param shopGroups table
---@param shopTitle string
---@param shopInventory table
---@param shopCoords table
---@param shopGroups table
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
return true, print("Unable to Create Shop for codem-inventory, I do not have access to a copy of this inventory to bridge the feature.")
end
+8 -12
View File
@@ -52,7 +52,6 @@ Inventory.RemoveItem = function(src, item, count, slot, metadata)
end
---This will return the count of the item in the players inventory, if not found will return 0.
---
---if metadata is passed it will find the matching items count.
---@param src number
---@param item string
@@ -110,7 +109,6 @@ Inventory.GetPlayerInventory = function(src)
end
---Returns the specified slot data as a table.
---
---format {weight, name, metadata, slot, label, count}
---@param src number
---@param slot number
@@ -175,7 +173,6 @@ Inventory.RegisterStash = function(id, label, slots, weight, owner, groups, coor
groups = groups,
coords = coords
}
--core:openInventory(nil, id, 'stash', mathyShit, mathyShit, false, nil, false)
return true, id
end
@@ -246,25 +243,24 @@ Inventory.GetImagePath = function(item)
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
end
-- This will open the specified shop for the src passed.
---This will open the specified shop for the src passed.
---@param src number
---@param shopTitle string
Inventory.OpenShop = function(src, shopTitle)
return false, print("Unable to open shop for core_inventory, I do not have access to a copy of this inventory to bridge the feature.")
end
-- This will register a shop, if it already exists it will return true.
-- @param shopTitle string
-- @param shopInventory table
-- @param shopCoords table
-- @param shopGroups table
---This will register a shop, if it already exists it will return true.
---@param shopTitle string
---@param shopInventory table
---@param shopCoords table
---@param shopGroups table
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
return false, print("Unable to open shop for core_inventory, I do not have access to a copy of this inventory to bridge the feature.")
end
--<-- TODO swap to internal callback system
-- This is used for the esx users, documentation doesnt show a client side available option for the inventory so we use jank callbacks to get this.
---<-- TODO swap to internal callback system
---This is used for the esx users, documentation doesnt show a client side available option for the inventory so we use jank callbacks to get this.
lib.callback.register('community_bridge:Callback:core_inventory', function(source)
local items = core:getItemsList()
return items or {}
+6 -7
View File
@@ -41,7 +41,6 @@ Inventory.GetItemInfo = function(item)
end
---Returns the specified slot data as a table.
---
---format {weight, name, metadata, slot, label, count}
---@param src number
---@param slot number
@@ -156,18 +155,18 @@ Inventory.GetImagePath = function(item)
return imagePath or "https://avatars.githubusercontent.com/u/47620135"
end
-- This will open the specified shop for the src passed.
---This will open the specified shop for the src passed.
---@param src number
---@param shopTitle string
Inventory.OpenShop = function(src, shopTitle)
jpr:OpenShop(src, shopTitle)
end
-- This will register a shop, if it already exists it will return true.
-- @param shopTitle string
-- @param shopInventory table
-- @param shopCoords table
-- @param shopGroups table
---This will register a shop, if it already exists it will return true.
---@param shopTitle string
---@param shopInventory table
---@param shopCoords table
---@param shopGroups table
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
if not shopTitle or not shopInventory or not shopCoords then return end
if registeredShops[shopTitle] then return true end
@@ -227,10 +227,10 @@ Inventory.OpenShop = function(src, shopTitle)
end
-- This will register a shop, if it already exists it will return true.
-- @param shopTitle string
-- @param shopInventory table
-- @param shopCoords table
-- @param shopGroups table
---@param shopTitle string
---@param shopInventory table
---@param shopCoords table
---@param shopGroups table
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
return true, print("Currently runtime shops are not supported in origen_inventory")
end
+4 -4
View File
@@ -190,10 +190,10 @@ Inventory.OpenShop = function(src, shopTitle)
end
-- This will register a shop, if it already exists it will return true.
-- @param shopTitle string
-- @param shopInventory table
-- @param shopCoords table
-- @param shopGroups table
---@param shopTitle string
---@param shopInventory table
---@param shopCoords table
---@param shopGroups table
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
if registeredShops[shopTitle] then return true end
registeredShops[shopTitle] = true
+4 -4
View File
@@ -185,10 +185,10 @@ Inventory.OpenShop = function(src, shopTitle)
end
-- This will register a shop, if it already exists it will return true.
-- @param shopTitle string
-- @param shopInventory table
-- @param shopCoords table
-- @param shopGroups table
---@param shopTitle string
---@param shopInventory table
---@param shopCoords table
---@param shopGroups table
Inventory.RegisterShop = function(src, shopTitle, shopInventory, shopCoords, shopGroups)
if not shopTitle or not shopInventory or not shopCoords then return end
if registeredShops[shopTitle] then return true end
+4 -4
View File
@@ -223,10 +223,10 @@ Inventory.OpenShop = function(src, shopTitle)
end
-- This will register a shop, if it already exists it will return true.
-- @param shopTitle string
-- @param shopInventory table
-- @param shopCoords table
-- @param shopGroups table
---@param shopTitle string
---@param shopInventory table
---@param shopCoords table
---@param shopGroups table
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
return false, print("Currently qs shop is not bridged")
end
@@ -213,10 +213,10 @@ Inventory.OpenShop = function(src, shopTitle)
end
-- This will register a shop, if it already exists it will return true.
-- @param shopTitle string
-- @param shopInventory table
-- @param shopCoords table
-- @param shopGroups table
---@param shopTitle string
---@param shopInventory table
---@param shopCoords table
---@param shopGroups table
Inventory.RegisterShop = function(shopTitle, shopInventory, shopCoords, shopGroups)
return false, print("Currently tgiann-inventory is not bridged for shops")
end
+1
View File
@@ -2,6 +2,7 @@ local resourceName = "ox_lib"
local configValue = BridgeClientConfig.MenuSystem
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
Menus = Menus or {}
---Converts a QB menu to an Ox menu.
---@param id string The menu ID.
---@param menu table The QB menu data.
+1 -1
View File
@@ -1,7 +1,7 @@
local resourceName = "qb-menu"
local configValue = BridgeClientConfig.MenuSystem
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
--print("Loading QB Menu")
---Converts an Ox menu to a QB menu.
---@param id string The menu ID.
---@param menu table The Ox menu data.
-87
View File
@@ -24,90 +24,3 @@ RegisterNetEvent('community_bridge:client:MenuCallback', function(_args)
end)
return Menu
--[[
--Unit Tests
local qbMenu = {
{
header = 'QBCore Test Menu',
icon = 'fas fa-code',
isMenuHeader = true, -- Set to true to make a nonclickable title
},
{
header = 'First Button',
txt = 'Open a secondary menu!',
icon = 'fas fa-code-pull-request',
-- disabled = false, -- optional, non-clickable and grey scale
-- hidden = true, -- optional, hides the button completely
params = {
-- isServer = false, -- optional, specify event type
event = 'community_bridge:client:TestEvent',
args = {
number = 1,
}
}
},
{
header = 'Second Button',
txt = 'Open a secondary menu!',
icon = 'fas fa-code-pull-request',
params = {
event = 'community_bridge:client:TestEvent',
args = {
number = 2,
}
}
}
}
local oxMenu = {
id = "test",
title = "Test Menu",
options = {
{
title = "First Button",
description = "Open a secondary menu!",
icon = "fas fa-code-pull-request",
args = {
number = 1,
},
onSelect = function(selected, secondary, args)
print("Selected", json.encode(selected))
end
},
{
title = "Second Button",
description = "Open a secondary menu!",
icon = "fas fa-code-pull-request",
args = {
number = 2,
},
onSelect = function(selected, secondary, args)
print("Selected", json.encode(selected))
end
}
}
}
RegisterCommand("testmenu-qbtoox", function()
Menu.Open(qbMenu, true)
end)
RegisterCommand("testmenu-oxtoqb", function()
Menu.Open(oxMenu, false)
end)
RegisterCommand("testmenu-oxtoox", function()
Menu.Open(oxMenu, false)
end)
RegisterCommand("testmenu-qbtoqb", function()
Menu.Open(qbMenu, true)
end)
RegisterNetEvent('community_bridge:client:TestEvent', function(args)
print("Test Event", json.encode(args))
end)
--]]
+5 -2
View File
@@ -1,9 +1,13 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "ox_lib"
local configValue = BridgeClientConfig.ProgressBarSystem
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
ProgressBar = ProgressBar or {}
---This function converts a QB progress bar options table to an Ox progress bar options table.
---@param options table
---@return table
local function convertFromQB(options)
if not options then return options end
local prop1 = options.prop or {}
@@ -46,9 +50,8 @@ end
---This function opens a progress bar.
---@param options table
---@param cb any
---@param isQBInput boolean
---@param isQBInput boolean||optional
---@return boolean
---@diagnostic disable-next-line: duplicate-set-field
function ProgressBar.Open(options, cb, isQBInput)
if isQBInput then
options = convertFromQB(options)
@@ -1,9 +1,13 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "progressbar"
local configValue = BridgeClientConfig.ProgressBarSystem
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
ProgressBar = ProgressBar or {}
---This function converts an Ox progress bar options table to a QB progress bar options table.
---@param options table
---@return table
local function convertFromOx(options)
if not options then return options end
local prop1 = options.prop?[1] or options.prop or {}
@@ -45,7 +49,6 @@ end
---@param cb any
---@param qbFormat boolean
---@return boolean boolean
---@diagnostic disable-next-line: duplicate-set-field
function ProgressBar.Open(options, cb, qbFormat)
if not exports['progressbar'] then return false end
+1 -1
View File
@@ -2,7 +2,7 @@ Shops = Shops or {}
local registeredShops = {}
---commentThis can open a shop for the client
---This can open a shop for the client
---@param src number
---@param shopTitle string
---@return boolean
+9 -3
View File
@@ -1,17 +1,23 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local function warnUser()
print("Currently only a few skill systems are supported by Community Bridge, you are using a resource that requires the skills module to be used.")
end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being being used.
---@return string
Skills.GetResourceName = function()
return "none"
end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the skill level of the passed skill name.
---@param skillName string
---@return number
---@return nil
Skills.GetSkillLevel = function(skillName)
return 0, warnUser()
warnUser()
return 0
end
return Skills
+23 -7
View File
@@ -1,27 +1,43 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local function warnUser()
print("Currently only a few skill systems are supported by Community Bridge, you are using a resource that requires the skills module to be used.")
end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being being used.
---@return string
Skills.GetResourceName = function()
return "none"
end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the skill level of the passed skill name.
---@param src number
---@param skillName string
---@return number
Skills.GetSkillLevel = function(src, skillName)
return 0, warnUser()
warnUser()
return 0
end
---@diagnostic disable-next-line: duplicate-set-field
---This will add xp to the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.AddXp = function(src, skillName, amount)
return false, warnUser()
warnUser()
return false
end
---@diagnostic disable-next-line: duplicate-set-field
---This will remove xp from the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.RemoveXp = function(src, skillName, amount)
return false, warnUser()
warnUser()
return false
end
return Skills
+6 -2
View File
@@ -1,14 +1,18 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "evolent_skills"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param skillName string
---@return number
Skills.GetSkillLevel = function(skillName)
local skillData = exports.evolent_skills:getSkillLevel(skillName)
return skillData or 0
+18 -4
View File
@@ -1,20 +1,30 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "evolent_skills"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param src number
---@param skillName string
---@return number
Skills.GetSkillLevel = function(src, skillName)
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
return skillData or 0
end
---@diagnostic disable-next-line: duplicate-set-field
---This will add xp to the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.AddXp = function(src, skillName, amount)
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
if not skillData then return false, print("Skill not found") end
@@ -22,7 +32,11 @@ Skills.AddXp = function(src, skillName, amount)
return true
end
---@diagnostic disable-next-line: duplicate-set-field
---This will remove xp from the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.RemoveXp = function(src, skillName, amount)
local skillData = exports.evolent_skills:getSkillLevel(src, skillName)
if not skillData then return false, print("Skill not found") end
+7 -2
View File
@@ -1,14 +1,19 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "OT_skills"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param skillName string
---@return number
Skills.GetSkillLevel = function(skillName)
local skillData = exports.OT_skills:getSkill(skillName)
return skillData.level or 0
+18 -2
View File
@@ -1,19 +1,30 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "OT_skills"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param src number
---@param skillName string
---@return number
Skills.GetSkillLevel = function(src, skillName)
local skillData = exports.OT_skills:getSkill(src, skillName)
return skillData.level or 0
end
---This will add xp to the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.AddXp = function(src, skillName, amount)
local skillData = exports.OT_skills:getSkill(src, skillName)
if not skillData then return false, print("Skill not found") end
@@ -21,6 +32,11 @@ Skills.AddXp = function(src, skillName, amount)
return true
end
---This will remove xp from the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.RemoveXp = function(src, skillName, amount)
local skillData = exports.OT_skills:getSkill(src, skillName)
if not skillData then return false, print("Skill not found") end
+7 -3
View File
@@ -1,16 +1,20 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "pickle_xp"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param skillName string
---@return number
Skills.GetSkillLevel = function(skillName)
local skillData = exports.OT_skills:GetLevel(skillName)
local skillData = exports.pickle_xp:GetLevel(skillName)
return skillData or 0
end
+18 -2
View File
@@ -1,19 +1,30 @@
---@diagnostic disable: duplicate-set-field
Skills = Skills or {}
local resourceName = "pickle_xp"
local configValue = BridgeSharedConfig.Skills
if (configValue == "auto" and GetResourceState(resourceName) ~= "started") or (configValue ~= "auto" and configValue ~= resourceName) then return end
---@diagnostic disable-next-line: duplicate-set-field
---This will get the name of the Skills system being used.
---@return string
Skills.GetResourceName = function()
return resourceName
end
---@diagnostic disable-next-line: duplicate-set-field
---This will return the skill level of the passed skill name.
---@param src number
---@param skillName string
---@return number
Skills.GetSkillLevel = function(src, skillName)
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
return skillData or 0
end
---This will add xp to the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.AddXp = function(src, skillName, amount)
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
if not skillData then return false, print("Skill not found") end
@@ -21,6 +32,11 @@ Skills.AddXp = function(src, skillName, amount)
return true
end
---This will remove xp from the passed skill name.
---@param src number
---@param skillName string
---@param amount number
---@return boolean
Skills.RemoveXp = function(src, skillName, amount)
local skillData = exports.pickle_xp:GetPlayerLevel(src, skillName)
if not skillData then return false, print("Skill not found") end
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
Target = Target or {}
local function warnUser()
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "ox_target"
if GetResourceState(resourceName) == 'missing' then return end
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "qb-target"
if GetResourceState(resourceName) == 'missing' then return end
if GetResourceState("ox_target") == 'started' then return end
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "sleepless_interact"
if GetResourceState(resourceName) == 'missing' then return end
if GetResourceState("ox_target") == 'started' then return end
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "F_RealCarKeysSystem"
if GetResourceState(resourceName) == 'missing' then return end
VehicleKey = VehicleKey or {}
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "MrNewbVehicleKeys"
if GetResourceState(resourceName) == 'missing' then return end
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "Renewed-Vehiclekeys"
if GetResourceState(resourceName) == 'missing' then return end
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
VehicleKey = VehicleKey or {}
---This will give keys to the specifed vehicle/plate.
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "cd_garage"
if GetResourceState(resourceName) == 'missing' then return end
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "jaksams_VehiclesKeys"
if GetResourceState(resourceName) == 'missing' then return end
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "mk_vehiclekeys"
if GetResourceState(resourceName) == 'missing' then return end
VehicleKey = VehicleKey or {}
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "mono_carkeys"
if GetResourceState(resourceName) == 'missing' then return end
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "okokGarage"
if GetResourceState(resourceName) == 'missing' then return end
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "qb-vehiclekeys"
if GetResourceState(resourceName) == 'missing' then return end
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "qbx_vehiclekeys"
if GetResourceState(resourceName) == 'missing' then return end
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "qs-vehiclekeys"
if GetResourceState(resourceName) == 'missing' then return end
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "t1ger_keys"
if GetResourceState(resourceName) == 'missing' then return end
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
local resourceName = "wasabi_carlock"
if GetResourceState(resourceName) == 'missing' then return end
+1
View File
@@ -1,3 +1,4 @@
---@diagnostic disable: duplicate-set-field
Weather = Weather or {}
---This will toggle the players weather/time sync
+3 -1
View File
@@ -1,8 +1,10 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('cd_easytime') == 'missing' then return end
Weather = Weather or {}
---comment
---This will toggle the players weather/time sync
---@param toggle boolean
---@return nil
Weather.ToggleSync = function(toggle)
TriggerEvent('cd_easytime:PauseSync', toggle)
end
@@ -1,8 +1,10 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('qb-weathersync') == 'missing' then return end
Weather = Weather or {}
---comment
---This will toggle the players weather/time sync
---@param toggle boolean
---@return nil
Weather.ToggleSync = function(toggle)
if toggle then
TriggerEvent("qb-weathersync:client:EnableSync")
@@ -1,8 +1,10 @@
---@diagnostic disable: duplicate-set-field
if GetResourceState('Renewed-Weathersync') == 'missing' then return end
Weather = Weather or {}
---comment
---This will toggle the players weather/time sync
---@param toggle boolean
---@return nil
Weather.ToggleSync = function(toggle)
LocalPlayer.state.syncWeather = toggle
end