1
0
Fork 0
forked from Simnation/Main

Update client.lua

This commit is contained in:
Nordi98 2025-07-20 21:02:39 +02:00
parent 97cd9fbf74
commit 4222d6cafd

View file

@ -87,10 +87,17 @@ local function CreateDialogOptions(options, npcId, parentId)
end end
}) })
-- Erste Option ist immer die NPC-Antwort (nur Text)
table.insert(responseOptions, 1, {
title = "💬 " .. option.response.title,
description = option.response.description,
icon = 'comment',
disabled = true -- Macht die Option nicht klickbar, zeigt aber den Text
})
lib.registerContext({ lib.registerContext({
id = contextId, id = contextId,
title = option.response.title, title = option.response.title,
menu = 'npc_dialog_' .. npcId, -- Zurück-Link zum Hauptmenü
options = responseOptions options = responseOptions
}) })
@ -112,9 +119,17 @@ RegisterNetEvent('npc-dialog:client:openDialog', function(data)
local options = CreateDialogOptions(npcData.dialog.options, npcId) local options = CreateDialogOptions(npcData.dialog.options, npcId)
-- Erste Option ist die NPC-Begrüßung (nur Text)
table.insert(options, 1, {
title = "💬 " .. npcData.dialog.title,
description = npcData.dialog.description,
icon = 'comment',
disabled = true -- Zeigt nur den Text, nicht klickbar
})
-- Verlassen Option hinzufügen -- Verlassen Option hinzufügen
table.insert(options, { table.insert(options, {
title = "Verlassen", title = "🚪 Verlassen",
description = "Dialog beenden", description = "Dialog beenden",
icon = 'times', icon = 'times',
onSelect = function() onSelect = function()
@ -124,8 +139,7 @@ RegisterNetEvent('npc-dialog:client:openDialog', function(data)
lib.registerContext({ lib.registerContext({
id = 'npc_dialog_' .. npcId, id = 'npc_dialog_' .. npcId,
title = npcData.dialog.title, title = npcData.name,
description = npcData.dialog.description, -- Hier wird die Beschreibung hinzugefügt
options = options options = options
}) })
@ -141,4 +155,4 @@ AddEventHandler('onResourceStop', function(resourceName)
DeleteEntity(npc) DeleteEntity(npc)
end end
end end
end) end)