Fix fast speed skipping quick text markers (#4416)

This commit is contained in:
Jordan Longstaff 2024-10-15 23:50:10 -04:00 committed by GitHub
parent 45af1028af
commit da79e5e015
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -856,6 +856,8 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
msgCtx->unk_E3D0 = 0; msgCtx->unk_E3D0 = 0;
charTexIdx = 0; charTexIdx = 0;
gTextSpeed = CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1);
for (i = 0; i < msgCtx->textDrawPos; i++) { for (i = 0; i < msgCtx->textDrawPos; i++) {
character = msgCtx->msgBufDecoded[i]; character = msgCtx->msgBufDecoded[i];
@ -903,9 +905,9 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
*gfxP = gfx; *gfxP = gfx;
return; return;
case MESSAGE_QUICKTEXT_ENABLE: case MESSAGE_QUICKTEXT_ENABLE:
if (i + 1 == msgCtx->textDrawPos && (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING || if (i < msgCtx->textDrawPos && i + gTextSpeed >= msgCtx->textDrawPos && (msgCtx->msgMode == MSGMODE_TEXT_DISPLAYING ||
(msgCtx->msgMode >= MSGMODE_OCARINA_STARTING && (msgCtx->msgMode >= MSGMODE_OCARINA_STARTING &&
msgCtx->msgMode < MSGMODE_SCARECROW_LONG_RECORDING_START))) { msgCtx->msgMode < MSGMODE_SCARECROW_LONG_RECORDING_START))) {
j = i; j = i;
while (true) { while (true) {
lookAheadCharacter = msgCtx->msgBufDecoded[j]; lookAheadCharacter = msgCtx->msgBufDecoded[j];
@ -922,8 +924,10 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
break; break;
} }
} }
i = j - 1; if (j > msgCtx->textDrawPos) {
msgCtx->textDrawPos = i + 1; i = j - 1;
msgCtx->textDrawPos = j;
}
if (character) {} if (character) {}
} }
@ -1116,8 +1120,6 @@ void Message_DrawText(PlayState* play, Gfx** gfxP) {
break; break;
} }
} }
gTextSpeed = CVarGetInteger(CVAR_ENHANCEMENT("TextSpeed"), 1);
if (msgCtx->textDelay == 0) { if (msgCtx->textDelay == 0) {
msgCtx->textDrawPos = i + gTextSpeed; msgCtx->textDrawPos = i + gTextSpeed;
} else if (msgCtx->textDelayTimer == 0) { } else if (msgCtx->textDelayTimer == 0) {