From cf7a4825ca48482ef766ad15e25029e84b46a920 Mon Sep 17 00:00:00 2001 From: Lotusotho <69006987+lotusotho@users.noreply.github.com> Date: Thu, 4 Feb 2021 22:36:01 +0100 Subject: [PATCH 1/2] Fixed bug at the start of the dialogue --- source/DialogueBox.hx | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx index f9c443952..ca3a5282f 100644 --- a/source/DialogueBox.hx +++ b/source/DialogueBox.hx @@ -33,6 +33,8 @@ class DialogueBox extends FlxSpriteGroup var handSelect:FlxSprite; var bgFade:FlxSprite; + + var firstDialogue:Bool = true; public function new(talkingRight:Bool = true, ?dialogueList:Array) { @@ -171,13 +173,13 @@ class DialogueBox extends FlxSpriteGroup dialogueStarted = true; } - if (FlxG.keys.justPressed.ANY) + if (FlxG.keys.justPressed.ANY && dialogueStarted == true) { remove(dialogue); - + FlxG.sound.play('assets/sounds/clickText' + TitleState.soundExt, 0.8); - if (dialogueList[1] == null) + if (dialogueList[1] == null && dialogueList[0] != null) { if (!isEnding) { @@ -209,7 +211,7 @@ class DialogueBox extends FlxSpriteGroup startDialogue(); } } - + super.update(elapsed); } @@ -218,7 +220,6 @@ class DialogueBox extends FlxSpriteGroup function startDialogue():Void { cleanDialog(); - // var theDialog:Alphabet = new Alphabet(0, 70, dialogueList[0], false, true); // dialogue = theDialog; // add(theDialog); From 9c0197cfc04d0cf84e83fc48a54a98de7e930d61 Mon Sep 17 00:00:00 2001 From: Lotusotho <69006987+lotusotho@users.noreply.github.com> Date: Thu, 4 Feb 2021 22:40:02 +0100 Subject: [PATCH 2/2] Deleted bool I created before --- source/DialogueBox.hx | 2 -- 1 file changed, 2 deletions(-) diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx index ca3a5282f..184ad4dbd 100644 --- a/source/DialogueBox.hx +++ b/source/DialogueBox.hx @@ -33,8 +33,6 @@ class DialogueBox extends FlxSpriteGroup var handSelect:FlxSprite; var bgFade:FlxSprite; - - var firstDialogue:Bool = true; public function new(talkingRight:Bool = true, ?dialogueList:Array) {