mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-23 11:04:44 +00:00
TWINE: fixed fading of last chars on a dialog page
see https://bugs.scummvm.org/ticket/11982
This commit is contained in:
parent
ee11e3d9df
commit
eb2e7ff5f5
@ -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)) {
|
||||
|
@ -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();
|
||||
|
@ -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) {
|
||||
|
@ -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();
|
||||
|
||||
/**
|
||||
|
Loading…
x
Reference in New Issue
Block a user