fixed some stuff

involved word casing and register useable doing stuff in a tidy way uhhhhhhh... fuck you qwezert
This commit is contained in:
gononono64 committed 2025-01-14 10:55:14 -06:00
1 parent 4a70083bf6
commit 2467aa31a0
9 files changed
+42 -15

No files matched your search

+7 -2
View File
@@ -198,8 +198,13 @@ end
-- Framework.RegisterUsableItem(item, cb) -- Framework.RegisterUsableItem(item, cb)
-- Registers a usable item with a callback function. -- Registers a usable item with a callback function.
Framework.RegisterUsableItem = function(item, cb) Framework.RegisterUsableItem = function(itemName, cb)
ESX.RegisterUsableItem(item, cb) local func = function(src, item, itemData)
itemData = itemData or item
itemData.metadata = itemData.metadata or itemData.info or {}
cb(src, itemName, itemData)
end
ESX.RegisterUsableItem(itemName, func)
end end
Framework.Commands = {} Framework.Commands = {}
+7 -2
View File
@@ -248,8 +248,13 @@ end
-- Framework.RegisterUsableItem(item, cb) -- Framework.RegisterUsableItem(item, cb)
-- Registers a usable item with a callback function. -- Registers a usable item with a callback function.
Framework.RegisterUsableItem = function(item, cb) Framework.RegisterUsableItem = function(itemName, cb)
QBCore.Functions.CreateUseableItem(item, cb) local func = function(src, item, itemData)
itemData = itemData or item
itemData.metadata = itemData.metadata or itemData.info or {}
cb(src, itemName, itemData)
end
QBCore.Functions.CreateUseableItem(itemName, func)
end end
Framework.Commands = {} Framework.Commands = {}
+7 -2
View File
@@ -235,6 +235,11 @@ end
-- Framework.RegisterUsableItem(item, cb) -- Framework.RegisterUsableItem(item, cb)
-- Registers a usable item with a callback function. -- Registers a usable item with a callback function.
Framework.RegisterUsableItem = function(item, cb) Framework.RegisterUsableItem = function(itemName, cb)
return QBox:CreateUseableItem(item, cb) local func = function(src, item, itemData)
itemData = itemData or item
itemData.metadata = itemData.metadata or itemData.info or {}
cb(src, itemName, itemData)
end
return QBox:CreateUseableItem(itemName, cb)
end end
+1 -1
View File
@@ -1,4 +1,4 @@
if GetResourceState('ox_lib') ~= 'started' then return end if GetResourceState('ox_lib') ~= 'started' and (BridgeClientConfig.MenuSystem ~= "ox" or BridgeClientConfig.MenuSystem ~= "auto") then return end
--- Converts a QB menu to an Ox menu. --- Converts a QB menu to an Ox menu.
---@param id string The menu ID. ---@param id string The menu ID.
+1 -1
View File
@@ -1,4 +1,4 @@
if GetResourceState('qb-menu') ~= 'started' then return end if GetResourceState('qb-menu') ~= 'started' and (BridgeClientConfig.MenuSystem ~= "qb" or BridgeClientConfig.MenuSystem ~= "auto") then return end
--- Converts an Ox menu to a QB menu. --- Converts an Ox menu to a QB menu.
---@param id string The menu ID. ---@param id string The menu ID.
---@param menu table The Ox menu data. ---@param menu table The Ox menu data.
+12
View File
@@ -15,18 +15,30 @@ local targetZones = {}
Target = {} Target = {}
Target.AddGlobalPlayer = function(options) Target.AddGlobalPlayer = function(options)
for k, v in pairs(options) do
options[k].onSelect = v.onSelect or v.action
end
ox_target:addGlobalPlayer(options) ox_target:addGlobalPlayer(options)
end end
Target.AddLocalEntity = function(entities, options) Target.AddLocalEntity = function(entities, options)
for k, v in pairs(options) do
options[k].onSelect = v.onSelect or v.action
end
ox_target:addLocalEntity(entities, options) ox_target:addLocalEntity(entities, options)
end end
Target.AddModel = function(models, options) Target.AddModel = function(models, options)
for k, v in pairs(options) do
options[k].onSelect = v.onSelect or v.action
end
ox_target:addModel(models, options) ox_target:addModel(models, options)
end end
Target.AddBoxZone = function(name, coords, size, heading, options) Target.AddBoxZone = function(name, coords, size, heading, options)
for k, v in pairs(options) do
options[k].onSelect = v.onSelect or v.action
end
local target = ox_target:addBoxZone({ local target = ox_target:addBoxZone({
coords = coords, coords = coords,
size = size, size = size,
+4 -4
View File
@@ -15,7 +15,7 @@ Target = {}
Target.AddGlobalPlayer = function(options) Target.AddGlobalPlayer = function(options)
for k, v in pairs(options) do for k, v in pairs(options) do
options[k].action = v.onSelect options[k].action = v.action or v.onSelect
end end
exports['qb-target']:AddGlobalPlayer({ exports['qb-target']:AddGlobalPlayer({
options = options, options = options,
@@ -25,7 +25,7 @@ end
Target.AddLocalEntity = function(entities, options) Target.AddLocalEntity = function(entities, options)
for k, v in pairs(options) do for k, v in pairs(options) do
options[k].action = v.onSelect options[k].action = v.action or v.onSelect
end end
exports['qb-target']:AddTargetEntity(entities, { exports['qb-target']:AddTargetEntity(entities, {
options = options, options = options,
@@ -35,7 +35,7 @@ end
Target.AddModel = function(models, options) Target.AddModel = function(models, options)
for k, v in pairs(options) do for k, v in pairs(options) do
options[k].action = v.onSelect options[k].action = v.action or v.onSelect
end end
exports['qb-target']:AddTargetModel(models, { exports['qb-target']:AddTargetModel(models, {
options = options, options = options,
@@ -45,7 +45,7 @@ end
Target.AddBoxZone = function(name, coords, size, heading, options) Target.AddBoxZone = function(name, coords, size, heading, options)
for k, v in pairs(options) do for k, v in pairs(options) do
options[k].action = v.onSelect options[k].action = v.action or v.onSelect
end end
exports['qb-target']:AddBoxZone(name, coords, size.x, size.y, { exports['qb-target']:AddBoxZone(name, coords, size.x, size.y, {
name = name, name = name,
+2 -2
View File
@@ -13,7 +13,7 @@ local placementText = {
} }
local function finishPlacing() local function finishPlacing()
Bridge.notify.HideHelpText() Bridge.Notify.HideHelpText()
if activePlacementProp == nil then return end if activePlacementProp == nil then return end
DeleteObject(activePlacementProp) DeleteObject(activePlacementProp)
activePlacementProp = nil activePlacementProp = nil
@@ -37,7 +37,7 @@ Utility.PlaceObject = function(object, distance, snapToGround, allowedMats, offs
SetEntityInvincible(activePlacementProp, true) SetEntityInvincible(activePlacementProp, true)
FreezeEntityPosition(activePlacementProp, true) FreezeEntityPosition(activePlacementProp, true)
Bridge.notify.ShowHelpText(type(placementText) == 'table' and table.concat(placementText) or placementText, { Bridge.Notify.ShowHelpText(type(placementText) == 'table' and table.concat(placementText) or placementText, {
position = "left-center", position = "left-center",
}) })
+1 -1
View File
@@ -2,7 +2,7 @@ BridgeClientConfig = {}
BridgeClientConfig.NotifySystem = "ox" -- Change this to your notification system (ox/qb/esx?) BridgeClientConfig.NotifySystem = "ox" -- Change this to your notification system (ox/qb/esx?)
BridgeClientConfig.ZoneSystem = "ox" -- Change this to your dialog system (ox/poly) BridgeClientConfig.ZoneSystem = "ox" -- Change this to your dialog system (ox/poly)
BridgeClientConfig.InputSystem = "ox" -- Change this to your Input system (ox/qb) BridgeClientConfig.InputSystem = "ox" -- Change this to your Input system (ox/qb)
BridgeClientConfig.MenuSystem = "ox" -- Change this to your Menu system (ox/qb) BridgeClientConfig.MenuSystem = "auto" -- Change this to your Menu system (ox/qb)
BridgeClientConfig.ProgressBar = "ox" -- Change this to your preferred progress bar (ox/qb) BridgeClientConfig.ProgressBar = "ox" -- Change this to your preferred progress bar (ox/qb)
BridgeClientConfig.DebugLevel = 3 -- Change this to your Debug level, 1 for none, 2 for some, 3 for all data BridgeClientConfig.DebugLevel = 3 -- Change this to your Debug level, 1 for none, 2 for some, 3 for all data
BridgeClientConfig.ShowHelpText = "ox" -- BridgeClientConfig.ShowHelpText = "ox" --