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

mapMarkerLandmark.py (1904B)


      1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\mapView\markers\mapMarkerLandmark.py
      2 import evetypes
      3 from menu import MenuLabel
      4 from carbonui.primitives.base import ScaleDpi
      5 import eve.client.script.ui.shared.mapView.mapViewConst as mapViewConst
      6 from eve.client.script.ui.shared.mapView.markers.mapMarkerBase_Label import MarkerLabelBase
      7 from eve.client.script.ui.shared.maps.maputils import GetNameFromMapCache
      8 
      9 class MarkerLabelLandmark(MarkerLabelBase):
     10     fontPath = 'res:/UI/Fonts/EveSansNeue-Italic.otf'
     11     letterSpace = 2
     12     distanceFadeAlphaNearFar = (mapViewConst.MAX_MARKER_DISTANCE * 0.015, mapViewConst.MAX_MARKER_DISTANCE * 2)
     13 
     14     def __init__(self, *args, **kwds):
     15         self.isAbstractMode = kwds.get('isAbstractMode', False)
     16         MarkerLabelBase.__init__(self, *args, **kwds)
     17         self.landmarkData = kwds['landmarkData']
     18         self.typeID = const.typeMapLandmark
     19         self.itemID = self.markerID
     20 
     21     def Load(self):
     22         MarkerLabelBase.Load(self)
     23         self.projectBracket.offsetY = -ScaleDpi(self.markerContainer.height + 20)
     24 
     25     def GetLabelText(self):
     26         return GetNameFromMapCache(self.landmarkData.landmarkNameID, 'landmark')
     27 
     28     def GetMenu(self):
     29         return [(MenuLabel('UI/Commands/ShowInfo'), sm.GetService('info').ShowInfo, (const.typeMapLandmark, self.markerID))]
     30 
     31     def OnClick(self, *args, **kwds):
     32         sm.GetService('info').ShowInfo(const.typeMapLandmark, self.markerID)
     33 
     34     def SetBracketMaxDispRange(self):
     35         if self.isAbstractMode:
     36             self.projectBracket.maxDispRange = mapViewConst.MAX_MARKER_DISTANCE * 2
     37         else:
     38             self.projectBracket.maxDispRange = self.distanceFadeAlphaNearFar[1]
     39 
     40     def UpdateLandmarkPosition(self, landmarpPosition):
     41         self.position = landmarpPosition
     42         self.projectBracket.trackPosition = self.position