From 611d78718d5c9ab657551aa492f5fbb84d9c0787 Mon Sep 17 00:00:00 2001 From: Flashfyre Date: Mon, 8 Apr 2024 21:10:53 -0400 Subject: [PATCH] Fix additional line break bug --- src/data/splash-messages.ts | 1 + src/ui/message-ui-handler.ts | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/data/splash-messages.ts b/src/data/splash-messages.ts index a1c0d3aad..02e33a12c 100644 --- a/src/data/splash-messages.ts +++ b/src/data/splash-messages.ts @@ -29,6 +29,7 @@ splashMessages.push(...[ 'You Do Not Start at Level 2000!', 'Also Try Pokéngine!', 'Also Try Emerald Rogue!', + 'Also Try Radical Red!', 'Eevee Expo!', 'YNOproject!' ]); \ No newline at end of file diff --git a/src/ui/message-ui-handler.ts b/src/ui/message-ui-handler.ts index 0f9c849e2..44b3cc1a1 100644 --- a/src/ui/message-ui-handler.ts +++ b/src/ui/message-ui-handler.ts @@ -54,7 +54,8 @@ export default abstract class MessageUiHandler extends AwaitableUiHandler { let lastLineCount = 1; let newText = ''; for (let w = 0; w < textWords.length; w++) { - const nextWordText = `${newText} ${textWords[w]}`; + const nextWordText = newText ? `${newText} ${textWords[w]}` : textWords[w]; + if (textWords[w].includes('\n')) { newText = nextWordText; lastLineCount++; @@ -68,7 +69,7 @@ export default abstract class MessageUiHandler extends AwaitableUiHandler { } } - text = newText.trimStart(); + text = newText; } if (this.textTimer) {