From b7a76bdc8e57241a23fca8e7991fe7f70cd42ca6 Mon Sep 17 00:00:00 2001 From: MtH Date: Tue, 30 Mar 2021 18:59:14 +0200 Subject: [PATCH] skip to end of dialogue if not finished --- source/DialogueBox.hx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/source/DialogueBox.hx b/source/DialogueBox.hx index ade30a8e3..e6a7ee5ec 100644 --- a/source/DialogueBox.hx +++ b/source/DialogueBox.hx @@ -150,6 +150,7 @@ class DialogueBox extends FlxSpriteGroup var dialogueOpened:Bool = false; var dialogueStarted:Bool = false; + var dialogueEnded:Bool = false; override function update(elapsed:Float) { @@ -180,7 +181,7 @@ class DialogueBox extends FlxSpriteGroup dialogueStarted = true; } - if (FlxG.keys.justPressed.ANY && dialogueStarted == true) + if (FlxG.keys.justPressed.ANY && dialogueEnded) { remove(dialogue); @@ -219,6 +220,8 @@ class DialogueBox extends FlxSpriteGroup startDialogue(); } } + else if (FlxG.keys.justPressed.ANY && dialogueStarted) + swagDialogue.skip(); super.update(elapsed); } @@ -239,8 +242,10 @@ class DialogueBox extends FlxSpriteGroup { trace("dialogue finish"); handSelect.visible = true; + dialogueEnded = true; }; handSelect.visible = false; + dialogueEnded = false; switch (curCharacter) {