def PlayResultEffects(self, sitesOrdered): self.LogInfo('PlayResultEffects') scene = self.sceneManager.GetRegisteredScene('default') soundLocators = [] invAU = 1.0 / AU vectorCurve = trinity.TriVectorCurve() vectorCurve.value = (invAU, invAU, invAU) self.EnableMouseTracking() try: startTimeSec = float(self.systemReadyTime + SWEEP_START_GRACE_TIME) / SEC lastPlayTimeSec = startTimeSec for delaySec, siteData in sitesOrdered: locatorData = self.siteController.spaceLocations.GetBySiteID( siteData.siteID) if IsSiteInstantlyAccessible(siteData): locatorData.bracket.state = uiconst.UI_NORMAL locatorData.bracket.DoEntryAnimation(enable=True) continue playTimeSec = startTimeSec + delaySec sleepTimeSec = playTimeSec - lastPlayTimeSec lastPlayTimeSec = playTimeSec self.ShowSiteDuringSweep(locatorData, scene, siteData, sleepTimeSec, soundLocators, vectorCurve) currentTimeSec = gametime.GetSimTime() endTimeSec = startTimeSec + SWEEP_CYCLE_TIME_SEC timeLeftSec = endTimeSec - currentTimeSec if timeLeftSec > 0: uthread2.SleepSim(timeLeftSec) self.audio.SendUIEvent('ui_scanner_stop') self.sensorSweepActive = False if not self.IsOverlayActive(): self._Hide() else: for locatorData in self.siteController.spaceLocations.IterLocations( ): if not IsSiteInstantlyAccessible(locatorData.siteData): locatorData.bracket.DoEnableAnimation() locatorData.bracket.state = uiconst.UI_NORMAL uthread2.SleepSim(1.0) self.DoScanEnded(sitesOrdered) except (InvalidClientStateError, KeyError): pass finally: self.sensorSweepActive = False if scene is not None: for tr in soundLocators: if tr in scene.objects: scene.objects.remove(tr) self.audio.SendUIEvent('ui_scanner_stop') self.SendMessage( overlayConst.MESSAGE_ON_SENSOR_OVERLAY_SWEEP_ENDED) self.UpdateVisibleSites()
def DepleteTurboShield(self): if not self.IsActive(): return self._EnableInvulnerableShieldMode() uthread2.SleepSim(self.attributes.invulnerablePeriodSeconds) self._EnableResistiveShieldMode() uthread2.SleepSim(self.attributes.resistivePeriodSeconds) self._EnableDepletedShieldMode() uthread2.SleepSim(self.attributes.cooldownPeriodSeconds) self._EnableActiveShieldMode()
def _GfxSwipeThread(self, viewAngleInPlane): try: uthread2.SleepSim(SWEEP_START_GRACE_TIME_SEC) if self.sensorSuiteService.IsOverlayActive() or self.sensorSuiteService.sensorSweepActive: logger.debug('triggering a gfx swipe') self.StartGfxSwipe(viewAngleInPlane) uthread2.SleepSim(SWEEP_CYCLE_TIME_SEC) self.StopGfxSwipe() except InvalidClientStateError: pass finally: logger.debug('exiting gfx swipe thread') self.gfxSwipeThread = None
def RunSimulation(self): trinity.settings.SetValue('frustumCullingDisabled', 1) trinity.settings.SetValue('eveSpaceSceneVisibilityThreshold', 0) trinity.settings.SetValue('eveSpaceSceneLowDetailThreshold', 0) trinity.settings.SetValue('eveSpaceSceneMediumDetailThreshold', 0) ut.StartTasklet(self._PumpBlue) import sceneutils scene = sceneutils.GetOrCreateScene() scene.objects.append(self.redNodeMutated) self._UpdateBoundingBox(True) rj = trinity.CreateRenderJob('CallbackJob') projection = trinity.TriProjection() projection.PerspectiveFov(1, 1, 1, 10000000) rj.steps.append(trinity.TriStepSetProjection(projection)) view = trinity.TriView() view.SetLookAtPosition((50000, 0, 0), (0, 0, 0), (0, 1, 0)) rj.steps.append(trinity.TriStepSetView(view)) rj.steps.append(trinity.TriStepUpdate(scene)) rj.steps.append(trinity.TriStepRenderScene(scene)) rj.steps.append(trinity.TriStepPythonCB(self.AccumulateBounds)) rj.ScheduleRecurring() for i in range(self._passes): self.activeIndex[0] = i for cs in self.curveSets: cs.Play() for sys in self.systems: sys.ClearParticles() self.started[0] = True ut.SleepSim(self._time) rj.UnscheduleRecurring() self._pumpBlue = False
def ShowSiteDuringSweep(self, locatorData, scene, siteData, sleepTimeSec, soundLocators, vectorCurve): ball = locatorData.ballRef() if ball is None: return audio = audio2.AudEmitter('sensor_overlay_site_%s' % str(siteData.siteID)) obs = trinity.TriObserverLocal() obs.front = (0.0, -1.0, 0.0) obs.observer = audio vectorSequencer = trinity.TriVectorSequencer() vectorSequencer.operator = trinity.TRIOP_MULTIPLY vectorSequencer.functions.append(ball) vectorSequencer.functions.append(vectorCurve) tr = trinity.EveRootTransform() tr.name = 'sensorSuiteSoundLocator_%s' % str(siteData.siteID) tr.translationCurve = vectorSequencer tr.observers.append(obs) scene.objects.append(tr) soundLocators.append(tr) uthread2.SleepSim(sleepTimeSec) if siteData.GetSiteType() == ANOMALY: audio.SendEvent('ui_scanner_result_anomaly') elif siteData.GetSiteType() == SIGNATURE: audio.SendEvent('ui_scanner_result_signature') locatorData.bracket.DoEntryAnimation(enable=False) locatorData.bracket.state = uiconst.UI_DISABLED
def _UnlockThread(self, charID, unlockDelay, callback): try: uthread2.SleepSim(unlockDelay) callback() self._NotifyForLockEvent(self.unlockingFor[1], REASON_UNLOCK_SUCCESSFUL) finally: self.SetLocked()
def _RunUpdateLoop(self): self.updateLoopRunning = True while self.updateLoopRunning: if not self._UpdateLoopContent(): break uthread2.SleepSim(1) self.updateLoopRunning = False
def _StopGfxSwipe(self): if self.gfxSensorSwipe is None: return fadeOutTime = 0.25 for cs in self.gfxSensorSwipe.curveSets: if cs.name == 'Play': fadeOutTime = cs.GetMaxCurveDuration() cs.scale = -1.0 cs.PlayFrom(fadeOutTime) break uthread2.SleepSim(fadeOutTime) if self.gfxSensorSwipe is None: return self.gfxSensorSwipe.display = False scene = self.sceneManager.GetRegisteredScene('default') if scene is not None: if self.gfxSensorSwipe in scene.objects: scene.objects.fremove(self.gfxSensorSwipe) self.gfxSensorSwipe = None
def _ClearBallAndBracketAfterTimeout_Thread(self, timeoutSeconds, bracket, ball): uthread2.SleepSim(timeoutSeconds) self._CloseBracketAndBall(bracket, ball)