svn-id: r11600
This commit is contained in:
Gregory Montoir 2003-12-12 20:26:20 +00:00
parent 8f5c14aebe
commit c3c55a457c
6 changed files with 42 additions and 46 deletions

View file

@ -847,7 +847,7 @@ bool Command::handleDefaultCommand(bool walk) {
if (_selCmd.action == VERB_NONE) { if (_selCmd.action == VERB_NONE) {
_vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS); _vm->graphics()->textClear(CmdText::COMMAND_Y_POS, CmdText::COMMAND_Y_POS);
} }
_vm->walk()->moveJoe(0, _selPosX, _selPosY, false); // XXX inCutaway parameter _vm->walk()->moveJoe(0, _selPosX, _selPosY, false);
return true; return true;
} }
// check to see if one of the objects is hidden // check to see if one of the objects is hidden

View file

@ -132,31 +132,31 @@ int Input::checkKeys() {
switch (_inKey) { switch (_inKey) {
case KEY_SPACE: case KEY_SPACE:
_keyVerb = Verb(VERB_SKIP_TEXT); _keyVerb = VERB_SKIP_TEXT;
break; break;
case KEY_COMMA: case KEY_COMMA:
_keyVerb = Verb(VERB_SCROLL_UP); _keyVerb = VERB_SCROLL_UP;
break; break;
case KEY_DOT: case KEY_DOT:
_keyVerb = Verb(VERB_SCROLL_DOWN); _keyVerb = VERB_SCROLL_DOWN;
break; break;
case KEY_DIGIT_1: case KEY_DIGIT_1:
_keyVerb = Verb(VERB_DIGIT_1); _keyVerb = VERB_DIGIT_1;
break; break;
case KEY_DIGIT_2: case KEY_DIGIT_2:
_keyVerb = Verb(VERB_DIGIT_2); _keyVerb = VERB_DIGIT_2;
break; break;
case KEY_DIGIT_3: case KEY_DIGIT_3:
_keyVerb = Verb(VERB_DIGIT_3); _keyVerb = VERB_DIGIT_3;
break; break;
case KEY_DIGIT_4: case KEY_DIGIT_4:
_keyVerb = Verb(VERB_DIGIT_4); _keyVerb = VERB_DIGIT_4;
break; break;
case KEY_ESCAPE: case KEY_ESCAPE:
@ -174,12 +174,12 @@ int Input::checkKeys() {
case KEY_F1: // Use Journal case KEY_F1: // Use Journal
if (_cutawayRunning) { if (_cutawayRunning) {
if (_canQuit) { if (_canQuit) {
_keyVerb = Verb(VERB_USE_JOURNAL); _keyVerb = VERB_USE_JOURNAL;
_cutawayQuit = _talkQuit = true; _cutawayQuit = _talkQuit = true;
} }
} }
else { else {
_keyVerb = Verb(VERB_USE_JOURNAL); _keyVerb = VERB_USE_JOURNAL;
if (_canQuit) if (_canQuit)
_talkQuit = true; _talkQuit = true;
} }
@ -195,21 +195,21 @@ int Input::checkKeys() {
default: default:
if(_inKey == _currentCommandKeys[0]) if(_inKey == _currentCommandKeys[0])
_keyVerb = Verb(VERB_OPEN); _keyVerb = VERB_OPEN;
else if(_inKey == _currentCommandKeys[1]) else if(_inKey == _currentCommandKeys[1])
_keyVerb = Verb(VERB_CLOSE); _keyVerb = VERB_CLOSE;
else if(_inKey == _currentCommandKeys[2]) else if(_inKey == _currentCommandKeys[2])
_keyVerb = Verb(VERB_MOVE); _keyVerb = VERB_MOVE;
else if(_inKey == _currentCommandKeys[3]) else if(_inKey == _currentCommandKeys[3])
_keyVerb = Verb(VERB_GIVE); _keyVerb = VERB_GIVE;
else if(_inKey == _currentCommandKeys[4]) else if(_inKey == _currentCommandKeys[4])
_keyVerb = Verb(VERB_LOOK_AT); _keyVerb = VERB_LOOK_AT;
else if(_inKey == _currentCommandKeys[5]) else if(_inKey == _currentCommandKeys[5])
_keyVerb = Verb(VERB_PICK_UP); _keyVerb = VERB_PICK_UP;
else if(_inKey == _currentCommandKeys[6]) else if(_inKey == _currentCommandKeys[6])
_keyVerb = Verb(VERB_TALK_TO); _keyVerb = VERB_TALK_TO;
else if(_inKey == _currentCommandKeys[7]) else if(_inKey == _currentCommandKeys[7])
_keyVerb = Verb(VERB_USE); _keyVerb = VERB_USE;
break; break;
} }

View file

@ -41,25 +41,6 @@
namespace Queen { namespace Queen {
const Verb Logic::PANEL_VERBS[] = {
VERB_NONE,
VERB_OPEN,
VERB_CLOSE,
VERB_MOVE,
VERB_GIVE,
VERB_LOOK_AT,
VERB_PICK_UP,
VERB_TALK_TO,
VERB_USE,
VERB_SCROLL_UP,
VERB_SCROLL_DOWN,
VERB_DIGIT_1, // inventory item 1
VERB_DIGIT_2, // inventory item 2
VERB_DIGIT_3, // inventory item 3
VERB_DIGIT_4, // inventory item 4
};
Logic::Logic(QueenEngine *vm) Logic::Logic(QueenEngine *vm)
: _vm(vm) { : _vm(vm) {
_joe.x = _joe.y = 0; _joe.x = _joe.y = 0;
@ -1789,8 +1770,24 @@ void Logic::joeSpeak(uint16 descNum, bool objectType) {
Verb Logic::findVerbUnderCursor(int16 cursorx, int16 cursory) const { Verb Logic::findVerbUnderCursor(int16 cursorx, int16 cursory) const {
static const Verb pv[] = {
return Verb(PANEL_VERBS[zoneIn(ZONE_PANEL, cursorx, cursory)]); VERB_NONE,
VERB_OPEN,
VERB_CLOSE,
VERB_MOVE,
VERB_GIVE,
VERB_LOOK_AT,
VERB_PICK_UP,
VERB_TALK_TO,
VERB_USE,
VERB_SCROLL_UP,
VERB_SCROLL_DOWN,
VERB_INV_1,
VERB_INV_2,
VERB_INV_3,
VERB_INV_4,
};
return pv[zoneIn(ZONE_PANEL, cursorx, cursory)];
} }

View file

@ -427,9 +427,6 @@ protected:
Debug *_dbg; Debug *_dbg;
QueenEngine *_vm; QueenEngine *_vm;
//! Verbs (in order) available in panel
static const Verb PANEL_VERBS[];
}; };

View file

@ -298,12 +298,11 @@ void Walk::animatePerson(const MovePersonData *mpd, uint16 image, uint16 bobNum,
int16 Walk::moveJoe(int direction, int16 endx, int16 endy, bool inCutaway) { int16 Walk::moveJoe(int direction, int16 endx, int16 endy, bool inCutaway) {
_joeInterrupted = false;
_joeMoveBlock = false; _joeMoveBlock = false;
int16 can = 0; int16 can = 0;
initWalkData(); initWalkData();
_joeInterrupted = false;
uint16 oldx = _vm->graphics()->bob(0)->x; uint16 oldx = _vm->graphics()->bob(0)->x;
uint16 oldy = _vm->graphics()->bob(0)->y; uint16 oldy = _vm->graphics()->bob(0)->y;

View file

@ -75,6 +75,7 @@ public:
void stopJoe(); void stopJoe();
enum { enum {
MAX_WALK_DATA = 16 MAX_WALK_DATA = 16
}; };
@ -122,13 +123,15 @@ private:
uint16 _areaList[MAX_WALK_DATA]; uint16 _areaList[MAX_WALK_DATA];
uint16 _areaListCount; uint16 _areaListCount;
//! set if stopJoe() is called
bool _joeInterrupted; bool _joeInterrupted;
//! set if customMoveJoe() is called in joeAnimate() //! set if customMoveJoe() is called
bool _joeMoveBlock; bool _joeMoveBlock;
QueenEngine *_vm; QueenEngine *_vm;
static const MovePersonData _moveData[]; static const MovePersonData _moveData[];
}; };