def __onDropVehicleCamouflage(self, resultID, kind):
     if resultID < 0:
         message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_DROP_SERVER_ERROR)
         self.onCustomizationDropFailed(message)
         return
     else:
         item = self.currentItemsByKind.get(kind)
         hangarItem = CustomizationHelper.getItemFromHangar(CUSTOMIZATION_ITEM_TYPE.CAMOUFLAGE_TYPE, item.get('id'), self._nationID)
         if hangarItem:
             intCD = g_currentVehicle.item.intCD
             vehicle = vehicles.getVehicleType(int(intCD))
             message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_STORED_SUCCESS, vehicle=vehicle.userString)
         else:
             message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_DROP_SUCCESS)
         if g_tankActiveCamouflage.has_key(g_currentVehicle.item.intCD):
             del g_tankActiveCamouflage[g_currentVehicle.item.intCD]
         newID = None
         newLifeCycle = None
         if gui.game_control.g_instance.igr.getRoomType() != IGR_TYPE.NONE:
             camouflages = g_currentVehicle.item.descriptor.camouflages
             camo = camouflages[kind]
             if camo[0] is not None:
                 newID = camo[0]
                 newLifeCycle = (camo[1], camo[2])
         item['id'] = newID
         item['lifeCycle'] = newLifeCycle
         if CAMOUFLAGE_KINDS.get(self._itemsDP.currentGroup) == kind:
             self._itemsDP.currentItemID = newID
         self.onCustomizationDropSuccess(message)
         return
 def __onDropVehicleCamouflage(self, resultID, kind):
     if resultID < 0:
         message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_DROP_SERVER_ERROR)
         self.onCustomizationDropFailed(message)
         return
     item = self.currentItemsByKind.get(kind)
     hangarItem = CustomizationHelper.getItemFromHangar(CUSTOMIZATION_ITEM_TYPE.CAMOUFLAGE_TYPE, item.get('id'), self._nationID)
     if hangarItem:
         intCD = g_currentVehicle.item.intCD
         vehicle = vehicles.getVehicleType(int(intCD))
         message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_STORED_SUCCESS, vehicle=vehicle.userString)
     else:
         message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_DROP_SUCCESS)
     if g_tankActiveCamouflage.has_key(g_currentVehicle.item.intCD):
         del g_tankActiveCamouflage[g_currentVehicle.item.intCD]
     newID = None
     newLifeCycle = None
     if gui.game_control.g_instance.igr.getRoomType() != IGR_TYPE.NONE:
         camouflages = g_currentVehicle.item.descriptor.camouflages
         camo = camouflages[kind]
         if camo[0] is not None:
             newID = camo[0]
             newLifeCycle = (camo[1], camo[2])
     item['id'] = newID
     item['lifeCycle'] = newLifeCycle
     if CAMOUFLAGE_KINDS.get(self._itemsDP.currentGroup) == kind:
         self._itemsDP.currentItemID = newID
     self.onCustomizationDropSuccess(message)
Example #3
0
 def __onCustomizationDrop(self, resultID, cItemID, cType):
     if resultID < 0:
         message = _ms(_DROP_MESSAGE[cType]['error'])
     else:
         if self.__aData.available[cType][cItemID].isInDossier:
             intCD = g_currentVehicle.item.intCD
             vehicle = vehicles.getVehicleType(int(intCD))
             message = _ms(_DROP_MESSAGE[cType]['storedSuccess'], vehicle=vehicle.userString)
         else:
             message = _ms(_DROP_MESSAGE[cType]['removedSuccess'])
         if g_tankActiveCamouflage.has_key(g_currentVehicle.item.intCD):
             del g_tankActiveCamouflage[g_currentVehicle.item.intCD]
     SystemMessages.pushMessage(message)
     self.__synchronizeDossierIfRequired()
     self.purchaseProcessed()
