miningBeaconEntity.py (1460B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\structure\deployment\miningBeaconEntity.py 2 import trinity 3 from moonmining.const import MAXIMUM_MINING_BEACON_DISTANCE 4 5 class MiningBeaconEntity(object): 6 7 def __init__(self, beaconPosition): 8 self.clientBall = None 9 self.sphereModel = None 10 scene = sm.GetService('sceneManager').GetRegisteredScene('default') 11 if scene is None: 12 return 13 self._Setup(scene, beaconPosition) 14 15 def _Setup(self, scene, beaconPosition): 16 ballpark = sm.GetService('michelle').GetBallpark() 17 self.clientBall = ballpark.AddClientSideBall(beaconPosition) 18 self.sphereModel = trinity.Load('res:/ui/inflight/tactical/rangeSphereBlue.red') 19 self.sphereModel.scaling = (2 * MAXIMUM_MINING_BEACON_DISTANCE, 2 * MAXIMUM_MINING_BEACON_DISTANCE, 2 * MAXIMUM_MINING_BEACON_DISTANCE) 20 self.sphereModel.translationCurve = self.clientBall 21 self.sphereModel.display = True 22 scene.objects.append(self.sphereModel) 23 24 def Close(self): 25 scene = sm.GetService('sceneManager').GetRegisteredScene('default') 26 if scene: 27 if self.sphereModel: 28 scene.objects.fremove(self.sphereModel) 29 self.sphereModel = None 30 if self.clientBall: 31 ballpark = sm.GetService('michelle').GetBallpark() 32 ballpark.RemoveBall(self.clientBall.id)