This commit is contained in:
Nordi98 2025-08-06 16:37:06 +02:00
parent 510e3ffcf2
commit f43cf424cf
305 changed files with 34683 additions and 0 deletions

View file

@ -0,0 +1,30 @@
Menus = Menus or {}
Menu = {}
---Opens a menu based on the configuration.
---@param data table The menu data.
---@param useQb boolean Whether to use QB menu syntax.
---@return id string The menu ID.
function Menu.Open(data, useQb)
local id = data.id or Ids.CreateUniqueId(Menus, nil, nil)
Menus[id] = OpenMenu(id, data, useQb)
data.id = id
return id
end
function Menu.GetResourceName()
return GetMenuResourceName()
end
---Event to handle callback from menu selection.
---@param _args table The arguments passed to the callback.
---@return nil
RegisterNetEvent('community_bridge:client:MenuCallback', function(_args)
local id = _args.id
local onSelect = _args.onSelect
local args = _args.args
Menus[id] = nil
onSelect(args)
end)
return Menu