Example #4
0
 def __onCustomizationDrop(self, resultID, cItemID, cType):
     if resultID < 0:
         message = _ms(_DROP_MESSAGE[cType]['error'])
         sysMessageType = SystemMessages.SM_TYPE.Error
     else:
         sysMessageType = SystemMessages.SM_TYPE.Information
         if cItemID in self.__displayedElements[cType] and self.__displayedElements[cType][cItemID].isInDossier:
             intCD = g_currentVehicle.item.intCD
             vehicle = vehicles.getVehicleType(int(intCD))
             message = _ms(_DROP_MESSAGE[cType]['storedSuccess'], vehicle=vehicle.userString)
         else:
             message = _ms(_DROP_MESSAGE[cType]['removedSuccess'])
         if g_tankActiveCamouflage.has_key(g_currentVehicle.item.intCD):
             del g_tankActiveCamouflage[g_currentVehicle.item.intCD]
     SystemMessages.pushMessage(message, type=sysMessageType)
     self.__synchronizeDossierIfRequired()
Example #5
0
 def __onCustomizationDrop(self, resultID, cItemID, cType):
     if resultID < 0:
         message = _ms(_DROP_MESSAGE[cType]['error'])
         sysMessageType = SystemMessages.SM_TYPE.Error
     else:
         sysMessageType = SystemMessages.SM_TYPE.Information
         if cItemID in self.__displayedElements[cType] and self.__displayedElements[cType][cItemID].isInDossier:
             intCD = g_currentVehicle.item.intCD
             vehicle = vehicles.getVehicleType(int(intCD))
             message = _ms(_DROP_MESSAGE[cType]['storedSuccess'], vehicle=vehicle.userString)
         else:
             message = _ms(_DROP_MESSAGE[cType]['removedSuccess'])
         if g_tankActiveCamouflage.has_key(g_currentVehicle.item.intCD):
             del g_tankActiveCamouflage[g_currentVehicle.item.intCD]
     SystemMessages.pushMessage(message, type=sysMessageType)
     self.__synchronizeDossierIfRequired()
Example #6
0
 def __onDropVehicleCamouflage(self, resultID, kind):
     if resultID < 0:
         message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_DROP_SERVER_ERROR)
         self.onCustomizationDropFailed(message)
         return
     else:
         item = self.currentItemsByKind.get(kind)
         if g_tankActiveCamouflage.has_key(g_currentVehicle.item.intCD):
             del g_tankActiveCamouflage[g_currentVehicle.item.intCD]
         item['id'] = None
         item['lifeCycle'] = None
         if CAMOUFLAGE_KINDS.get(self._itemsDP.currentGroup) == kind:
             self._itemsDP.currentItemID = None
         message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_DROP_SUCCESS)
         self.onCustomizationDropSuccess(message)
         return
 def __onDropVehicleCamouflage(self, resultID, kind):
     if resultID < 0:
         message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_DROP_SERVER_ERROR)
         self.onCustomizationDropFailed(message)
         return
     item = self.currentItemsByKind.get(kind)
     if g_tankActiveCamouflage.has_key(g_currentVehicle.item.intCD):
         del g_tankActiveCamouflage[g_currentVehicle.item.intCD]
     newID = None
     newLifeCycle = None
     if gui.game_control.g_instance.igr.getRoomType() != IGR_TYPE.NONE:
         camouflages = g_currentVehicle.item.descriptor.camouflages
         camo = camouflages[kind]
         if camo[0] is not None:
             newID = camo[0]
             newLifeCycle = (camo[1], camo[2])
     item['id'] = newID
     item['lifeCycle'] = newLifeCycle
     if CAMOUFLAGE_KINDS.get(self._itemsDP.currentGroup) == kind:
         self._itemsDP.currentItemID = newID
     message = i18n.makeString(SYSTEM_MESSAGES.CUSTOMIZATION_CAMOUFLAGE_DROP_SUCCESS)
     self.onCustomizationDropSuccess(message)