Пример #1
0
 def __getActionButtonStateVO(self):
     stateString = ''
     unitFunctional = self.unitFunctional
     pInfo = unitFunctional.getPlayerInfo()
     isInQueue = unitFunctional.getFlags().isInIdle()
     isEnabled = g_currentVehicle.isReadyToPrebattle() and not isInQueue
     playerReady = pInfo.isReady
     if not g_currentVehicle.isPresent():
         stateString = i18n.makeString('#cybersport:window/unit/message/vehicleNotSelected')
     elif not g_currentVehicle.isReadyToPrebattle():
         stateString = i18n.makeString('#cybersport:window/unit/message/vehicleNotValid')
     elif not playerReady:
         stateString = i18n.makeString(MESSENGER.DIALOGS_SQUAD_MESSAGE_GETREADY)
     elif g_eventsCache.isEventEnabled() and self.__isFallout is not None and self.__isFallout != g_currentVehicle.item.isEvent:
         stateString = error(MENU.CURRENTVEHICLESTATUS_NOTVALIDVEHICLE)
     elif playerReady and not isInQueue:
         stateString = i18n.makeString(MESSENGER.DIALOGS_SQUAD_MESSAGE_GETNOTREADY)
     stateString = TextManager.getText(TEXT_MANAGER_STYLES.MAIN_TEXT if isEnabled else TEXT_MANAGER_STYLES.ERROR_TEXT, stateString)
     if playerReady:
         label = CYBERSPORT.WINDOW_UNIT_NOTREADY
     else:
         label = CYBERSPORT.WINDOW_UNIT_READY
     return {'stateString': stateString,
      'label': label,
      'isEnabled': isEnabled,
      'isReady': playerReady}
 def __cv_onChanged(self, *args):
     if self.__steps:
         return
     if not g_currentVehicle.isReadyToFight() and not g_currentVehicle.isReadyToPrebattle():
         if g_currentVehicle.isCrewFull() and not g_currentVehicle.isBroken():
             self.closeWindow()
     else:
         self.as_setActionsLockedS(g_currentVehicle.isLocked() or g_currentVehicle.isBroken() or g_currentVehicle.isDisabledInRent())
Пример #3
0
 def canPlayerDoAction(self):
     isValid, notValidReason = True, ''
     team, assigned = decodeRoster(self.getRosterKey())
     if self.isCreator():
         isValid, notValidReason = self._limits.isTeamValid()
     elif self.getTeamState().isInQueue() and assigned:
         isValid = False
     elif not g_currentVehicle.isReadyToPrebattle():
         isValid = False
     return (isValid, notValidReason)
Пример #4
0
 def canPlayerDoAction(self):
     isValid, notValidReason = True, ''
     team, assigned = decodeRoster(self.getRosterKey())
     if self.isCreator():
         isValid, notValidReason = self._limits.isTeamValid()
     elif self.getTeamState().isInQueue() and assigned:
         isValid = False
     elif not g_currentVehicle.isReadyToPrebattle():
         isValid = False
     return (isValid, notValidReason)
Пример #5
0
 def __cv_onChanged(self, *args):
     if self.__steps:
         return
     if not g_currentVehicle.isReadyToFight(
     ) and not g_currentVehicle.isReadyToPrebattle():
         if g_currentVehicle.isCrewFull(
         ) and not g_currentVehicle.isBroken():
             self.closeWindow()
     else:
         self.as_setActionsLockedS(g_currentVehicle.isLocked()
                                   or g_currentVehicle.isBroken()
                                   or g_currentVehicle.isDisabledInRent())
