diff options
| author | Jordan Longstaff <JordanLongstaff@users.noreply.github.com> | 2024-10-15 23:50:10 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-10-15 20:50:10 -0700 |
| commit | da79e5e0151ad7decc2dbc63c55c6fe1a57a089a (patch) | |
| tree | 9357924c553a1b58c333107c33b28fb8a8c1e089 /soh/src/code | |
| parent | 45af1028afadfd61cbbf2b1584d83504f46ea696 (diff) | |
Fix fast speed skipping quick text markers (#4416)
Diffstat (limited to 'soh/src/code')
| -rw-r--r-- | soh/src/code/z_message_PAL.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/soh/src/code/z_message_PAL.c b/soh/src/code/z_message_PAL.c index 4736f95a7..5ced23cb7 100644 --- a/soh/src/code/z_message_PAL.c +++ b/soh/src/code/z_message_PAL.c @@ -856,6 +856,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { msgCtx->unk_E3D0 = 0; charTexIdx = 0; + gTextSpeed = CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1); + for (i = 0; i < msgCtx->textDrawPos; i++) { character = msgCtx->msgBufDecoded[i]; @@ -903,9 +905,9 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { *gfxP = gfx; return; case MESSAGE_QUICKTEXT_ENABLE: - if (i + 1 == msgCtx->textDrawPos && (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING || - (msgCtx->msgMode >= MSGMODE_OCARINA_STARTING && - msgCtx->msgMode < MSGMODE_SCARECROW_LONG_RECORDING_START))) { + if (i < msgCtx->textDrawPos && i + gTextSpeed >= msgCtx->textDrawPos && (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING || + (msgCtx->msgMode >= MSGMODE_OCARINA_STARTING && + msgCtx->msgMode < MSGMODE_SCARECROW_LONG_RECORDING_START))) { j = i; while (true) { lookAheadCharacter = msgCtx->msgBufDecoded[j]; @@ -922,8 +924,10 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { break; } } - i = j - 1; - msgCtx->textDrawPos = i + 1; + if (j > msgCtx->textDrawPos) { + i = j - 1; + msgCtx->textDrawPos = j; + } if (character) {} } @@ -1116,8 +1120,6 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) { break; } } - - gTextSpeed = CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1); if (msgCtx->textDelay == 0) { msgCtx->textDrawPos = i + gTextSpeed; } else if (msgCtx->textDelayTimer == 0) { |
