From eaa7b0eafae2316e8e3f062cfa539b0061a031ba Mon Sep 17 00:00:00 2001 From: chrisgregan Date: Tue, 25 Aug 2015 16:14:14 +0100 Subject: [PATCH] Fixed Say Dialog registering a click when Menu option selected --- Assets/Fungus/Narrative/Scripts/DialogInput.cs | 12 +++++++++++- Assets/Fungus/UI/Scripts/Writer.cs | 2 +- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/Assets/Fungus/Narrative/Scripts/DialogInput.cs b/Assets/Fungus/Narrative/Scripts/DialogInput.cs index b53439cc..e29c2eef 100644 --- a/Assets/Fungus/Narrative/Scripts/DialogInput.cs +++ b/Assets/Fungus/Narrative/Scripts/DialogInput.cs @@ -9,7 +9,7 @@ namespace Fungus void OnNextLineEvent(); } - public class DialogInput : MonoBehaviour + public class DialogInput : MonoBehaviour { public enum ClickMode { @@ -141,6 +141,16 @@ namespace Fungus ignoreClickTimer = Mathf.Max (ignoreClickTimer - Time.deltaTime, 0f); } + // Ignore input events if a Menu is being displayed + if (MenuDialog.activeMenuDialog != null) + { + if (MenuDialog.activeMenuDialog.gameObject.activeSelf) + { + dialogClickedFlag = false; + nextLineInputFlag = false; + } + } + // Tell any listeners to move to the next line if (nextLineInputFlag) { diff --git a/Assets/Fungus/UI/Scripts/Writer.cs b/Assets/Fungus/UI/Scripts/Writer.cs index be064982..5b8f6751 100644 --- a/Assets/Fungus/UI/Scripts/Writer.cs +++ b/Assets/Fungus/UI/Scripts/Writer.cs @@ -12,7 +12,7 @@ namespace Fungus */ public interface IWriterListener { - // Called when a user input event (e.g. a click) has been received + // Called when a user input event (e.g. a click) has been handled by the Writer void OnInput(); // Called when the Writer starts writing new text