forked from Simnation/Main
Update client.lua
This commit is contained in:
parent
97cd9fbf74
commit
4222d6cafd
1 changed files with 19 additions and 5 deletions
|
@ -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
|
||||
})
|
||||
|
||||
|
@ -141,4 +155,4 @@ AddEventHandler('onResourceStop', function(resourceName)
|
|||
DeleteEntity(npc)
|
||||
end
|
||||
end
|
||||
end)
|
||||
end)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue