From df3695bba15631ba85b9a0c0ebdcd4d052aa1392 Mon Sep 17 00:00:00 2001 From: Cocodrulo <142546774+Cocodrulo@users.noreply.github.com> Date: Mon, 24 Mar 2025 12:24:29 +0000 Subject: [PATCH 1/2] Fixed some styles and added menu item specification --- README.md | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 611243a..34a436a 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,30 @@ -# qb-menu +# QBCore Menu Menu System for the QBCore Framework This is a modified version of **[NH Context](https://forum.cfx.re/t/no-longer-supported-standalone-nerohiro-s-context-menu-dynamic-event-firing-menu/2564083)** by **[NeroHiro](https://github.com/nerohiro)** ---[[ -EXAMPLE MENU ---]] +## Menu Item -``` +| Param | Description | Type | Default value | +| ----- | ----------- | ---- | ------- | +| header| The item title | string | No default | +| txt? | The item description | string | "" | +| isMenuHeader? | Whether the item is the header of the menu | boolean | false | +| disabled? | Whether the item is clickable | boolean | false | +| params | The options of the menu | table | No default | +| params.event | Event name, command or function | string \| function | "" | +| params.isAction? | Whether the event is a function | boolean | false | +| params.isServer? | Whether the event is the name of a server event | boolean | false | +| params.isCommand? | Whether the event is the name of command | boolean | false | +| params.isQBCommand? | Whether the event is the name of a qbcore command | boolean | false | +| params.args? | Arguments for the events/commans/function | table | nil | + + +# Examples + +```LUA RegisterCommand("qbmenutest", function(source, args, raw) - openMenu({ + exports["qb-menu"]:openMenu({ { header = "Main Title", isMenuHeader = true, -- Set to true to make a nonclickable title @@ -39,10 +54,10 @@ RegisterCommand("qbmenutest", function(source, args, raw) }) end) ``` -``` +```LUA RegisterNetEvent('qb-menu:client:testMenu2', function(data) local number = data.number - openMenu({ + exports["qb-menu"]:openMenu({ { header = "< Go Back", }, @@ -59,7 +74,7 @@ RegisterNetEvent('qb-menu:client:testMenu2', function(data) }) end) ``` -``` +```LUA RegisterNetEvent('qb-menu:client:testButton', function(data) TriggerEvent('QBCore:Notify', data.message) end) From 834870f9b5d54d31798790a7faebcf6a0e11c13c Mon Sep 17 00:00:00 2001 From: Joel <34402846+Qwerty1Verified@users.noreply.github.com> Date: Thu, 10 Apr 2025 22:08:42 +0100 Subject: [PATCH 2/2] docs: revert readme label change --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 34a436a..97101e4 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# QBCore Menu +# qb-menu Menu System for the QBCore Framework This is a modified version of **[NH Context](https://forum.cfx.re/t/no-longer-supported-standalone-nerohiro-s-context-menu-dynamic-event-firing-menu/2564083)** by **[NeroHiro](https://github.com/nerohiro)**