From cdd6b0e8aac3857df909c0f26d9f8c85818878c9 Mon Sep 17 00:00:00 2001 From: jsb5468 Date: Thu, 26 Dec 2019 23:34:52 -0500 Subject: [PATCH] Refactor 6 improved how merge_desc works gave more fade time on the text modes as text was fading too fast to read before --- game.js | 4 ++-- recursive-macro.js | 10 ++++------ 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/game.js b/game.js index ae4520e..45bd110 100644 --- a/game.js +++ b/game.js @@ -48,12 +48,12 @@ const textFadeChoices = { }, dims: { name: "Text Dims", - animation: "log-dim 10s linear", + animation: "log-dim 15s linear", next: "fades" }, fades: { name: "Text Fades", - animation: "log-fade 10s linear", + animation: "log-fade 20s linear", next: "stays" } }; diff --git a/recursive-macro.js b/recursive-macro.js index d01374b..bf69a45 100644 --- a/recursive-macro.js +++ b/recursive-macro.js @@ -543,6 +543,7 @@ function merge_desc(list) { if (result.length > 0) { result = result.substring(0, result.length - 1); } + let article = "a " //a/an overwriting terms let forcedTerms = ["honor","heir"]; //words that need to start with an but don't start with a,e,i,o,u let force = false; @@ -555,14 +556,11 @@ function merge_desc(list) { for (let i of exceptionTerms){ if (i === result.substring(0, i.length)){exception = true;} } - //check if the string should start with a or an + //check if the string should start with an if ((force == true) || (exception == false && ((result.charAt(0) == "a")||(result.charAt(0) == "e")||(result.charAt(0) == "i")||(result.charAt(0) == "o")||(result.charAt(0) == "u")))){ - result = "an " + result; - }else{ - result = "a " + result; + article = "an "; } - - + result = article + result; return result; }