fixed some stuff
involved word casing and register useable doing stuff in a tidy way uhhhhhhh... fuck you qwezert
This commit is contained in:
1 parent
4a70083bf6
commit
2467aa31a0
9 files changed
+42
-15
No files matched your search
@@ -198,8 +198,13 @@ end
|
||||
|
||||
-- Framework.RegisterUsableItem(item, cb)
|
||||
-- Registers a usable item with a callback function.
|
||||
Framework.RegisterUsableItem = function(item, cb)
|
||||
ESX.RegisterUsableItem(item, cb)
|
||||
Framework.RegisterUsableItem = function(itemName, 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
|
||||
|
||||
Framework.Commands = {}
|
||||
|
||||
@@ -248,8 +248,13 @@ end
|
||||
|
||||
-- Framework.RegisterUsableItem(item, cb)
|
||||
-- Registers a usable item with a callback function.
|
||||
Framework.RegisterUsableItem = function(item, cb)
|
||||
QBCore.Functions.CreateUseableItem(item, cb)
|
||||
Framework.RegisterUsableItem = function(itemName, 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
|
||||
|
||||
Framework.Commands = {}
|
||||
|
||||
@@ -235,6 +235,11 @@ end
|
||||
|
||||
-- Framework.RegisterUsableItem(item, cb)
|
||||
-- Registers a usable item with a callback function.
|
||||
Framework.RegisterUsableItem = function(item, cb)
|
||||
return QBox:CreateUseableItem(item, cb)
|
||||
Framework.RegisterUsableItem = function(itemName, 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
|
||||
@@ -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.
|
||||
---@param id string The menu ID.
|
||||
|
||||
@@ -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.
|
||||
---@param id string The menu ID.
|
||||
---@param menu table The Ox menu data.
|
||||
|
||||
@@ -15,18 +15,30 @@ local targetZones = {}
|
||||
Target = {}
|
||||
|
||||
Target.AddGlobalPlayer = function(options)
|
||||
for k, v in pairs(options) do
|
||||
options[k].onSelect = v.onSelect or v.action
|
||||
end
|
||||
ox_target:addGlobalPlayer(options)
|
||||
end
|
||||
|
||||
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)
|
||||
end
|
||||
|
||||
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)
|
||||
end
|
||||
|
||||
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({
|
||||
coords = coords,
|
||||
size = size,
|
||||
|
||||
@@ -15,7 +15,7 @@ Target = {}
|
||||
|
||||
Target.AddGlobalPlayer = function(options)
|
||||
for k, v in pairs(options) do
|
||||
options[k].action = v.onSelect
|
||||
options[k].action = v.action or v.onSelect
|
||||
end
|
||||
exports['qb-target']:AddGlobalPlayer({
|
||||
options = options,
|
||||
@@ -25,7 +25,7 @@ end
|
||||
|
||||
Target.AddLocalEntity = function(entities, options)
|
||||
for k, v in pairs(options) do
|
||||
options[k].action = v.onSelect
|
||||
options[k].action = v.action or v.onSelect
|
||||
end
|
||||
exports['qb-target']:AddTargetEntity(entities, {
|
||||
options = options,
|
||||
@@ -35,7 +35,7 @@ end
|
||||
|
||||
Target.AddModel = function(models, options)
|
||||
for k, v in pairs(options) do
|
||||
options[k].action = v.onSelect
|
||||
options[k].action = v.action or v.onSelect
|
||||
end
|
||||
exports['qb-target']:AddTargetModel(models, {
|
||||
options = options,
|
||||
@@ -45,7 +45,7 @@ end
|
||||
|
||||
Target.AddBoxZone = function(name, coords, size, heading, options)
|
||||
for k, v in pairs(options) do
|
||||
options[k].action = v.onSelect
|
||||
options[k].action = v.action or v.onSelect
|
||||
end
|
||||
exports['qb-target']:AddBoxZone(name, coords, size.x, size.y, {
|
||||
name = name,
|
||||
|
||||
@@ -13,7 +13,7 @@ local placementText = {
|
||||
}
|
||||
|
||||
local function finishPlacing()
|
||||
Bridge.notify.HideHelpText()
|
||||
Bridge.Notify.HideHelpText()
|
||||
if activePlacementProp == nil then return end
|
||||
DeleteObject(activePlacementProp)
|
||||
activePlacementProp = nil
|
||||
@@ -37,7 +37,7 @@ Utility.PlaceObject = function(object, distance, snapToGround, allowedMats, offs
|
||||
SetEntityInvincible(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",
|
||||
})
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ BridgeClientConfig = {}
|
||||
BridgeClientConfig.NotifySystem = "ox" -- Change this to your notification system (ox/qb/esx?)
|
||||
BridgeClientConfig.ZoneSystem = "ox" -- Change this to your dialog system (ox/poly)
|
||||
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.DebugLevel = 3 -- Change this to your Debug level, 1 for none, 2 for some, 3 for all data
|
||||
BridgeClientConfig.ShowHelpText = "ox" --
|
||||
|
||||
Reference in new issue
Block a user