LaunchpadContainer.py (2183B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\planet\pinContainers\LaunchpadContainer.py 2 import carbonui.const as uiconst 3 from eve.client.script.ui.control.eveLabel import Label 4 import localization 5 from .StorageFacilityContainer import StorageFacilityContainer 6 from .. import planetCommon 7 8 class LaunchpadContainer(StorageFacilityContainer): 9 default_name = 'LaunchpadContainer' 10 panelIDs = [planetCommon.PANEL_LAUNCH] + StorageFacilityContainer.panelIDs 11 12 def PanelLaunch(self): 13 bp = sm.GetService('michelle').GetBallpark() 14 text = None 15 if bp is not None and not self.pin.IsInEditMode(): 16 customsOfficeIDs = sm.GetService('planetInfo').GetFunctionalCustomOfficeOrbitalsForPlanet(sm.GetService('planetUI').planetID) 17 if len(customsOfficeIDs) > 0: 18 try: 19 customsOfficeID = None 20 for ID in customsOfficeIDs: 21 customsOfficeID = ID 22 break 23 24 sm.GetService('planetUI').OpenPlanetCustomsOfficeImportWindow(customsOfficeID, self.pin.id) 25 self.CloseByUser() 26 return 27 except UserError as e: 28 if e.msg == 'ShipCloaked': 29 text = localization.GetByLabel('UI/PI/Common/CannotAccessLaunchpadWhileCloaked') 30 else: 31 message = cfg.GetMessage(e.msg) 32 text = message.text 33 34 if text is None: 35 if self.pin.IsInEditMode(): 36 text = localization.GetByLabel('UI/PI/Common/CustomsOfficeNotBuilt') 37 else: 38 solarSystemID = sm.GetService('planetUI').GetCurrentPlanet().solarSystemID 39 if solarSystemID == session.locationid and session.structureid is None: 40 text = localization.GetByLabel('UI/PI/Common/CannotAccessLaunchpadNotThere') 41 else: 42 text = localization.GetByLabel('UI/PI/Common/CannotAccessLaunchpadLocation') 43 return Label(parent=self.actionCont, text=text, align=uiconst.TOTOP)