Commit 9afa1da3 authored by NukeKitty's avatar NukeKitty
Browse files

'Esc' immediately prints all text

Resolves #45
parent 75b32e03
...@@ -361,6 +361,14 @@ function typeNextCharacter() { ...@@ -361,6 +361,14 @@ function typeNextCharacter() {
}; };
window.addEventListener("keydown", function (ev) { window.addEventListener("keydown", function (ev) {
if (ev.keyCode === 27) { // check for esc before anything else, as it should always be available
//currentText = targetText;
while (currentText !== targetText) // print all available text immediately when esc is pressed
{
timeMsRemaining = 0;
typeNextCharacter();
}
}
if (currentText !== targetText && !sayAppend) { //additionally checks if currently writing an append for say command so input is only hiding in other circumstances if (currentText !== targetText && !sayAppend) { //additionally checks if currently writing an append for say command so input is only hiding in other circumstances
return; // do not want player typing while description is writing itself return; // do not want player typing while description is writing itself
} }
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment