diff options
-rw-r--r-- | engines/avalanche/basher2.cpp | 8 | ||||
-rw-r--r-- | engines/avalanche/basher2.h | 2 | ||||
-rw-r--r-- | engines/avalanche/gyro2.h | 1 | ||||
-rw-r--r-- | engines/avalanche/parser.cpp | 14 | ||||
-rw-r--r-- | engines/avalanche/parser.h | 5 | ||||
-rw-r--r-- | engines/avalanche/trip6.cpp | 128 |
6 files changed, 84 insertions, 74 deletions
diff --git a/engines/avalanche/basher2.cpp b/engines/avalanche/basher2.cpp index 8e51abeb96..0df3b39b0d 100644 --- a/engines/avalanche/basher2.cpp +++ b/engines/avalanche/basher2.cpp @@ -56,8 +56,8 @@ Basher::Basher(AvalancheEngine *vm) { void Basher::init() { /* new(previous);*/ - if (!_vm->_gyro->last.empty()) - _vm->_gyro->last.clear(); + if (!_vm->_parser->_inputTextBackup.empty()) + _vm->_parser->_inputTextBackup.clear(); normal_edit(); @@ -140,9 +140,7 @@ char Basher::firstchar(Common::String x) { } -void Basher::try_dd() { /* This asks the Parsekey proc in Dropdown if it knows it. */ - warning("STUB: Basher::try_dd()"); -} + void Basher::typein() { warning("STUB: Basher::typein()"); diff --git a/engines/avalanche/basher2.h b/engines/avalanche/basher2.h index a6d7067945..bc62fe67cf 100644 --- a/engines/avalanche/basher2.h +++ b/engines/avalanche/basher2.h @@ -74,8 +74,6 @@ private: char firstchar(Common::String x); - void try_dd(); - void typein(); }; diff --git a/engines/avalanche/gyro2.h b/engines/avalanche/gyro2.h index 5038e51a08..50ae339987 100644 --- a/engines/avalanche/gyro2.h +++ b/engines/avalanche/gyro2.h @@ -480,7 +480,6 @@ public: /* previous:^previoustype;*/ - Common::String last; dnatype dna; linetype lines[50]; /* For Also. */ int16 c; diff --git a/engines/avalanche/parser.cpp b/engines/avalanche/parser.cpp index 14eae449ed..fca29adace 100644 --- a/engines/avalanche/parser.cpp +++ b/engines/avalanche/parser.cpp @@ -70,6 +70,16 @@ void Parser::handleBackspace() { } void Parser::handleReturn() { + if (_vm->_dropdown->ddm_o.menunow) + _vm->_parser->tryDropdown(); + else { + _vm->_logger->log_command(_inputText); + + if (!_inputText.empty()) + _inputTextBackup = _inputText; + _vm->_acci->parse(); + _vm->_acci->do_that(); + } } void Parser::plotText() { @@ -109,6 +119,10 @@ void Parser::cursorOff() { _cursorState = false; } +void Parser::tryDropdown() { + warning("STUB: Parser::tryDropdown()"); // TODO: Implement at the same time with Dropdown. +} + void Parser::drawCursor() { // Draw the '_' character. Similar to plotText(). char cursor = '_'; diff --git a/engines/avalanche/parser.h b/engines/avalanche/parser.h index 748498816f..1cfb21bb52 100644 --- a/engines/avalanche/parser.h +++ b/engines/avalanche/parser.h @@ -36,11 +36,12 @@ class AvalancheEngine; class Parser { public: Common::String _inputText; + Common::String _inputTextBackup; byte _inputTextPos; bool _quote; // 66 or 99 next? byte _leftMargin; bool _cursorState; - + Parser(AvalancheEngine *vm); @@ -57,6 +58,8 @@ public: void cursorOff(); + void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it. + private: AvalancheEngine *_vm; diff --git a/engines/avalanche/trip6.cpp b/engines/avalanche/trip6.cpp index ff3a757265..d7823c3639 100644 --- a/engines/avalanche/trip6.cpp +++ b/engines/avalanche/trip6.cpp @@ -1633,72 +1633,70 @@ void Trip::new_game_for_trippancy() { /* Called by gyro.newgame */ void Trip::handleMoveKey(const Common::Event &event) { - //if ((_vm->_gyro->ctrl == cjoy) | (!_vm->_gyro->dna.user_moves_avvy)) - // return; - // - // We don't mess around with the joystick. - - switch (event.kbd.keycode) { - case Common::KEYCODE_UP: - if (_vm->_gyro->dna.rw != up) { - _vm->_gyro->dna.rw = up; - rwsp(0, _vm->_gyro->dna.rw); - } else - stopwalking(); - break; - case Common::KEYCODE_DOWN: - if (_vm->_gyro->dna.rw != down) { - _vm->_gyro->dna.rw = down; - rwsp(0, _vm->_gyro->dna.rw); - } else - stopwalking(); - break; - case Common::KEYCODE_LEFT: - if (_vm->_gyro->dna.rw != left) { - _vm->_gyro->dna.rw = left; - rwsp(0, _vm->_gyro->dna.rw); - } else - stopwalking(); - break; - case Common::KEYCODE_RIGHT: - if (_vm->_gyro->dna.rw != right) { - _vm->_gyro->dna.rw = right; - rwsp(0, _vm->_gyro->dna.rw); - } else - stopwalking(); - break; - case Common::KEYCODE_PAGEUP: - if (_vm->_gyro->dna.rw != ur) { - _vm->_gyro->dna.rw = ur; - rwsp(0, _vm->_gyro->dna.rw); - } else - stopwalking(); - break; - case Common::KEYCODE_PAGEDOWN: - if (_vm->_gyro->dna.rw != dr) { - _vm->_gyro->dna.rw = dr; - rwsp(0, _vm->_gyro->dna.rw); - } else - stopwalking(); - break; - case Common::KEYCODE_END: - if (_vm->_gyro->dna.rw != dl) { - _vm->_gyro->dna.rw = dl; - rwsp(0, _vm->_gyro->dna.rw); - } else - stopwalking(); - break; - case Common::KEYCODE_HOME: - if (_vm->_gyro->dna.rw != ul) { - _vm->_gyro->dna.rw = ul; - rwsp(0, _vm->_gyro->dna.rw); - } else + if (_vm->_dropdown->ddm_o.menunow) + _vm->_parser->tryDropdown(); + else + switch (event.kbd.keycode) { + case Common::KEYCODE_UP: + if (_vm->_gyro->dna.rw != up) { + _vm->_gyro->dna.rw = up; + rwsp(0, _vm->_gyro->dna.rw); + } else + stopwalking(); + break; + case Common::KEYCODE_DOWN: + if (_vm->_gyro->dna.rw != down) { + _vm->_gyro->dna.rw = down; + rwsp(0, _vm->_gyro->dna.rw); + } else + stopwalking(); + break; + case Common::KEYCODE_LEFT: + if (_vm->_gyro->dna.rw != left) { + _vm->_gyro->dna.rw = left; + rwsp(0, _vm->_gyro->dna.rw); + } else + stopwalking(); + break; + case Common::KEYCODE_RIGHT: + if (_vm->_gyro->dna.rw != right) { + _vm->_gyro->dna.rw = right; + rwsp(0, _vm->_gyro->dna.rw); + } else + stopwalking(); + break; + case Common::KEYCODE_PAGEUP: + if (_vm->_gyro->dna.rw != ur) { + _vm->_gyro->dna.rw = ur; + rwsp(0, _vm->_gyro->dna.rw); + } else + stopwalking(); + break; + case Common::KEYCODE_PAGEDOWN: + if (_vm->_gyro->dna.rw != dr) { + _vm->_gyro->dna.rw = dr; + rwsp(0, _vm->_gyro->dna.rw); + } else + stopwalking(); + break; + case Common::KEYCODE_END: + if (_vm->_gyro->dna.rw != dl) { + _vm->_gyro->dna.rw = dl; + rwsp(0, _vm->_gyro->dna.rw); + } else + stopwalking(); + break; + case Common::KEYCODE_HOME: + if (_vm->_gyro->dna.rw != ul) { + _vm->_gyro->dna.rw = ul; + rwsp(0, _vm->_gyro->dna.rw); + } else + stopwalking(); + break; + case Common::KEYCODE_KP5: stopwalking(); - break; - case Common::KEYCODE_KP5: - stopwalking(); - break; - } + break; + } } |