1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-08-04 04:28:47 +02:00
parent 875c8448e1
commit c81ae4bb6d
219 changed files with 8036 additions and 7 deletions

View file

@ -0,0 +1,27 @@
local Context = {}
local menu = exports.ox_lib
local function findHeader(data)
for k, v in ipairs(data) do
if v.isMenuHeader then
return k, v.title
end
end
return false, 'Header'
end
---@param data ContextMenuProps | ContextMenuProps[]
function Context.openContext(data)
local id = require'utils'.await('UUID', false, 8)
local index, header = findHeader(data)
if index then table.remove(data, index) end
menu:registerContext({id = id, title = header, options = data})
menu:showContext(id)
return id
end
function Context.closeContext(onExit)
menu:hideContext(onExit)
end
return Context