AVALANCHE: Add tryDropdown() and _inputTextBackup to Parser, implement handleReturn(), stub tryDropdown() in Parser.
This commit is contained in:
parent
a1a2fa2da8
commit
ad7f8add4d
6 changed files with 84 additions and 74 deletions
|
@ -56,8 +56,8 @@ Basher::Basher(AvalancheEngine *vm) {
|
||||||
|
|
||||||
void Basher::init() {
|
void Basher::init() {
|
||||||
/* new(previous);*/
|
/* new(previous);*/
|
||||||
if (!_vm->_gyro->last.empty())
|
if (!_vm->_parser->_inputTextBackup.empty())
|
||||||
_vm->_gyro->last.clear();
|
_vm->_parser->_inputTextBackup.clear();
|
||||||
|
|
||||||
normal_edit();
|
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() {
|
void Basher::typein() {
|
||||||
warning("STUB: Basher::typein()");
|
warning("STUB: Basher::typein()");
|
||||||
|
|
|
@ -74,8 +74,6 @@ private:
|
||||||
|
|
||||||
char firstchar(Common::String x);
|
char firstchar(Common::String x);
|
||||||
|
|
||||||
void try_dd();
|
|
||||||
|
|
||||||
void typein();
|
void typein();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -480,7 +480,6 @@ public:
|
||||||
|
|
||||||
|
|
||||||
/* previous:^previoustype;*/
|
/* previous:^previoustype;*/
|
||||||
Common::String last;
|
|
||||||
dnatype dna;
|
dnatype dna;
|
||||||
linetype lines[50]; /* For Also. */
|
linetype lines[50]; /* For Also. */
|
||||||
int16 c;
|
int16 c;
|
||||||
|
|
|
@ -70,6 +70,16 @@ void Parser::handleBackspace() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Parser::handleReturn() {
|
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() {
|
void Parser::plotText() {
|
||||||
|
@ -109,6 +119,10 @@ void Parser::cursorOff() {
|
||||||
_cursorState = false;
|
_cursorState = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Parser::tryDropdown() {
|
||||||
|
warning("STUB: Parser::tryDropdown()"); // TODO: Implement at the same time with Dropdown.
|
||||||
|
}
|
||||||
|
|
||||||
void Parser::drawCursor() {
|
void Parser::drawCursor() {
|
||||||
// Draw the '_' character. Similar to plotText().
|
// Draw the '_' character. Similar to plotText().
|
||||||
char cursor = '_';
|
char cursor = '_';
|
||||||
|
|
|
@ -36,6 +36,7 @@ class AvalancheEngine;
|
||||||
class Parser {
|
class Parser {
|
||||||
public:
|
public:
|
||||||
Common::String _inputText;
|
Common::String _inputText;
|
||||||
|
Common::String _inputTextBackup;
|
||||||
byte _inputTextPos;
|
byte _inputTextPos;
|
||||||
bool _quote; // 66 or 99 next?
|
bool _quote; // 66 or 99 next?
|
||||||
byte _leftMargin;
|
byte _leftMargin;
|
||||||
|
@ -57,6 +58,8 @@ public:
|
||||||
|
|
||||||
void cursorOff();
|
void cursorOff();
|
||||||
|
|
||||||
|
void tryDropdown(); // This asks the parsekey proc in Dropdown if it knows it.
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AvalancheEngine *_vm;
|
AvalancheEngine *_vm;
|
||||||
|
|
||||||
|
|
|
@ -1633,11 +1633,9 @@ void Trip::new_game_for_trippancy() { /* Called by gyro.newgame */
|
||||||
|
|
||||||
|
|
||||||
void Trip::handleMoveKey(const Common::Event &event) {
|
void Trip::handleMoveKey(const Common::Event &event) {
|
||||||
//if ((_vm->_gyro->ctrl == cjoy) | (!_vm->_gyro->dna.user_moves_avvy))
|
if (_vm->_dropdown->ddm_o.menunow)
|
||||||
// return;
|
_vm->_parser->tryDropdown();
|
||||||
//
|
else
|
||||||
// We don't mess around with the joystick.
|
|
||||||
|
|
||||||
switch (event.kbd.keycode) {
|
switch (event.kbd.keycode) {
|
||||||
case Common::KEYCODE_UP:
|
case Common::KEYCODE_UP:
|
||||||
if (_vm->_gyro->dna.rw != up) {
|
if (_vm->_gyro->dna.rw != up) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue