From d1d6ad9297ad5a3a7fb4100fd5bb9f2641a5763f Mon Sep 17 00:00:00 2001 From: RhenaudTheLukark Date: Mon, 8 Apr 2024 01:09:38 +0200 Subject: [PATCH] [Fix] Swap [next] and [nextthisnow] usage --- Assets/Scripts/Text/TextManager.cs | 9 ++++++--- Documentation CYF 1.0/pages/api-text.html | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/Assets/Scripts/Text/TextManager.cs b/Assets/Scripts/Text/TextManager.cs index a7563bff8..089b478ed 100644 --- a/Assets/Scripts/Text/TextManager.cs +++ b/Assets/Scripts/Text/TextManager.cs @@ -870,6 +870,9 @@ protected virtual void Update() { if (!HandleShowLetter(ref soundPlayed, ref lastLetter)) break; + if (letterTimer < timePerLetter) + break; + if (!firstChar) letterTimer -= timePerLetter; else { @@ -922,7 +925,7 @@ private bool HandleShowLetter(ref bool soundPlayed, ref int lastLetter, bool fro currentReferenceCharacter++; } - if (!string.IsNullOrEmpty(GetVoice()) && !muted && !soundPlayed && (GlobalControls.retroMode || textQueue[currentLine].Text[currentCharacter] != ' ')) { + if (!string.IsNullOrEmpty(GetVoice()) && !muted && !soundPlayed && (GlobalControls.retroMode || (currentCharacter < textQueue[currentLine].Text.Length && textQueue[currentLine].Text[currentCharacter] != ' '))) { soundPlayed = true; try { UnitaleUtil.PlayVoice("BubbleSound", GetVoice()); } catch (CYFException e) { UnitaleUtil.DisplayLuaError("Playing a voice", e.Message); } @@ -1067,9 +1070,9 @@ private void InUpdateControlCommand(DynValue command, int index = 0) { break; case "novoice": commandVoice = "none"; break; - case "next": autoSkip = true; break; + case "next": autoSkipAll = true; break; case "finished": skippableToNextLine = true; break; - case "nextthisnow": autoSkipAll = true; break; + case "nextthisnow": autoSkip = true; break; case "speed": try { //you can only set text speed to a number >= 0 diff --git a/Documentation CYF 1.0/pages/api-text.html b/Documentation CYF 1.0/pages/api-text.html index be9087a1f..402d9f70f 100644 --- a/Documentation CYF 1.0/pages/api-text.html +++ b/Documentation CYF 1.0/pages/api-text.html @@ -272,7 +272,8 @@

Inline commands



[next] - Skips to the next dialogue of the current monster only, even if several monsters are speaking, effectively desyncing their text. + Skips to the next line of the current text object automatically. + If used in a monster's text object, skipe the dialogue of all monsters, without concern for the other monsters' dialogue's state. You can also use this for textbox trickery. Here's an example to replicate Flowey's text-changing effect if you dodge the Friendliness Pellets(tm) twice.

@@ -283,8 +284,9 @@

Inline commands



[nextthisnow] - Skips to the next dialogue of all monsters automatically, without concern for the other monsters' dialogue's state. - It acts much like [next] except it affects all monsters. + Skips to the next dialogue of the current monster only, even if several monsters are speaking, effectively desyncing their text. + It acts like [next] outside of monster text objects, its only difference is that it only affects the current monster + if used on a monster's text object.