forked from Simnation/Main
ed
This commit is contained in:
parent
b0f9fbee65
commit
d6480dfebd
2 changed files with 104 additions and 36 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue