lation in menus + small tweak to prog bar and manifest + folder structure in menus

This commit is contained in:
MrNewb committed 2025-07-08 09:44:53 -04:00
1 parent ec74338565
commit 1a7112fe25
7 files changed
+120 -12

No files matched your search

+30
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