mirror of
https://github.com/CommunityOx/ox_lib.git
synced 2026-08-18 23:46:03 +01:00
feat(client/interface): list menu error catching
This commit is contained in:
@@ -2,6 +2,9 @@ local registeredMenus = {}
|
|||||||
local openMenu = nil
|
local openMenu = nil
|
||||||
|
|
||||||
function lib.registerMenu(data, cb)
|
function lib.registerMenu(data, cb)
|
||||||
|
if not data.id then return error('No menu id was provided.') end
|
||||||
|
if not data.title then return error('No menu title was provided.') end
|
||||||
|
if not data.options then return error('No menu options were provided.') end
|
||||||
data.cb = cb
|
data.cb = cb
|
||||||
registeredMenus[data.id] = data
|
registeredMenus[data.id] = data
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user