Fixed menus....again
This commit is contained in:
1 parent
2ee4216f57
commit
d61070620a
5 files changed
+15
-9
No files matched your search
@@ -3,7 +3,7 @@ if GetResourceState('qb-menu') ~= 'started' and (BridgeClientConfig.MenuSystem ~
|
||||
---@param id string The menu ID.
|
||||
---@param menu table The Ox menu data.
|
||||
---@return table The QB menu data.
|
||||
local function OxToQBMenu(id, menu)
|
||||
function OxToQBMenu(id, menu)
|
||||
local qbMenu = {
|
||||
{
|
||||
header = menu.title,
|
||||
@@ -17,14 +17,16 @@ local function OxToQBMenu(id, menu)
|
||||
icon = v.icon,
|
||||
}
|
||||
|
||||
if v.onSelect and type(v.onSelect) == 'function' then
|
||||
if v.onSelect then
|
||||
button.params = {
|
||||
event = "community_bridge:client:MenuCallback",
|
||||
event = "community_bridge:client:MenuCallback",
|
||||
args = {id = id, selected = i, args = v.args, onSelect = v.onSelect},
|
||||
}
|
||||
end
|
||||
|
||||
table.insert(qbMenu, button)
|
||||
end
|
||||
|
||||
return qbMenu
|
||||
end
|
||||
|
||||
@@ -32,5 +34,6 @@ OpenMenu = function(id, data, useQBinput)
|
||||
if not useQBinput then
|
||||
data = OxToQBMenu(id, data)
|
||||
end
|
||||
return exports['qb-menu']:openMenu(data)
|
||||
exports['qb-menu']:openMenu(data)
|
||||
return data
|
||||
end
|
||||
Reference in new issue
Block a user