void NoradAlphaFillingStation::showIntakeInProgress(uint16 numSeconds) { if (numSeconds == 0) { setSegmentState(kFSIntakeInProgressStart, kFSIntakeInProgressStop, kFSIntakeWarningFinishedFlag, kNoState); Item *item = ((NoradAlpha *)getOwner())->getFillingItem(); if (item->getObjectID() == kGasCanister) { GameState.setNoradGassed(true); ((NoradAlpha *)getOwner())->loadAmbientLoops(); getOwner()->restoreStriding(kNorad03, kEast, kAltNoradAlphaNormal); } } else { setSegmentState(kFSIntakeInProgressStart, kFSIntakeInProgressStart + _rightSideMovie.getScale() * numSeconds, kFSIntakeWarningFinishedFlag, kNoState); } }
void ReplayController::pausePlayback() { ASSERT(m_sessionState == SessionState::Replaying); ASSERT(m_segmentState == SegmentState::Dispatching); if (dispatcher().isRunning()) dispatcher().pause(); setSegmentState(SegmentState::Loaded); LOG(WebReplay, "%-20s Pausing playback at position (segment: %d, input: %d).\n", "ReplayController", m_currentPosition.segmentOffset, m_currentPosition.inputOffset); InspectorInstrumentation::playbackPaused(m_page, m_currentPosition); }
void ReplayController::startPlayback() { ASSERT(m_sessionState == SessionState::Replaying); ASSERT(m_segmentState == SegmentState::Loaded); setSegmentState(SegmentState::Dispatching); LOG(WebReplay, "%-20s Starting playback to position (segment: %d, input: %d).\n", "ReplayController", m_targetPosition.segmentOffset, m_targetPosition.inputOffset); InspectorInstrumentation::playbackStarted(m_page); dispatcher().setDispatchSpeed(m_dispatchSpeed); dispatcher().run(); }
void ReplayController::loadSegmentAtIndex(size_t segmentIndex) { ASSERT_ARG(segmentIndex, segmentIndex >= 0 && segmentIndex < m_loadedSession->size()); RefPtr<ReplaySessionSegment> segment = m_loadedSession->at(segmentIndex); ASSERT(m_sessionState == SessionState::Replaying); ASSERT(m_segmentState == SegmentState::Unloaded); ASSERT(segment); ASSERT(!m_loadedSegment); m_loadedSegment = segment; setSegmentState(SegmentState::Loaded); m_currentPosition.segmentOffset = segmentIndex; m_currentPosition.inputOffset = 0; m_activeCursor = ReplayingInputCursor::create(m_loadedSegment.copyRef(), m_page, this); LOG(WebReplay, "%-20sLoading segment: %p.\n", "ReplayController", segment.get()); InspectorInstrumentation::segmentLoaded(m_page, segment.copyRef()); }
void ReplayController::unloadSegment(bool suppressNotifications) { ASSERT(m_sessionState != SessionState::Inactive); ASSERT(m_segmentState == SegmentState::Loaded || m_segmentState == SegmentState::Appending); setSegmentState(SegmentState::Unloaded); LOG(WebReplay, "%-20s Clearing input cursors for page: %p\n", "ReplayController", &m_page); m_activeCursor = nullptr; RefPtr<ReplaySessionSegment> unloadedSegment = m_loadedSegment.release(); for (Frame* frame = &m_page.mainFrame(); frame; frame = frame->tree().traverseNext()) { frame->script().globalObject(mainThreadNormalWorld())->setInputCursor(m_emptyCursor.copyRef()); frame->document()->setInputCursor(m_emptyCursor.copyRef()); } // When we stop capturing, don't send out segment unloaded events since we // didn't send out the corresponding segmentLoaded event at the start of capture. if (!suppressNotifications) { LOG(WebReplay, "%-20sUnloading segment: %p.\n", "ReplayController", unloadedSegment.get()); InspectorInstrumentation::segmentUnloaded(m_page); } }
void ReplayController::createSegment() { ASSERT(m_sessionState == SessionState::Capturing); ASSERT(m_segmentState == SegmentState::Unloaded); setSegmentState(SegmentState::Appending); // Create a new segment but don't associate it with the current session // until we stop appending to it. This preserves the invariant that // segments associated with a replay session have immutable data. m_loadedSegment = ReplaySessionSegment::create(); LOG(WebReplay, "%-20s Created segment: %p.\n", "ReplayController", m_loadedSegment.get()); InspectorInstrumentation::segmentCreated(m_page, m_loadedSegment.copyRef()); m_activeCursor = CapturingInputCursor::create(m_loadedSegment.copyRef()); m_activeCursor->appendInput<BeginSegmentSentinel>(); std::unique_ptr<InitialNavigation> navigationInput = InitialNavigation::createFromPage(m_page); // Dispatching this input schedules navigation of the main frame, causing a refresh. navigationInput->dispatch(*this); m_activeCursor->storeInput(WTF::move(navigationInput)); }
void NoradAlphaFillingStation::clickInN() { setSegmentState(kFSNHiliteStart, kFSNHiliteStop, kFSNHiliteFinishedFlag, kNoState); }
void NoradAlphaFillingStation::dispenseGas() { Item *item = ((NoradAlpha *)getOwner())->getFillingItem(); if (item) { if (item->getObjectID() != _dispenseItemID) switch (_dispenseItemID) { case kArgonCanister: setSegmentState(kFSArIncompatibleStart, kFSArIncompatibleStop, kFSIntakeWarningFinishedFlag, kNoState); break; case kCO2Item: setSegmentState(kFSCO2IncompatibleStart, kFSCO2IncompatibleStop, kFSIntakeWarningFinishedFlag, kNoState); break; case kHeItem: setSegmentState(kFSHeIncompatibleStart, kFSHeIncompatibleStop, kFSIntakeWarningFinishedFlag, kNoState); break; case kAirMask: setSegmentState(kFSOIncompatibleStart, kFSOIncompatibleStop, kFSIntakeWarningFinishedFlag, kNoState); break; case kNitrogenCanister: setSegmentState(kFSNIncompatibleStart, kFSNIncompatibleStop, kFSIntakeWarningFinishedFlag, kNoState); break; } else { if (_dispenseItemID == kArgonCanister) { setSegmentState(kFSArFilledStart, kFSArFilledStop, kFSIntakeWarningFinishedFlag, kNoState); item->setItemState(kArgonFull); GameState.setScoringFilledArgonCanister(true); } else if (_dispenseItemID == kAirMask) { setSegmentState(kFSOFilledStart, kFSOFilledStop, kFSIntakeWarningFinishedFlag, kNoState); ((AirMask *)item)->refillAirMask(); GameState.setScoringFilledOxygenCanister(true); } else if (_dispenseItemID == kNitrogenCanister) { setSegmentState(kFSNFilledStart, kFSNFilledStop, kFSIntakeWarningFinishedFlag, kNoState); item->setItemState(kNitrogenFull); } } } else { switch (_dispenseItemID) { case kArgonCanister: setStaticState(kFSArAttach, kWaitingForDispense); break; case kCO2Item: setStaticState(kFSCO2Attach, kWaitingForDispense); break; case kHeItem: setStaticState(kFSHeAttach, kWaitingForDispense); break; case kAirMask: setStaticState(kFSOAttach, kWaitingForDispense); break; case kNitrogenCanister: setStaticState(kFSNAttach, kWaitingForDispense); break; } } }
void NoradAlphaFillingStation::splashFinished() { if (GameState.getNoradGassed()) setSegmentState(kFSSplashIntakeStart, kFSSplashIntakeStop, kFSIntakeWarningFinishedFlag, kNoState); else intakeWarningFinished(); }
void NoradAlphaFillingStation::powerUpFinished() { ((NoradAlpha *)getOwner())->turnOnFillingStation(); setSegmentState(kFSSplashStart, kFSSplashStop, kFSSplashFinishedFlag, kNoState); }