eh fixes
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user