controllerGhostFittingExtension.py (1316B)
1 #Embedded file name: C:\BuildAgent\work\20d73f1b24eed06e\eve\release\V24.01\eve\client\script\ui\shared\fittingScreen\controllerGhostFittingExtension.py 2 import evetypes 3 4 class FittingControllerGhostFittingExtension(object): 5 6 def __init__(self): 7 self.ghostFittingSvc = sm.GetService('ghostFittingSvc') 8 9 def GetDogmaLocation(self): 10 return sm.GetService('clientDogmaIM').GetFittingDogmaLocation() 11 12 def PreviewFitItem(self, item): 13 if item: 14 return self._PreviewFitItemFromTypeID(item.typeID, item.itemID) 15 self.ghostFittingSvc.SendOnFeedbackTextChanged(None) 16 17 def _PreviewFitItemFromTypeID(self, typeID, itemID): 18 dogmaItem = self.ghostFittingSvc.TryFitModuleToOneSlot(typeID, preview=True, originalItemID=itemID) 19 if dogmaItem: 20 dogmaItem.isPreviewItem = True 21 return dogmaItem 22 23 def UnFitItem(self, dogmaItem): 24 if dogmaItem: 25 categoryID = evetypes.GetCategoryID(dogmaItem.typeID) 26 if categoryID == const.categoryDrone: 27 self.ghostFittingSvc.UnfitDrone(dogmaItem.itemID) 28 elif categoryID == const.categoryFighter: 29 self.ghostFittingSvc.UnfitOneFighter(dogmaItem.itemID) 30 else: 31 self.ghostFittingSvc.UnfitModule(dogmaItem.itemID)