From 17395548e23883dadf43794f8f95c486c13dbb4e Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 4 Jan 2025 01:48:43 -0800 Subject: [PATCH 1/3] update for isAction no sense in having ``` data[#data = 1] = { data.params.event[?] } ``` if you are just utilizing a function with this PR you can do ``` exports['qb-menu']:OpenMenu({ { header = 'hello', isAction = function() print('hello world') end } }) ``` --- client/main.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/client/main.lua b/client/main.lua index 1cc83a8..eaf0562 100644 --- a/client/main.lua +++ b/client/main.lua @@ -74,6 +74,11 @@ RegisterNUICallback('clickedButton', function(option, cb) if sendData then local data = sendData[tonumber(option)] sendData = nil + if data.isAction ~= nil then + data.isAction() + cb('ok') + return + end if data then if data.params.event then if data.params.isServer then @@ -93,6 +98,7 @@ RegisterNUICallback('clickedButton', function(option, cb) cb('ok') end) + RegisterNUICallback('closeMenu', function(_, cb) headerShown = false sendData = nil From d6eb975be9a3b970203993aaa78c07fe6521c9cd Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 4 Jan 2025 04:07:04 -0800 Subject: [PATCH 2/3] Changed data.isAction to data.action Keeps consistent with qb-target --- client/main.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/client/main.lua b/client/main.lua index eaf0562..02776f7 100644 --- a/client/main.lua +++ b/client/main.lua @@ -74,8 +74,8 @@ RegisterNUICallback('clickedButton', function(option, cb) if sendData then local data = sendData[tonumber(option)] sendData = nil - if data.isAction ~= nil then - data.isAction() + if data.action ~= nil then + data.action() cb('ok') return end From 59fdd698d5cce44c4616259f456bf529cedddba7 Mon Sep 17 00:00:00 2001 From: Mustache Dom <123716453+Mustachedom@users.noreply.github.com> Date: Sat, 4 Jan 2025 21:58:48 -0800 Subject: [PATCH 3/3] changed from isAction to action keeps more in line with qb-target also removed blank space --- client/main.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/main.lua b/client/main.lua index 02776f7..b394a6b 100644 --- a/client/main.lua +++ b/client/main.lua @@ -74,7 +74,7 @@ RegisterNUICallback('clickedButton', function(option, cb) if sendData then local data = sendData[tonumber(option)] sendData = nil - if data.action ~= nil then + if data.action ~= nil then data.action() cb('ok') return