From ad61ec342ba9322656e18dd5921fc94ad6e876b0 Mon Sep 17 00:00:00 2001 From: Yannik <80621863+vaporvee@users.noreply.github.com> Date: Fri, 26 May 2023 18:50:47 +0200 Subject: [PATCH] made it only read out string --- text_horror/app.js | 3 ++- text_horror/dialogue.json | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/text_horror/app.js b/text_horror/app.js index b4d2cb3..c54779f 100644 --- a/text_horror/app.js +++ b/text_horror/app.js @@ -23,9 +23,10 @@ function typeWriter() { } function mouseClick() { - if (document.getElementById("bubble").innerHTML.length == dlgLines[dlgPointer].toString().length) { + if (document.getElementById("bubble").innerHTML.length == dlgLines[dlgPointer].length) { if (dlgPointer < dlgLines.length - 1) { dlgPointer++; + while (!(typeof dlgLines[dlgPointer] === 'string')) dlgPointer++;//again if it's not string typeindex = 0; document.getElementById("bubble").innerHTML = ""; typeWriter(); diff --git a/text_horror/dialogue.json b/text_horror/dialogue.json index 5621811..8d953d8 100644 --- a/text_horror/dialogue.json +++ b/text_horror/dialogue.json @@ -2,5 +2,6 @@ "Hello welcome to TextHorror!", "This is the second line", 1, + 2, "Aand a third line" ] \ No newline at end of file