1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-08-03 19:35:29 +02:00
parent b0f9fbee65
commit d6480dfebd
2 changed files with 104 additions and 36 deletions

View file

@ -671,3 +671,43 @@ function OpenDJInterface()
end
end)
end
-- Callback-Handler für NUI
RegisterNUICallback('callback', function(data, cb)
if data.callbackId then
SendNUIMessage({
type = 'callbackResponse',
callbackId = data.callbackId,
response = data.response or {}
})
end
cb('ok')
end)
-- Verbesserte Error-Handling
RegisterNUICallback('error', function(data, cb)
print("DJ System Error: " .. (data.error or "Unknown error"))
cb('ok')
-- Benachrichtige Spieler
lib.notify({
title = 'DJ System Error',
description = data.error or "Ein unbekannter Fehler ist aufgetreten",
type = 'error'
})
end)
-- Debug-Funktion für NUI-Status
function DebugNUIStatus()
local nuiFocus = {GetNuiFocus()}
print("NUI Focus:", json.encode(nuiFocus))
print("isUIOpen:", isUIOpen)
print("isDJBooth:", isDJBooth)
print("nearestBooth:", nearestBooth)
end
-- Debug-Befehl
RegisterCommand('djdebug', function()
DebugNUIStatus()
end, false)