void DreamWebEngine::talk() { _talkPos = 0; _inMapArea = 0; _character = _command; createPanel(); showPanel(); showMan(); showExit(); underTextLine(); convIcons(); startTalk(); _commandType = 255; readMouse(); showPointer(); workToScreen(); RectWithCallback<DreamWebEngine> talkList[] = { { 273,320,157,198,&DreamWebEngine::getBack1 }, { 240,290,2,44,&DreamWebEngine::moreTalk }, { 0,320,0,200,&DreamWebEngine::blank }, { 0xFFFF,0,0,0,0 } }; do { delPointer(); readMouse(); animPointer(); showPointer(); vSync(); dumpPointer(); dumpTextLine(); _getBack = 0; checkCoords(talkList); if (_quitRequested) break; } while (!_getBack); if (_talkPos >= 4) _personData->b7 |= 128; redrawMainScrn(); workToScreenM(); if (_speechLoaded) { cancelCh1(); _volumeDirection = -1; _volumeTo = 0; } }
void DreamWebEngine::selectOpenOb() { uint8 slotSize, slotCount; getAnyAd(&slotSize, &slotCount); if (slotCount == 255) { // Can't open the object blank(); return; } if (_commandType != 224) { _commandType = 224; commandWithOb(38, _objectType, _command); } if (_mouseButton == _oldButton || !(_mouseButton & 1)) return; _openedOb = _command; _openedType = _objectType; createPanel(); showPanel(); showMan(); examIcon(); showExit(); openInv(); openOb(); underTextLine(); readMouse(); showPointer(); workToScreen(); delPointer(); }
void LocalPlayer::readMouse() { int pos = panel->readMouse(); if (!manager->sendInput(this, pos)) { readMouse(); } }
void DreamWebEngine::inventory() { if (_vars._manDead == 1 || _vars._watchingTime != 0) { blank(); return; } commandOnlyCond(32, 239); if (_mouseButton == _oldButton) return; if (!(_mouseButton & 1)) // only on left mouse button return; _timeCount = 0; _pointerMode = 0; _inMapArea = 0; animPointer(); createPanel(); showPanel(); examIcon(); showMan(); showExit(); underTextLine(); _pickUp = 0; _invOpen = 2; openInv(); readMouse(); showPointer(); workToScreen(); delPointer(); _openedOb = 255; examineOb(false); }
void DreamWebEngine::redes() { if (_channel1Playing != 255 || _talkMode != 2) { blank(); return; } if (_commandType != 217) { _commandType = 217; commandOnly(50); } if (!(_mouseButton & 1)) return; delPointer(); createPanel(); showPanel(); showMan(); showExit(); convIcons(); startTalk(); readMouse(); showPointer(); workToScreen(); delPointer(); }
void DreamWebEngine::lastDest() { commandOnlyCond(29, 219); if (!(_mouseButton & 1) || _oldButton == 1) return; // nodd do { _destPos--; if (_destPos == 0xFF) _destPos = 15; // first destination } while (!getLocation(_destPos)); _newTextLine = 1; delTextLine(); delPointer(); showPanel(); showMan(); showArrows(); locationPic(); underTextLine(); readMouse(); showPointer(); workToScreen(); delPointer(); }
uint16 DreamWebEngine::waitFrames() { readMouse(); showPointer(); waitForVSync(); dumpPointer(); delPointer(); return _mouseButton; }
void DreamWebEngine::outOfOpen() { if (_openedOb == 255) return; // cannot use opened object ObjectRef objectId = findOpenPos(); if (objectId._index == 255) { blank(); return; } if (objectId != _oldSubject || _commandType != 228) { if (objectId == _oldSubject) _commandType = 228; _oldSubject = objectId; commandWithOb(36, objectId._type, objectId._index); } if (_mouseButton == _oldButton) return; // notletgo4 if (_mouseButton != 1) { if (_mouseButton == 2) reExFromOpen(); return; } delPointer(); _pickUp = 1; objectId = findOpenPos(); _objectType = objectId._type; _itemFrame = objectId._index; if (_objectType != kExObjectType) { assert(objectId._type == kFreeObjectType); _itemFrame = transferToEx(objectId._index); _objectType = kExObjectType; } DynObject *object = getEitherAd(); object->mapad[0] = 20; object->mapad[1] = 255; fillOpen(); underTextLine(); readMouse(); useOpened(); showPointer(); workToScreen(); delPointer(); }
void DreamWebEngine::incRyanPage() { commandOnlyCond(31, 222); if (_mouseButton == _oldButton || !(_mouseButton & 1)) return; _vars._ryanPage = (_mouseX - (kInventx + 167)) / 18; delPointer(); fillRyan(); readMouse(); showPointer(); workToScreen(); delPointer(); }
bool DreamWebEngine::hangOnPQ() { _getBack = 0; RectWithCallback<DreamWebEngine> quitList[] = { { 273,320,157,198,&DreamWebEngine::getBack1 }, { 0,320,0,200,&DreamWebEngine::blank }, { 0xFFFF,0,0,0,0 } }; uint16 speechFlag = 0; do { delPointer(); readMouse(); animPointer(); showPointer(); vSync(); dumpPointer(); dumpTextLine(); checkCoords(quitList); if (_getBack == 1 || _quitRequested) { // Quit conversation delPointer(); _pointerMode = 0; cancelCh1(); return true; } if (_speechLoaded && _channel1Playing == 255) { speechFlag++; if (speechFlag == 40) break; } } while (!_mouseButton || _oldButton); delPointer(); _pointerMode = 0; return false; }
void DreamWebEngine::swapWithInv() { ObjectRef subject; subject._type = _objectType; subject._index = _itemFrame; if (subject != _oldSubject || _commandType != 243) { if (subject == _oldSubject) _commandType = 243; _oldSubject = subject; commandWithOb(34, subject._type, subject._index); } if (_mouseButton == _oldButton || !(_mouseButton & 1)) return; byte prevType = _objectType; byte prevFrame = _itemFrame; ObjectRef objectId = findInvPos(); _itemFrame = objectId._index; _objectType = objectId._type; DynObject *object = getEitherAd(); object->mapad[0] = 20; object->mapad[1] = 255; byte prevType2 = _objectType; byte prevFrame2 = _itemFrame; _objectType = prevType; _itemFrame = prevFrame; delPointer(); object = getEitherAd(); object->mapad[0] = 4; object->mapad[1] = 255; object->mapad[2] = _lastInvPos; _objectType = prevType2; _itemFrame = prevFrame2; fillRyan(); readMouse(); showPointer(); workToScreen(); delPointer(); }
void DreamWebEngine::outOfInv() { ObjectRef subject = findInvPos(); if (subject._index == 255) { blank(); return; } if (_mouseButton == 2) { reExFromInv(); return; } if (subject != _oldSubject || _commandType != 221) { if (subject == _oldSubject) _commandType = 221; _oldSubject = subject; commandWithOb(36, subject._type, subject._index); } if (_mouseButton == _oldButton || !(_mouseButton & 1)) return; delPointer(); _pickUp = 1; subject = findInvPos(); _objectType = subject._type; _itemFrame = subject._index; assert(subject._type == kExObjectType); DynObject *object = getExAd(subject._index); object->mapad[0] = 20; object->mapad[1] = 255; fillRyan(); readMouse(); showPointer(); inToInv(); workToScreen(); delPointer(); }
void DreamWebEngine::inToInv() { if (!_pickUp) { outOfInv(); return; } ObjectRef subject = findInvPos(); if (subject._index != 255) { swapWithInv(); return; } subject._type = _objectType; subject._index = _itemFrame; if (subject != _oldSubject || _commandType != 220) { if (subject == _oldSubject) _commandType = 220; _oldSubject = subject; commandWithOb(35, subject._type, subject._index); } if (_mouseButton == _oldButton || !(_mouseButton & 1)) return; // notletgo2 delPointer(); DynObject *object = getExAd(_itemFrame); object->mapad[0] = 4; object->mapad[1] = 255; object->mapad[2] = _lastInvPos; _pickUp = 0; fillRyan(); readMouse(); showPointer(); outOfInv(); workToScreen(); delPointer(); }
void DreamWebEngine::swapWithOpen() { ObjectRef subject; subject._type = _objectType; subject._index = _itemFrame; if (subject != _oldSubject || _commandType != 242) { if (subject == _oldSubject) _commandType = 242; _oldSubject = subject; commandWithOb(34, subject._type, subject._index); } if (_mouseButton == _oldButton || !(_mouseButton & 1)) return; if (isItWorn(getEitherAd())) { wornError(); return; } delPointer(); if (_itemFrame == _openedOb && _objectType == _openedType) { errorMessage1(); return; } if (!checkObjectSize()) return; byte prevType = _objectType; byte prevFrame = _itemFrame; ObjectRef objectId = findOpenPos(); _objectType = objectId._type; _itemFrame = objectId._index; if (_objectType != kExObjectType) { assert(objectId._type == kFreeObjectType); _itemFrame = transferToEx(objectId._index); _objectType = kExObjectType; } DynObject *object = getEitherAd(); object->mapad[0] = 20; object->mapad[1] = 255; byte prevType2 = _objectType; byte prevFrame2 = _itemFrame; _objectType = prevType; _itemFrame = prevFrame; object = getEitherAd(); object->mapad[0] = _openedType; object->mapad[1] = _openedOb; object->mapad[2] = _lastInvPos; object->mapad[3] = _realLocation; _objectType = prevType2; _itemFrame = prevFrame2; fillOpen(); fillRyan(); underTextLine(); readMouse(); useOpened(); showPointer(); workToScreen(); delPointer(); }
void DreamWebEngine::useOpened() { if (_openedOb == 255) return; // cannot use opened object if (!_pickUp) { outOfOpen(); return; } ObjectRef objectId = findOpenPos(); if (objectId._index != 255) { swapWithOpen(); return; } if (_pickUp != 1) { blank(); return; } objectId._type = _objectType; objectId._index = _itemFrame; if (objectId != _oldSubject || _commandType != 227) { if (objectId == _oldSubject) _commandType = 227; _oldSubject = objectId; commandWithOb(35, objectId._type, objectId._index); } if (_mouseButton == _oldButton || !(_mouseButton & 1)) return; if (isItWorn(getEitherAd())) { wornError(); return; } delPointer(); if (_itemFrame == _openedOb && _objectType == _openedType) { errorMessage1(); return; } if (!checkObjectSize()) return; _pickUp = 0; DynObject *object = getEitherAd(); object->mapad[0] = _openedType; object->mapad[1] = _openedOb; object->mapad[2] = _lastInvPos; object->mapad[3] = _realLocation; fillOpen(); underTextLine(); readMouse(); useOpened(); showPointer(); workToScreen(); delPointer(); }
void DreamWebEngine::examineOb(bool examineAgain) { _pointerMode = 0; _timeCount = 0; while (true) { if (examineAgain) { _inMapArea = 0; _examAgain = 0; _openedOb = 255; _openedType = 255; _invOpen = 0; _objectType = _commandType; _itemFrame = 0; _pointerFrame = 0; createPanel(); showPanel(); showMan(); showExit(); obIcons(); obPicture(); describeOb(); underTextLine(); _commandType = 255; readMouse(); showPointer(); workToScreen(); delPointer(); examineAgain = false; } readMouse(); showPointer(); waitForVSync(); dumpPointer(); dumpTextLine(); delPointer(); _getBack = 0; switch (_invOpen) { case 0: { RectWithCallback examList[] = { { 273,320,157,198,&DreamWebEngine::getBackFromOb }, { 260,300,0,44,&DreamWebEngine::useObject }, { 210,254,0,44,&DreamWebEngine::selectOpenOb }, { 144,176,64,96,&DreamWebEngine::setPickup }, { 0,50,50,200,&DreamWebEngine::examineInventory }, { 0,320,0,200,&DreamWebEngine::blank }, { 0xFFFF,0,0,0,0 } }; checkCoords(examList); break; } case 1: { // Note: This table contains the non-constant _openChangeSize! RectWithCallback invList1[] = { { 273,320,157,198,&DreamWebEngine::getBackFromOb }, { 255,294,0,24,&DreamWebEngine::dropObject }, { kInventx+167,kInventx+167+(18*3),kInventy-18,kInventy-2,&DreamWebEngine::incRyanPage }, { kInventx,_openChangeSize,kInventy+100,kInventy+100+kItempicsize,&DreamWebEngine::useOpened }, { kInventx,kInventx+(5*kItempicsize),kInventy,kInventy+(2*kItempicsize),&DreamWebEngine::inToInv }, { 0,320,0,200,&DreamWebEngine::blank }, { 0xFFFF,0,0,0,0 } }; checkCoords(invList1); break; } default: { RectWithCallback withList1[] = { { 273,320,157,198,&DreamWebEngine::getBackFromOb }, { kInventx+167,kInventx+167+(18*3),kInventy-18,kInventy-2,&DreamWebEngine::incRyanPage }, { kInventx,kInventx+(5*kItempicsize), kInventy,kInventy+(2*kItempicsize),&DreamWebEngine::selectOb }, { 0,320,0,200,&DreamWebEngine::blank }, { 0xFFFF,0,0,0,0 } }; checkCoords(withList1); break; } } if (_quitRequested) break; if (_examAgain != 0) examineAgain = true; else if (_getBack != 0) break; } _pickUp = 0; if (_vars._watchingTime != 0 || _newLocation == 255) { // isWatching makeMainScreen(); } _invOpen = 0; _openedOb = 255; }
void DreamWebEngine::selectLocation() { _inMapArea = 0; clearBeforeLoad(); _getBack = 0; _pointerFrame = 22; readCityPic(); showCity(); _cityGraphics.clear(); readDestIcon(); loadTravelText(); showPanel(); showMan(); showArrows(); showExit(); locationPic(); underTextLine(); _commandType = 255; readMouse(); _pointerFrame = 0; showPointer(); workToScreen(); _sound->playChannel0(9, 255); _newLocation = 255; while (_newLocation == 255) { if (_quitRequested) break; delPointer(); readMouse(); showPointer(); waitForVSync(); dumpPointer(); dumpTextLine(); if (_getBack == 1) break; RectWithCallback destList[] = { { 238,258,4,44,&DreamWebEngine::nextDest }, { 104,124,4,44,&DreamWebEngine::lastDest }, { 280,308,4,44,&DreamWebEngine::lookAtPlace }, { 104,216,138,192,&DreamWebEngine::destSelect }, { 273,320,157,198,&DreamWebEngine::getBack1 }, { 0,320,0,200,&DreamWebEngine::blank }, { 0xFFFF,0,0,0,0 } }; checkCoords(destList); } if (_quitRequested || _getBack == 1 || _newLocation == _vars._location) { _newLocation = _realLocation; _getBack = 0; } _newplaceGraphics.clear(); _newplaceGraphics2.clear(); _newplaceGraphics3.clear(); _travelText.clear(); }
void LocalPlayer::notify(int position) { readMouse(); }