Пример #6
0
 def __init__(self, prbFunctional):
     super(SquadActionButtonStateVO, self).__init__()
     stateString = ''
     pInfo = prbFunctional.getPlayerInfo()
     team, assigned = decodeRoster(prbFunctional.getRosterKey())
     isInQueue = prbFunctional.getTeamState().isInQueue()
     isEnabled = g_currentVehicle.isReadyToPrebattle() and not (isInQueue and assigned)
     if not g_currentVehicle.isPresent():
         stateString = i18n.makeString(CYBERSPORT.WINDOW_UNIT_MESSAGE_NOVEHICLE)
     elif not g_currentVehicle.isReadyToPrebattle():
         stateString = i18n.makeString(CYBERSPORT.WINDOW_UNIT_MESSAGE_VEHICLEINNOTREADY)
     elif not pInfo.isReady():
         stateString = i18n.makeString(MESSENGER.DIALOGS_SQUAD_MESSAGE_GETREADY)
     elif pInfo.isReady() and not isInQueue:
         stateString = i18n.makeString(MESSENGER.DIALOGS_SQUAD_MESSAGE_GETNOTREADY)
     if pInfo.isReady():
         label = CYBERSPORT.WINDOW_UNIT_NOTREADY
     else:
         label = CYBERSPORT.WINDOW_UNIT_READY
     self['stateString'] = stateString
     self['label'] = label
     self['isEnabled'] = isEnabled
     self['isReady'] = pInfo.isReady()
Пример #7
0
    def check(self, teamLimits):
        if not g_currentVehicle.isPresent():
            return (False, PREBATTLE_RESTRICTION.VEHICLE_NOT_PRESENT)
        if g_currentVehicle.isEvent():
            return (False, PREBATTLE_RESTRICTION.VEHICLE_NOT_SUPPORTED)
        if g_currentVehicle.isRotationGroupLocked():
            return (False, PREBATTLE_RESTRICTION.VEHICLE_ROTATION_GROUP_LOCKED)
        if not g_currentVehicle.isReadyToPrebattle():
            return (False, PREBATTLE_RESTRICTION.VEHICLE_NOT_READY)
        vehicle = g_currentVehicle.item
        shellsList = []
        for shell in vehicle.shells:
            shellsList.extend([shell.intCD, shell.count])

        return isVehicleValid(vehicle.descriptor, shellsList, teamLimits)
Пример #8
0
    def check(self, teamLimits):
        if not g_currentVehicle.isPresent():
            return (False, PREBATTLE_RESTRICTION.VEHICLE_NOT_PRESENT)
        if g_currentVehicle.isEvent():
            return (False, PREBATTLE_RESTRICTION.VEHICLE_NOT_SUPPORTED)
        if g_currentVehicle.isFalloutOnly(
        ) and not self.falloutCtrl.isSelected():
            return (False, PREBATTLE_RESTRICTION.VEHICLE_FALLOUT_ONLY)
        if not g_currentVehicle.isReadyToPrebattle():
            return (False, PREBATTLE_RESTRICTION.VEHICLE_NOT_READY)
        vehicle = g_currentVehicle.item
        shellsList = []
        for shell in vehicle.shells:
            shellsList.extend([shell.intCD, shell.count])

        return isVehicleValid(vehicle.descriptor, shellsList, teamLimits)
Пример #9
0
 def isEnqueueBtnEnabled(self):
     return g_currentVehicle.isReadyToPrebattle() and not self.preQueueFunctional.isInQueue()
Пример #10
0
 def isReadyBtnEnabled(self):
     functional = self.prbFunctional
     team, assigned = decodeRoster(functional.getRosterKey())
     return g_currentVehicle.isReadyToPrebattle() and not (functional.getTeamState().isInQueue() and assigned)
 def isReadyBtnEnabled(self):
     entity = self.prbEntity
     _, assigned = decodeRoster(entity.getRosterKey())
     return g_currentVehicle.isReadyToPrebattle() and not (
         entity.getTeamState().isInQueue() and assigned)
Пример #12
0
 def isEnqueueBtnEnabled(self):
     return g_currentVehicle.isReadyToPrebattle(
     ) and not self.preQueueFunctional.isInQueue()
Пример #13
0
 def isEnqueueBtnEnabled(self):
     return g_currentVehicle.isReadyToPrebattle(
     ) and not self.prbEntity.isInQueue()
Пример #14
0
 def isReadyBtnEnabled(self):
     functional = self.prbFunctional
     team, assigned = decodeRoster(functional.getRosterKey())
     return g_currentVehicle.isReadyToPrebattle() and not (
         functional.getTeamState().isInQueue() and assigned)
Пример #15
0
 def validateVehicles(self, vInfo, flags):
     if not g_currentVehicle.isReadyToPrebattle():
         return (False, UNIT_RESTRICTION.VEHICLE_NOT_VALID)
     return (True, UNIT_RESTRICTION.UNDEFINED)