TWINE: fixed fading of last chars on a dialog page

see https://bugs.scummvm.org/ticket/11982
This commit is contained in:
Martin Gerhardy 2020-12-30 23:32:41 +01:00
parent ee11e3d9df
commit eb2e7ff5f5
4 changed files with 16 additions and 0 deletions

View File

@ -1192,6 +1192,8 @@ void Menu::processInventoryMenu() {
if (textState == ProgressiveTextState::ContinueRunning) {
textState = _engine->_text->updateProgressiveText();
} else {
_engine->_text->fadeInRemainingChars();
}
if (_engine->_input->toggleActionIfActive(TwinEActionType::UINextPage)) {

View File

@ -364,6 +364,8 @@ void GameState::processFoundItem(int32 item) {
if (textState == ProgressiveTextState::ContinueRunning) {
_engine->_interface->resetClip();
textState = _engine->_text->updateProgressiveText();
} else {
_engine->_text->fadeInRemainingChars();
}
_engine->_redraw->flipRedrawAreas();

View File

@ -520,6 +520,14 @@ int32 Text::getCharHeight(uint8 chr) const {
return stream.readByte();
}
void Text::fadeInRemainingChars() {
if (_fadeInCharactersPos <= 0) {
return;
}
fadeInCharacters(_fadeInCharactersPos, _dialTextStopColor);
--_fadeInCharactersPos;
}
ProgressiveTextState Text::updateProgressiveText() {
if (!_hasValidTextHandle) {
return ProgressiveTextState::End;
@ -595,6 +603,8 @@ bool Text::displayText(int32 index, bool showText, bool playVox) {
_engine->readKeys();
if (textState == ProgressiveTextState::ContinueRunning) {
textState = updateProgressiveText();
} else {
fadeInRemainingChars();
}
if (_engine->_input->toggleActionIfActive(TwinEActionType::UINextPage)) {
if (textState == ProgressiveTextState::End) {

View File

@ -114,6 +114,7 @@ enum class ProgressiveTextState {
};
class TwinEEngine;
class Text {
private:
TwinEEngine *_engine;
@ -276,6 +277,7 @@ public:
void initText(int32 index);
void initInventoryText(int index);
void initItemFoundText(int index);
void fadeInRemainingChars();
ProgressiveTextState updateProgressiveText();
/**