From 493d5b7279011fff823bd4c2a1eac3b7581a612e Mon Sep 17 00:00:00 2001 From: Kakarot <57848836+GhzGarage@users.noreply.github.com> Date: Tue, 11 Mar 2025 23:34:35 -0500 Subject: [PATCH] editor callbacks --- client/editor.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 client/editor.lua diff --git a/client/editor.lua b/client/editor.lua new file mode 100644 index 0000000..1096e75 --- /dev/null +++ b/client/editor.lua @@ -0,0 +1,20 @@ +RegisterNUICallback('saveConfig', function(data, cb) + local file = data.file + local configData = data.data + TriggerServerEvent('qb-core:server:configEditor', file, configData) + print("Saving config for file:", file) + cb('ok') +end) + +RegisterNUICallback('closeEditor', function(data, cb) + SetNuiFocus(false, false) + cb('ok') +end) + +RegisterNetEvent('qb-core:client:configEditor', function(allData) + SendNUIMessage({ + action = 'populateData', + data = allData + }) + SetNuiFocus(true, true) +end) \ No newline at end of file