This commit is contained in:
Jan Racek
2026-03-29 16:13:59 +02:00
parent bc2067b0c4
commit 2cd9af28f1
11 changed files with 1469 additions and 1270 deletions

View File

@@ -2,7 +2,7 @@
-- npc.lua - NPC with multi-line dialogue
-- ============================================================================
-- Tests: onInteract, onButtonPress, Controls, UI text,
-- scene-level dialogue system, Input constants
-- scene-level dialogue system, Input constants, Interact API
local talked = false
@@ -13,6 +13,9 @@ end
function onInteract(self)
if isInDialogue() then return end
-- Disable interaction while dialogue is open so the prompt hides
Interact.SetEnabled(self, false)
if not talked then
talked = true
startDialogue({
@@ -36,5 +39,9 @@ function onButtonPress(self, button)
if not isInDialogue() then return end
if button == Input.CROSS then
advanceDialogue()
-- Re-enable interaction when dialogue ends
if not isInDialogue() then
Interact.SetEnabled(self, true)
end
end
end