structureDrillingPlatform.py (1627B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\environment\spaceObject\structureDrillingPlatform.py 2 import blue 3 from eve.client.script.environment.model.turretSet import StructureMoonMiningTurretSet 4 from eve.client.script.environment.spaceObject.structure import Structure 5 import inventorycommon.const as invConst 6 import uthread 7 8 class StructureDrillingPlatform(Structure): 9 10 def __init__(self): 11 super(StructureDrillingPlatform, self).__init__() 12 self.closestMoon = None 13 self.closestMoonID = None 14 self.moonMiningTurret = None 15 16 def _OnSlimItemUpdated(self, item, taskletSpawner): 17 self.closestMoonID = item.closestMoonID 18 super(StructureDrillingPlatform, self)._OnSlimItemUpdated(item, taskletSpawner) 19 20 def FitHardpoints(self, blocking = False): 21 super(StructureDrillingPlatform, self).FitHardpoints(blocking) 22 for turret in self.turrets: 23 if isinstance(turret, StructureMoonMiningTurretSet): 24 self.moonMiningTurret = turret 25 if self.closestMoonID is not None: 26 ball = sm.GetService('michelle').GetBall(self.closestMoonID) 27 if ball.GetModel() is None: 28 ball.RegisterForModelLoad(self.SetMoonDrillTarget) 29 else: 30 self.SetMoonDrillTarget() 31 32 def SetMoonDrillTarget(self): 33 self.moonMiningTurret.SetMoonID(self.closestMoonID) 34 35 def UnfitHardpoints(self): 36 super(StructureDrillingPlatform, self).UnfitHardpoints() 37 self.moonMiningTurret = None