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
})
-- 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({
id = contextId,
title = option.response.title,
menu = 'npc_dialog_' .. npcId, -- Zurück-Link zum Hauptmenü
options = responseOptions
})
@ -112,9 +119,17 @@ RegisterNetEvent('npc-dialog:client:openDialog', function(data)
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
table.insert(options, {
title = "Verlassen",
title = "🚪 Verlassen",
description = "Dialog beenden",
icon = 'times',
onSelect = function()
@ -124,8 +139,7 @@ RegisterNetEvent('npc-dialog:client:openDialog', function(data)
lib.registerContext({
id = 'npc_dialog_' .. npcId,
title = npcData.dialog.title,
description = npcData.dialog.description, -- Hier wird die Beschreibung hinzugefügt
title = npcData.name,
options = options
})