another step in verb implementation:

- objectMap responds to mouse move  (but respond script not run well ?)

loadStrings add some special count check
- so all other LUT based resource should implement this technique

svn-id: r16594
This commit is contained in:
Andrew Kurushin 2005-01-18 15:01:21 +00:00
parent c1ce30b0bf
commit b4b2e52df7
9 changed files with 111 additions and 140 deletions

View file

@ -478,84 +478,6 @@ void Interface::handleCommandUpdate(SURFACE *ds, const Point& mousePoint) {
}
int Interface::handlePlayfieldClick(SURFACE *ds, const Point& imousePt) {
// return SUCCESS;
int objectNum;
uint16 object_flags = 0;
// int script_num;
Location location;
objectNum = _vm->_scene->_objectMap->hitTest(imousePt);
if (objectNum == -1) {
// Player clicked on empty spot - walk here regardless of verb
location.fromScreenPoint(imousePt);
_vm->_actor->actorWalkTo(ID_PROTAG, location);
return SUCCESS;
}
// object_flags = _vm->_scene->_objectMap->getFlags(objectNum);
if (object_flags & kHitZoneExit) { // FIXME. This is wrong
/* if ((script_num = _vm->_scene->_objectMap->getEPNum(objectNum)) != -1) {
// Set active verb in script module
_vm->_script->putWord(4, 4, I_VerbData[_activeVerb].s_verb);
// Execute object script if present
if (script_num != 0) {
_vm->_script->SThreadExecute(_iThread, script_num);
}
}*/
} else {
// Not a normal scene object - walk to it as if it weren't there
location.fromScreenPoint(imousePt);
_vm->_actor->actorWalkTo(ID_PROTAG, location);
}
return SUCCESS;
}
int Interface::handlePlayfieldUpdate(SURFACE *ds, const Point& imousePt) {
return SUCCESS;
/*
const char *object_name;
int objectNum;
uint16 object_flags = 0;
char new_status[STATUS_TEXT_LEN];
new_status[0] = 0;
objectNum = _vm->_scene->_objectMap->hitTest(imousePt);
if (objectNum == -1) {
// Cursor over nothing - just display current verb
setStatusText(I_VerbData[_activeVerb].verb_str);
return SUCCESS;
}
object_flags = _vm->_scene->_objectMap->getFlags(objectNum);
object_name = _vm->_scene->_objectMap->getName(objectNum);
if (object_flags & OBJECT_EXIT) { // FIXME. This is wrong
// Normal scene object - display as subject of verb
snprintf(new_status, STATUS_TEXT_LEN, "%s %s", I_VerbData[_activeVerb].verb_str, object_name);
} else {
// Not normal scene object - override verb as we can only
// walk to this object
snprintf(new_status, STATUS_TEXT_LEN, "%s %s", I_VerbData[I_VERB_WALKTO].verb_str, object_name);
}
setStatusText(new_status);
return SUCCESS;
*/
}
PanelButton *Interface::verbHitTest(const Point& mousePoint) {
PanelButton *panelButton;
Rect rect;