def SetScanDronesState(self, state): scanEffectTf = nodemanager.FindNode(self.sphere, 'scanLines', 'trinity.EveTransform') if scanEffectTf: scanEffectTf.display = state if state: scanLinesCurveSet = nodemanager.FindNode( scanEffectTf, 'ScanCurveSet', 'trinity.TriCurveSet') if scanLinesCurveSet: scanLinesCurveSet.Play()
def _PrepareBackgroundLandscapes(self, scene, solarSystemID, constellationID=None): starSeed = 0 securityStatus = 1 if constellationID is None: constellationID = sm.GetService( 'map').GetConstellationForSolarSystem(solarSystemID) if bool(solarSystemID) and bool(constellationID): starSeed = int(constellationID) securityStatus = sm.GetService('map').GetSecurityStatus( solarSystemID) if not gfxutils.BlockStarfieldOnLionOSX(): scene.starfield = self._GetSharedResource( 'res:/dx9/scene/starfield/spritestars.red') if scene.starfield is not None: scene.starfield.seed = starSeed scene.starfield.minDist = 40 scene.starfield.maxDist = 80 if util.IsWormholeSystem(solarSystemID): scene.starfield.numStars = 0 else: scene.starfield.numStars = 500 + int(250 * securityStatus) if scene.backgroundEffect is None: scene.backgroundEffect = self._GetSharedResource( 'res:/dx9/scene/starfield/starfieldNebula.red') node = nodemanager.FindNode(scene.backgroundEffect.resources, 'NebulaMap', 'trinity.TriTexture2DParameter') if node is not None: node.resourcePath = scene.envMap1ResPath scene.backgroundRenderingEnabled = True
def PrepareBackgroundLandscapes(self, scene): starSeed = 0 securityStatus = 1 if eve.session.stationid is not None: return if scene is None: return if bool(eve.session.solarsystemid2): starSeed = int(eve.session.constellationid) securityStatus = sm.StartService('map').GetSecurityStatus( eve.session.solarsystemid) scene.starfield = trinity.Load( 'res:/dx9/scene/starfield/spritestars.red') if scene.starfield is not None: scene.starfield.seed = starSeed scene.starfield.minDist = 40 scene.starfield.maxDist = 80 if util.IsWormholeSystem(eve.session.solarsystemid): scene.starfield.numStars = 0 else: scene.starfield.numStars = 500 + int(250 * securityStatus) if scene.backgroundEffect is None: scene.backgroundEffect = trinity.Load( 'res:/dx9/scene/starfield/starfieldNebula.red') node = nodemanager.FindNode(scene.backgroundEffect.resources, 'NebulaMap', 'trinity.TriTexture2DParameter') if node is not None: node.resourcePath = scene.envMap1ResPath if scene.starfield is None or scene.backgroundEffect is None: return scene.backgroundRenderingEnabled = True
def ScanEffect(self): scanLinesCurveSet = nodemanager.FindNode(self.scanConeTransform, 'ScanPart_01', 'trinity.TriCurveSet') if scanLinesCurveSet: duration = scanLinesCurveSet.GetMaxCurveDuration() scanLinesCurveSet.Play() scanLinesCurveSet.StopAfterWithCallback(duration, self._ScanEffectReturn) scanLinesCurveSet = nodemanager.FindNode(self.scanConeHalfTransform, 'ScanPart_01', 'trinity.TriCurveSet') if scanLinesCurveSet: duration = scanLinesCurveSet.GetMaxCurveDuration() scanLinesCurveSet.Play() scanLinesCurveSet.StopAfterWithCallback(duration, self._ScanEffectHalfReturn) scanLinesCurveSet = nodemanager.FindNode(self.scanConeFullTransform, 'ScanPart_01', 'trinity.TriCurveSet') if scanLinesCurveSet: duration = scanLinesCurveSet.GetMaxCurveDuration() scanLinesCurveSet.Play() scanLinesCurveSet.StopAfterWithCallback(duration, self._ScanEffectFullReturn)
def __init__(self, probeID, probe, parent): scanSvc = sm.GetService('scanSvc') BaseProbeControl.__init__(self, probeID, parent) sphere = trinity.Load('res:/dx9/model/UI/Scanbubbledoteffect.red') self.locator.children.append(sphere) self.sphere = sphere scanbubble = nodemanager.FindNode(sphere, 'Scanbubble', 'trinity.EveTransform') for each in scanbubble.children: each.scaling = tuple([(100 if scaling > 0 else -100) for scaling in each.scaling]) CURSOR_SCALE_ARG_1 = 2000000.0 CURSOR_SCALE = SOLARSYSTEM_SCALE * 250000000000.0 cursor = trinity.Load('res:/Model/UI/probeSpreadCursor.red') cursor.scaling = (CURSOR_SCALE, CURSOR_SCALE, CURSOR_SCALE) cursor.useDistanceBasedScale = True cursor.distanceBasedScaleArg1 = CURSOR_SCALE_ARG_1 cursor.distanceBasedScaleArg2 = 0.0 cursor.translation = (0.0, 0.0, 0.0) for c in cursor.children: c.name += '_' + str(probeID) self.locator.children.append(cursor) self.spreadCursor = cursor cursor = trinity.Load('res:/Model/UI/probeRangeCursor.red') for c in cursor.children: c.scaling = (250.0, 250.0, 250.0) c.name += '_' + str(probeID) c.mesh.geometryResPath = 'res:/Graphics/generic/vortex/Cone2.gr2' c.rotation = geo2.QuaternionRotationSetYawPitchRoll( 0.0, math.pi * 0.5, 0.0) self.locator.children.append(cursor) self.rangeCursor = cursor self.scanRanges = scanSvc.GetScanRangeStepsByTypeID(probe.typeID) self.probeID = probeID self.scanrangeCircles = None self._highlighted = True self.HighlightBorder(0) uicore.animations.MorphVector3(self.locator, 'scaling', startVal=(0.0, 0.0, 0.0), endVal=(1.0, 1.0, 1.0), duration=0.5, curveType=uiconst.ANIM_OVERSHOT, timeOffset=random.random() * 0.5)
def LoadSolarSystemDetails(self, solarSystemID): current = getattr(self, 'currentSolarsystem', None) if current: resetSolarsystemID = current.solarsystemID else: resetSolarsystemID = None if resetSolarsystemID != solarSystemID: if current: current.Close() self.currentSolarsystem = None self.currentSolarsystem = SystemMapHandler( self, solarSystemID, scaling=ScaleSolarSystemValue(1.0), position=(0, 0, 0)) self.currentSolarsystem.LoadSolarSystemMap() if self.destroyed: return self.currentSolarsystem.LoadMarkers() if self.destroyed: return scaling = ScaleSolarSystemValue(1.0) self.currentSolarsystem.systemMapTransform.scaling = (scaling, scaling, scaling) if self.showSolarSystemNebula: node = nodemanager.FindNode( self.scene.backgroundEffect.resources, 'NebulaMap', 'trinity.TriTextureParameter') if node is not None: sceneCube = sm.GetService( 'sceneManager').GetNebulaPathForSystem(solarSystemID) node.resourcePath = sceneCube or 'res:/UI/Texture/classes/MapView/backdrop_cube.dds' if IsWormholeSystem(solarSystemID) and self.scene.starfield: self.scene.starfield.numStars = 0 uthread.new(self.ShowMyHomeStation) uthread.new(self.ShowMyLocation) if self.infoBox: self.infoBox.LoadSolarSystemID(solarSystemID)
def _ScanEffectFullReturn(self): scanLinesCurveSet = nodemanager.FindNode(self.scanConeFullTransform, 'ScanPart_02', 'trinity.TriCurveSet') if scanLinesCurveSet: scanLinesCurveSet.Play()
def _ApplyAllianceLogo(self, iconPath): screenNode = nodemanager.FindNode(self.model.planeSets, 'Hologram', 'trinity.EvePlaneSet') for res in screenNode.effect.resources: if res.name == 'ImageMap': res.resourcePath = iconPath
def ApplyAttributes(self, attributes): Container.ApplyAttributes(self, attributes) self.mapSvc = sm.GetService('map') innerPadding = attributes.innerPadding or 0 self.infoLayer = Container(parent=self, clipChildren=True, name='infoLayer', padding=innerPadding) if attributes.showCloseButton: closeButton = ButtonIcon( parent=self.infoLayer, hint='Close', texturePath='res:/UI/Texture/classes/DockPanel/closeButton.png', func=attributes.closeFunction or self.Close, align=uiconst.TOPRIGHT) if attributes.showInfobox: self.infoBox = SolarSystemInfoBox(parent=self.infoLayer, align=uiconst.TOPLEFT, left=32, top=32) self.mapNavigation = MapViewNavigation(parent=self, align=uiconst.TOALL, state=uiconst.UI_NORMAL, mapView=self, padding=(0, 32, 0, 0)) sceneContainer = MapViewSceneContainer(parent=self, align=uiconst.TOALL, state=uiconst.UI_DISABLED, padding=innerPadding) sceneContainer.Startup() self.sceneContainer = sceneContainer self.sceneContainer.display = False self.camera.SetCallback(self.OnCameraMoved) scene = trinity.EveSpaceScene() scene.starfield = trinity.Load( 'res:/dx9/scene/starfield/spritestars.red') scene.backgroundEffect = trinity.Load( 'res:/dx9/scene/starfield/starfieldNebula.red') scene.backgroundRenderingEnabled = True node = nodemanager.FindNode(scene.backgroundEffect.resources, 'NebulaMap', 'trinity.TriTexture2DParameter') if node is not None: s = sm.GetService('sceneManager') sceneCube = s.GetNebulaPathForSystem(session.solarsystemid) node.resourcePath = sceneCube or 'res:/UI/Texture/classes/MapView/backdrop_cube.dds' self.mapRoot = trinity.EveRootTransform() self.mapRoot.name = 'universe' scene.objects.append(self.mapRoot) self.sceneContainer.scene = scene self.sceneContainer.DisplaySpaceScene() self.markersHandler = MapViewMarkersHandler( self, self.sceneContainer.bracketCurveSet, self.infoLayer, eventHandler=self.mapNavigation) self.abstractMode = settings.user.ui.Get( VIEWMODE_LAYOUT_SHOW_ABSTRACT_SETTINGS, VIEWMODE_LAYOUT_SHOW_ABSTRACT_DEFAULT) if self.abstractMode: self.yScaleFactor = 0.0001 sm.RegisterNotify(self) uthread.new(uicore.registry.SetFocus, self)