1
0
Fork 0
forked from Simnation/Main
This commit is contained in:
Nordi98 2025-08-03 17:26:20 +02:00
parent cac2b97954
commit a3ab70ec94
4 changed files with 2773 additions and 109 deletions

View file

@ -75,70 +75,56 @@ function GetNearbyDJBooth()
return nil
end
function OpenDJMenu()
TriggerServerEvent('dj:server:getPlaylists')
local options = {
{
title = 'YouTube Song abspielen',
description = 'Spiele einen Song von YouTube ab',
icon = 'fab fa-youtube',
onSelect = function()
OpenYouTubeMenu()
end
},
{
title = 'Direkte URL abspielen',
description = 'Spiele einen Song von einer direkten URL ab',
icon = 'play',
onSelect = function()
OpenDirectUrlMenu()
end
},
{
title = 'Musik stoppen',
description = 'Stoppe die aktuelle Musik',
icon = 'stop',
onSelect = function()
StopMusic()
end
},
{
title = 'Lautstärke ändern',
description = 'Aktuelle Lautstärke: ' .. currentVolume .. '%',
icon = 'volume-up',
onSelect = function()
OpenVolumeMenu()
end
},
{
title = 'Playlists verwalten',
description = 'Erstelle und verwalte Playlists',
icon = 'list',
onSelect = function()
OpenPlaylistMenu()
end
}
}
if isPlaying and currentSong then
table.insert(options, 2, {
title = 'Aktueller Song',
description = currentSong.title,
icon = 'music',
disabled = true
-- Aktualisierte Client-Funktionen für das neue UI
function OpenDJInterface()
if not isDJBooth then
lib.notify({
title = 'DJ System',
description = 'Du musst an einem DJ Pult stehen',
type = 'error'
})
return
end
lib.registerContext({
id = 'dj_main_menu',
title = 'DJ System - ' .. currentDJBooth.name,
options = options
SetNuiFocus(true, true)
SendNUIMessage({
type = 'showDJInterface'
})
lib.showContext('dj_main_menu')
isUIOpen = true
-- Disable controls while UI is open
CreateThread(function()
while isUIOpen do
DisableAllControlActions(0)
EnableControlAction(0, 1, true) -- Mouse look
EnableControlAction(0, 2, true) -- Mouse look
Wait(0)
end
end)
end
-- NUI Callbacks für das neue Interface
RegisterNUICallback('djInterfaceClosed', function(data, cb)
SetNuiFocus(false, false)
isUIOpen = false
cb('ok')
end)
RegisterNUICallback('deckStateChanged', function(data, cb)
print(string.format('[DJ System] Deck %s %s: %s',
data.deck,
data.isPlaying and 'playing' or 'stopped',
data.track and data.track.title or 'No track'
))
-- Hier könntest du zusätzliche Logik hinzufügen
-- z.B. Synchronisation mit anderen Spielern
cb('ok')
end)
function OpenYouTubeMenu()
local input = lib.inputDialog('YouTube Song abspielen', {
{type = 'input', label = 'Song Titel', placeholder = 'z.B. Daft Punk - One More Time'},