mirror of
https://github.com/cliffe/BreakEscape.git
synced 2026-02-21 19:28:03 +00:00
Implemented proper handling for the #end_conversation tag to automatically close the conversation UI without requiring manual ESC key press. Changes: 1. Added event listener for 'npc-conversation-ended' event in setupEventListeners() - Saves NPC state when event is received - Automatically ends minigame and returns to game - Verifies event is for current NPC 2. Updated showCurrentDialogue() to detect graceful conversation endings - Checks for #end_conversation tag when story reaches hasEnded - If tag present, waits for event handler instead of showing manual exit message - Preserves manual exit message for unexpected/error END states Flow: - Ink script: #end_conversation -> DONE - PhoneChatConversation processes tag and dispatches npc-conversation-ended event - PersonChatMinigame receives event and automatically closes - Player sees smooth transition back to game This eliminates the "(End of conversation - press ESC to exit)" message for normal conversation endings while preserving it as a safety fallback.