def _doPutOnAction(self, vehicle, callback):
     action = ActionsFactory.getAction(
         ActionsFactory.BUY_AND_INSTALL_BATTLE_BOOSTERS,
         vehicle,
         confirmOnlyExchange=True)
     result = yield ActionsFactory.asyncDoAction(action)
     callback(result)
예제 #2
0
 def demountAllPairs(self):
     vehicle = self._vehicle
     toDiscardIDs = vehicle.postProgression.getInstalledMultiIds()
     action = ActionsFactory.getAction(
         ActionsFactory.DISCARD_POST_PROGRESSION_PAIRS, vehicle,
         *toDiscardIDs)
     yield ActionsFactory.asyncDoAction(action)
예제 #3
0
 def _demountProcess(self, isDestroy=False, everywhere=True):
     item = self._itemsCache.items.getItemByCD(self._intCD)
     action = ActionsFactory.getAction(ActionsFactory.REMOVE_OPT_DEVICE, self._getVehicle(), item, self._installedSlotId, isDestroy, forFitting=False, everywhere=everywhere)
     result = yield ActionsFactory.asyncDoAction(action)
     if result:
         if isDestroy:
             actionType = BaseSetupModel.DESTROY_SLOT_ACTION
         elif everywhere:
             actionType = BaseSetupModel.DEMOUNT_SLOT_FROM_SETUPS_ACTION
         else:
             actionType = BaseSetupModel.DEMOUNT_SLOT_ACTION
         self._sendLastSlotAction(TankSetupConstants.OPT_DEVICES, actionType, {'intCD': item.intCD,
          'slotID': self._installedSlotId})
예제 #4
0
 def onChangeSetupLayoutIndex(self, hudGroupID, layoutIdx, callback=None):
     result = False
     if self.isNewSetupLayoutIndexValid(
             hudGroupID, layoutIdx) and hudGroupID in GROUPS_MAP:
         groupId = GROUPS_MAP[hudGroupID]
         self._updateSwitchingProgress(True)
         result = yield ActionsFactory.asyncDoAction(
             ActionsFactory.getAction(
                 ActionsFactory.CHANGE_SETUP_EQUIPMENTS_INDEX,
                 self._vehicle, groupId, layoutIdx))
         if result:
             self.__markHintUsed(groupId)
             playSound(Sounds.SETUP_SWITCH)
         self._updateSwitchingProgress(False)
     if callback is not None:
         callback(result)
     return
예제 #5
0
 def _onPrebattleSwitchToggleClick(self, args):
     stepID = int(args['stepID'])
     if stepID in self.__togglingSteps:
         return
     elif self.__lockTogglingCallbackID is not None:
         return
     else:
         self.__lockToggling()
         self.__togglingSteps.add(stepID)
         featureName = self._vehicle.postProgression.getStep(
             stepID).action.getTechName()
         groupID = GROUP_ID_BY_FEATURE[featureName]
         action = factory.getAction(
             factory.SWITCH_PREBATTLE_AMMO_PANEL_AVAILABILITY,
             self._vehicle, groupID, args['active'])
         yield factory.asyncDoAction(action)
         self.__togglingSteps.discard(stepID)
         return
예제 #6
0
 def _doPutOnAction(self, vehicle, callback):
     action = ActionsFactory.getAction(ActionsFactory.INSTALL_BATTLE_ABILITIES, vehicle)
     result = yield ActionsFactory.asyncDoAction(action)
     callback(result)
예제 #7
0
 def __onPurchaseClick(self):
     vehicle = self._vehicle
     toPurchaseIDs = self.__getStepsToPurchase(vehicle.postProgression)
     action = factory.getAction(factory.PURCHASE_POST_PROGRESSION_STEPS,
                                vehicle, toPurchaseIDs)
     yield factory.asyncDoAction(action)