Esempio n. 1
0
 def __init__(self, itemID, typeID = None):
     sm.RegisterNotify(self)
     self.ghostFittingExtension = FittingControllerGhostFittingExtension()
     self._itemID = itemID
     self._typeID = typeID or GetTypeIDForController(itemID)
     self.SetDogmaLocation()
     self.ghostFittedItem = None
     self._skinMaterialSetID = None
     self.on_new_itemID = signals.Signal()
     self.on_stats_changed = signals.Signal()
     self.on_hardpoints_fitted = signals.Signal()
     self.on_subsystem_fitted = signals.Signal()
     self.on_module_online_state = signals.Signal()
     self.on_item_ghost_fitted = signals.Signal()
     self.on_name_changed = signals.Signal()
     self.on_skin_material_changed = signals.Signal()
     self.on_stance_activated = signals.Signal()
     self.on_should_close = signals.Signal()
     self.on_slots_with_menu_changed = signals.Signal()
     self.on_controller_changing = signals.Signal()
     self.on_drones_changed = signals.Signal()
     self.slotsByFlagID = {}
     self.slotFlagWithMenu = None
     self.ConstructSlotControllers()
     self._UpdateSkinMaterial()
Esempio n. 2
0
 def ConstructCurrentGhostIcon(self):
     shipTypeID = GetTypeIDForController(session.shipid)
     self.currentShipGhost = GhostShipIcon(name='currentShipGhost',
                                           parent=self.overlayCont,
                                           typeID=shipTypeID,
                                           align=uiconst.TOPRIGHT,
                                           pos=(0, 10, 64, 64))
     self.ChangeCurrentShipGhostDisplay()
Esempio n. 3
0
def GetFittingController(itemID, ghost = False):
    typeID = GetTypeIDForController(itemID)
    if ghost:
        if IsInStructureCategory(typeID):
            return StructureFittingControllerGhost(itemID, typeID)
        else:
            return ShipFittingControllerGhost(itemID)
    else:
        if IsInStructureCategory(typeID):
            return StructureFittingController(itemID, typeID)
        return ShipFittingController(itemID)
Esempio n. 4
0
 def UpdateItem(self, itemID, typeID = None):
     oldItemID = self._itemID
     oldTypeID = self._typeID
     self._itemID = itemID
     if typeID is None:
         typeID = GetTypeIDForController(itemID)
     self._typeID = typeID
     if self.IsControllerChanging(itemID, typeID, oldItemID, oldTypeID):
         self.on_controller_changing(itemID)
     self._UpdateSkinMaterial()
     self.on_new_itemID()
     self._UpdateSlots()
Esempio n. 5
0
 def ToggleGhostFitting(self, *args):
     fittingSvc = sm.GetService('fittingSvc')
     ghostFittingSvc = sm.GetService('ghostFittingSvc')
     isSimulated = fittingSvc.IsShipSimulated()
     self.ghostFittingSwitch.state = uiconst.UI_DISABLED
     if isSimulated:
         fittingSvc.SetSimulationState(False)
         shipID = GetActiveShip()
         newTypeID = GetTypeIDForController(shipID)
         ghostFittingSvc.SendOnSimulatedShipLoadedEvent(shipID, newTypeID)
         self.ChangeSimulateUIstate(False)
     else:
         fittingDL = sm.GetService(
             'clientDogmaIM').GetFittingDogmaLocation()
         shipItem = fittingDL.GetShip()
         if shipItem:
             fittingSvc.SetSimulationState(True)
             ghostFittingSvc.SendOnSimulatedShipLoadedEvent(
                 shipItem.itemID, shipItem.typeID)
         else:
             ghostFittingSvc.LoadCurrentShip()
     newState = not isSimulated
     self.ChangeSimulateUIstate(newState)
     self.controller.OnSimulationStateChanged(newState)
Esempio n. 6
0
 def OnSessionChanged(self, *args):
     newTypeID = GetTypeIDForController(session.shipid)
     self.currentShipGhost.SetShipTypeID(newTypeID)
Esempio n. 7
0
 def IsControllerChanging(self, newItemID, newTypeID, oldItemID, oldTypeID):
     oldTypeID = oldTypeID or GetTypeIDForController(oldItemID)
     newTypeID = newTypeID or GetTypeIDForController(newItemID)
     if evetypes.GetCategoryID(oldTypeID) != evetypes.GetCategoryID(newTypeID):
         return True
     return False