NovaBryan/EVE_Dump
Log | Files | 📦 下载最新源码 (.zip) | Refs | README

mapMarkerRegion.py (2442B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\mapView\markers\mapMarkerRegion.py
      2 from carbonui.primitives.base import ScaleDpi
      3 import eve.client.script.ui.shared.mapView.mapViewConst as mapViewConst
      4 from eve.client.script.ui.shared.mapView.markers.mapMarkerBase import MarkerContainerBase
      5 from eve.client.script.ui.shared.mapView.markers.mapMarkerBase_Label import MarkerLabelBase
      6 
      7 class MarkerContainerRegion(MarkerContainerBase):
      8 
      9     def ApplyAttributes(self, attributes):
     10         super(MarkerContainerRegion, self).ApplyAttributes(attributes)
     11         self.uniqueUiName = 'map_marker_region_%s' % self.markerObject.markerID
     12 
     13 
     14 class MarkerLabelRegion(MarkerLabelBase):
     15     fontColor = (1.0, 1.0, 1.0, 0.85)
     16     distanceFadeAlphaNearFar = (mapViewConst.MAX_MARKER_DISTANCE * 0.015, mapViewConst.MAX_MARKER_DISTANCE * 2)
     17     fontSize = 10
     18     letterSpace = 3
     19 
     20     def __init__(self, *args, **kwds):
     21         MarkerLabelBase.__init__(self, *args, **kwds)
     22         self.typeID = const.typeRegion
     23         self.itemID = self.markerID
     24         self._mapTransitioning = False
     25 
     26     def GetLabelText(self):
     27         return cfg.evelocations.Get(self.markerID).name.upper()
     28 
     29     def GetDragText(self):
     30         return cfg.evelocations.Get(self.markerID).name
     31 
     32     def Load(self):
     33         MarkerLabelBase.Load(self)
     34         self.projectBracket.offsetY = -ScaleDpi(self.markerContainer.height + 20)
     35 
     36     def UpdateActiveAndHilightState(self):
     37         if self.hilightState or self.activeState:
     38             self.projectBracket.maxDispRange = 1e+32
     39         elif self.distanceFadeAlphaNearFar:
     40             self.projectBracket.maxDispRange = self.distanceFadeAlphaNearFar[1]
     41 
     42     def GetMarkerOpacity(self, bracketCameraDistance, cameraZoomDistance):
     43         if self._mapTransitioning:
     44             return 0.0
     45         if self.IsActive() or self.IsHilighted():
     46             return mapViewConst.OPACITY_MARKER_SELECTED
     47         return MarkerLabelBase.GetMarkerOpacity(self, bracketCameraDistance, cameraZoomDistance)
     48 
     49     def UpdateRegionPosition(self, regionPosition):
     50         self.position = regionPosition
     51         self.projectBracket.trackPosition = self.position
     52 
     53     def GetMarkerContainerCls(self):
     54         return MarkerContainerRegion
     55 
     56     def SetMapTransitioning(self, isTransitioning):
     57         self._mapTransitioning = isTransitioning
     58         if isTransitioning:
     59             self.DestroyRenderObject()