From c8ac76b22bfd676bb72a850a141730022d6d476c Mon Sep 17 00:00:00 2001 From: Torbjörn Andersson Date: Mon, 6 Apr 2015 10:42:16 +0200 Subject: MADS: Show first character of the Rex Nebular copy protection word --- engines/mads/nebular/dialogs_nebular.cpp | 35 +++++++++++++++++++------------- 1 file changed, 21 insertions(+), 14 deletions(-) (limited to 'engines/mads/nebular') diff --git a/engines/mads/nebular/dialogs_nebular.cpp b/engines/mads/nebular/dialogs_nebular.cpp index 731e7e960d..10715797ed 100644 --- a/engines/mads/nebular/dialogs_nebular.cpp +++ b/engines/mads/nebular/dialogs_nebular.cpp @@ -438,24 +438,31 @@ void CopyProtectionDialog::show() { _vm->_screen.copyRectToScreen(inputArea); _vm->_screen.updateScreen(); + bool firstTime = true; + while (!_vm->shouldQuit()) { - while (!_vm->shouldQuit() && !_vm->_events->isKeyPressed()) { - _vm->_events->delay(1); - } + if (!firstTime) { + while (!_vm->shouldQuit() && !_vm->_events->isKeyPressed()) { + _vm->_events->delay(1); + } - if (_vm->shouldQuit()) - break; + if (_vm->shouldQuit()) + break; - curKey = _vm->_events->getKey(); - - if (curKey.keycode == Common::KEYCODE_RETURN || curKey.keycode == Common::KEYCODE_KP_ENTER) - break; - else if (curKey.keycode == Common::KEYCODE_BACKSPACE) - _textInput.deleteLastChar(); - else if (_textInput.size() < 14) - _textInput += curKey.ascii; + curKey = _vm->_events->getKey(); + + if (curKey.keycode == Common::KEYCODE_RETURN || curKey.keycode == Common::KEYCODE_KP_ENTER) + break; + else if (curKey.keycode == Common::KEYCODE_BACKSPACE) + _textInput.deleteLastChar(); + else if (_textInput.size() < 14) + _textInput += curKey.ascii; - _vm->_events->_pendingKeys.clear(); + _vm->_events->_pendingKeys.clear(); + } else { + firstTime = false; + _textInput = _hogEntry._word[0]; + } _vm->_screen.copyFrom(origInput, Common::Rect(0, 0, inputArea.width(), inputArea.height()), Common::Point(inputArea.left, inputArea.top)); _font->writeString(&_vm->_screen, _textInput, -- cgit v1.2.3