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
|
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
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue