void UserInterface::checkAction(ActionType &action, int objNum, FixedTextActionId fixedTextActionId) { Events &events = *_vm->_events; FixedText &fixedText = *_vm->_fixedText; People &people = *_vm->_people; Scene &scene = *_vm->_scene; Screen &screen = *_vm->_screen; Talk &talk = *_vm->_talk; Point32 pt(-1, -1); if (action._useFlag) // Automatically set the given flag _vm->setFlags(action._useFlag); if (objNum >= 1000) // Ignore actions done on characters return; if (!action._cAnimSpeed) { // Invalid action, to print error message _infoFlag = true; clearInfo(); Common::String errorMessage = fixedText.getActionMessage(fixedTextActionId, action._cAnimNum); screen.print(Common::Point(0, INFO_LINE + 1), COL_INFO_FOREGROUND, "%s", errorMessage.c_str()); _infoFlag = true; // Set how long to show the message _menuCounter = 30; } else { Object &obj = scene._bgShapes[objNum]; int cAnimNum; if (action._cAnimNum == 0) // Really a 10 cAnimNum = 9; else cAnimNum = action._cAnimNum - 1; int dir = -1; if (action._cAnimNum != 99) { CAnim &anim = scene._cAnim[cAnimNum]; if (action._cAnimNum != 99) { if (action._cAnimSpeed & REVERSE_DIRECTION) { pt = anim._teleport[0]; dir = anim._teleport[0]._facing; } else { pt = anim._goto[0]; dir = anim._goto[0]._facing; } } } else { pt = Point32(-1, -1); dir = -1; } // Has a value, so do action // Show wait cursor whilst walking to object and doing action events.setCursor(WAIT); bool printed = false; for (int nameIdx = 0; nameIdx < NAMES_COUNT; ++nameIdx) { if (action._names[nameIdx].hasPrefix("*") && action._names[nameIdx].size() >= 2 && toupper(action._names[nameIdx][1]) == 'W') { if (obj.checkNameForCodes(Common::String(action._names[nameIdx].c_str() + 2), fixedTextActionId)) { if (!talk._talkToAbort) printed = true; } } } bool doCAnim = true; for (int nameIdx = 0; nameIdx < NAMES_COUNT; ++nameIdx) { if (action._names[nameIdx].hasPrefix("*") && action._names[nameIdx].size() >= 2) { char ch = toupper(action._names[nameIdx][1]); if (ch == 'T' || ch == 'B') { printed = true; if (pt.x != -1) // Holmes needs to walk to object before the action is done people[HOLMES].walkToCoords(pt, dir); if (!talk._talkToAbort) { // Ensure Holmes is on the exact intended location people[HOLMES]._position = pt; people[HOLMES]._sequenceNumber = dir; people[HOLMES].gotoStand(); talk.talkTo(action._names[nameIdx].c_str() + 2); if (ch == 'T') doCAnim = false; } } } } if (doCAnim && !talk._talkToAbort) { if (pt.x != -1) // Holmes needs to walk to object before the action is done people[HOLMES].walkToCoords(pt, dir); } for (int nameIdx = 0; nameIdx < NAMES_COUNT; ++nameIdx) { if (action._names[nameIdx].hasPrefix("*") && action._names[nameIdx].size() >= 2 && toupper(action._names[nameIdx][1]) == 'F') { if (obj.checkNameForCodes(action._names[nameIdx].c_str() + 2, fixedTextActionId)) { if (!talk._talkToAbort) printed = true; } } } if (doCAnim && !talk._talkToAbort && action._cAnimNum != 99) scene.startCAnim(cAnimNum, action._cAnimSpeed); if (!talk._talkToAbort) { for (int nameIdx = 0; nameIdx < NAMES_COUNT && !talk._talkToAbort; ++nameIdx) { if (obj.checkNameForCodes(action._names[nameIdx], fixedTextActionId)) { if (!talk._talkToAbort) printed = true; } } // Unless we're leaving the scene, print a "Done" message unless the printed flag has been set if (IS_SERRATED_SCALPEL && scene._goToScene != 1 && !printed && !talk._talkToAbort) { _infoFlag = true; clearInfo(); screen.print(Common::Point(0, INFO_LINE + 1), COL_INFO_FOREGROUND, "Done..."); // Set how long to show the message _menuCounter = 30; } } } // Reset cursor back to arrow events.setCursor(ARROW); }
void Rect::print() const { clearInfo(); Point::putInfo(); putInfo(); Printable::print(); }
void exit_DB(void) { clearInfo(); }
void Polyline::print() const { clearInfo(); putInfo(); Printable::print(); }