Example #1
1
 def __apply(self, settings, restartApproved=False, isCloseWnd=False):
     LOG_DEBUG("Settings window: apply settings", restartApproved, settings)
     g_settingsCore.isDeviseRecreated = False
     g_settingsCore.isChangesConfirmed = True
     isRestart = self.params.apply(settings, restartApproved)
     if settings_constants.GRAPHICS.INTERFACE_SCALE in settings:
         self.__updateInterfaceScale()
     isPresetApplied = self.__isGraphicsPresetApplied(settings)
     if g_settingsCore.isChangesConfirmed and isCloseWnd:
         self.onWindowClose()
     if isRestart:
         BigWorld.savePreferences()
         if restartApproved:
             BigWorld.callback(0.3, self.__restartGame)
         elif g_settingsCore.isDeviseRecreated:
             self.onRecreateDevice()
             g_settingsCore.isDeviseRecreated = False
         else:
             BigWorld.callback(0.0, functools.partial(BigWorld.changeVideoMode, -1, BigWorld.isVideoWindowed()))
     elif not isPresetApplied:
         DialogsInterface.showI18nInfoDialog("graphicsPresetNotInstalled", None)
 def __apply(self, settings, restartApproved=False, isCloseWnd=False):
     LOG_DEBUG('Settings window: apply settings', restartApproved, settings)
     self.settingsCore.isDeviseRecreated = False
     self.settingsCore.isChangesConfirmed = True
     isRestart = self.params.apply(settings, restartApproved)
     if settings_constants.GRAPHICS.INTERFACE_SCALE in settings:
         self.__updateInterfaceScale()
     isPresetApplied = self.__isGraphicsPresetApplied(settings)
     if self.settingsCore.isChangesConfirmed and isCloseWnd:
         self.onWindowClose()
     if isRestart:
         BigWorld.savePreferences()
         if restartApproved:
             BigWorld.callback(0.3, self.__restartGame)
         elif self.settingsCore.isDeviseRecreated:
             self.onRecreateDevice()
             self.settingsCore.isDeviseRecreated = False
         else:
             BigWorld.callback(
                 0.0,
                 functools.partial(BigWorld.changeVideoMode, -1,
                                   BigWorld.getWindowMode()))
     elif not isPresetApplied:
         DialogsInterface.showI18nInfoDialog('graphicsPresetNotInstalled',
                                             None)
     return
Example #3
0
 def doAction(self, action=None, dispatcher=None):
     if self.isCreator():
         stats = self.getPlayersStateStats()
         if stats.haveInBattle:
             DialogsInterface.showI18nInfoDialog('squadHavePlayersInBattle',
                                                 lambda result: None)
             return True
         notReadyCount = stats.notReadyCount
         if not self.getPlayerInfo().isReady():
             notReadyCount -= 1
         if notReadyCount > 0:
             DialogsInterface.showDialog(
                 I18nConfirmDialogMeta('squadHaveNotReadyPlayers',
                                       messageCtx={
                                           'notReadyCount': notReadyCount,
                                           'playersCount':
                                           stats.playersCount
                                       }), self.__setCreatorReady)
             return True
         self.__setCreatorReady(True)
     elif self.getPlayerInfo().isReady():
         self.setPlayerState(
             context.SetPlayerStateCtx(
                 False, waitingID='prebattle/player_not_ready'))
     else:
         self.setPlayerState(
             context.SetPlayerStateCtx(True,
                                       waitingID='prebattle/player_ready'))
     return True
Example #4
0
 def doAction(self, action=None, dispatcher=None):
     if self.isCreator():
         if self.getRosterKey() != PREBATTLE_ROSTER.ASSIGNED_IN_TEAM1:
             DialogsInterface.showI18nInfoDialog('teamDoesNotHaveCommander',
                                                 lambda result: None)
             return True
         stats = self.getPlayersStateStats()
         creatorWeight = 1 if not self.getPlayerInfo().isReady() else 0
         readyCount = stats.playersCount - stats.notReadyCount
         if readyCount < stats.limitMaxCount - creatorWeight:
             DialogsInterface.showDialog(
                 I18nConfirmDialogMeta('teamHaveNotReadyPlayers',
                                       messageCtx={
                                           'readyCount': readyCount,
                                           'playersCount':
                                           stats.playersCount
                                       }), self.__setCreatorReady)
             return True
         self.__setCreatorReady(True)
     elif self.getPlayerInfo().isReady():
         self.setPlayerState(
             prb_ctx.SetPlayerStateCtx(
                 False, waitingID='prebattle/player_not_ready'))
     else:
         self.setPlayerState(
             prb_ctx.SetPlayerStateCtx(True,
                                       waitingID='prebattle/player_ready'))
     return True
def showParentControlNotification():
    from gui import game_control, DialogsInterface
    if game_control.g_instance.gameSession.isPlayTimeBlock:
        key = 'koreaPlayTimeNotification'
    else:
        key = 'koreaParentNotification'
    DialogsInterface.showI18nInfoDialog(key, lambda *args: None)
Example #6
0
 def showParentControlNotification(self):
     from gui import game_control, DialogsInterface
     if game_control.g_instance.gameSession.isPlayTimeBlock:
         key = 'koreaPlayTimeNotification'
     else:
         key = 'koreaParentNotification'
     DialogsInterface.showI18nInfoDialog(key, lambda *args: None)
Example #7
0
 def onDossierReceived(databaseID, _):
     clanID, clanInfo = self.itemsCache.items.getClanInfo(databaseID)
     if clanID != 0:
         clanInfo = ClanInfo(*clanInfo)
         shared_events.showClanProfileWindow(clanID, clanInfo.getClanAbbrev())
     else:
         DialogsInterface.showI18nInfoDialog('clan_data_not_available', lambda result: None)
    def execute(self):
        if self._entity.isCommander():
            func = self._entity
            fullData = func.getUnitFullData(unitMgrID=func.getID())
            notReadyCount = 0
            for slot in fullData.slotsIterator:
                slotPlayer = slot.player
                if slotPlayer:
                    if slotPlayer.isInArena() or fullData.playerInfo.isInSearch() or fullData.playerInfo.isInQueue():
                        DialogsInterface.showI18nInfoDialog('squadHavePlayersInBattle', lambda result: None)
                        return True
                    if not slotPlayer.isReady:
                        notReadyCount += 1

            if not fullData.playerInfo.isReady:
                notReadyCount -= 1
            if fullData.stats.occupiedSlotsCount == 1:
                DialogsInterface.showDialog(I18nConfirmDialogMeta('squadHaveNoPlayers'), self._confirmCallback)
                return True
            if notReadyCount > 0:
                if notReadyCount == 1:
                    DialogsInterface.showDialog(I18nConfirmDialogMeta('squadHaveNotReadyPlayer'), self._confirmCallback)
                    return True
                DialogsInterface.showDialog(I18nConfirmDialogMeta('squadHaveNotReadyPlayers'), self._confirmCallback)
                return True
            self._setCreatorReady()
        else:
            self._entity.togglePlayerReadyAction(True)
        return True
    def execute(self, customData):
        if self._functional.isCreator():
            func = self._functional
            fullData = func.getUnitFullData(unitIdx=self._functional.getUnitIdx())
            if fullData is None:
                return {}
            _, _, unitStats, pInfo, slotsIter = fullData
            notReadyCount = 0
            for slot in slotsIter:
                slotPlayer = slot.player
                if slotPlayer:
                    if slotPlayer.isInArena() or slotPlayer.isInPreArena() or pInfo.isInSearch() or pInfo.isInQueue():
                        DialogsInterface.showI18nInfoDialog('squadHavePlayersInBattle', lambda result: None)
                        return True
                    if not slotPlayer.isReady:
                        notReadyCount += 1

            if not pInfo.isReady:
                notReadyCount -= 1
            if unitStats.occupiedSlotsCount == 1:
                DialogsInterface.showDialog(I18nConfirmDialogMeta('squadHaveNoPlayers'), self._setCreatorReady)
                return True
            if notReadyCount > 0:
                if notReadyCount == 1:
                    DialogsInterface.showDialog(I18nConfirmDialogMeta('squadHaveNotReadyPlayer'), self._setCreatorReady)
                    return True
                DialogsInterface.showDialog(I18nConfirmDialogMeta('squadHaveNotReadyPlayers'), self._setCreatorReady)
                return True
            self._setCreatorReady(True)
        else:
            self._functional.togglePlayerReadyAction(True)
        return True
Example #10
0
    def execute(self):
        if self._entity.isCommander():
            func = self._entity
            fullData = func.getUnitFullData(unitMgrID=func.getID())
            notReadyCount = 0
            for slot in fullData.slotsIterator:
                slotPlayer = slot.player
                if slotPlayer:
                    if slotPlayer.isInArena(
                    ) or fullData.playerInfo.isInSearch(
                    ) or fullData.playerInfo.isInQueue():
                        DialogsInterface.showI18nInfoDialog(
                            'squadHavePlayersInBattle', lambda result: None)
                        return True
                    if not slotPlayer.isReady:
                        notReadyCount += 1

            if not fullData.playerInfo.isReady:
                notReadyCount -= 1
            if fullData.stats.occupiedSlotsCount == 1:
                DialogsInterface.showDialog(
                    I18nConfirmDialogMeta('squadHaveNoPlayers'),
                    self._confirmCallback)
                return True
            if notReadyCount > 0:
                if notReadyCount == 1:
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta('squadHaveNotReadyPlayer'),
                        self._confirmCallback)
                    return True
                DialogsInterface.showDialog(
                    I18nConfirmDialogMeta('squadHaveNotReadyPlayers'),
                    self._confirmCallback)
                return True
            if not g_currentVehicle.isLocked(
            ) and not fullData.playerInfo.isReady:
                _, unit = self._entity.getUnit()
                playerVehicles = unit.getVehicles()
                if playerVehicles:
                    commanderLevel = g_currentVehicle.item.level
                    lowerBound, upperBound = self._entity.getSquadLevelBounds()
                    minLevel = max(MIN_VEHICLE_LEVEL,
                                   commanderLevel + lowerBound)
                    maxLevel = min(MAX_VEHICLE_LEVEL,
                                   commanderLevel + upperBound)
                    levelRange = range(minLevel, maxLevel + 1)
                    for _, unitVehicles in playerVehicles.iteritems():
                        for vehicle in unitVehicles:
                            if vehicle.vehLevel not in levelRange:
                                DialogsInterface.showDialog(
                                    I18nConfirmDialogMeta(
                                        'squadHaveNoPlayers'),
                                    self._confirmCallback)
                                return True

            self._setCreatorReady()
        else:
            self._entity.togglePlayerReadyAction(True)
        return True
Example #11
0
 def onDossierReceived(databaseID, _):
     clanID, _ = g_itemsCache.items.getClanInfo(databaseID)
     if clanID != 0:
         shared_events.showClanProfileWindow(clanID)
     else:
         from gui import DialogsInterface
         key = 'clan data is not available'
         DialogsInterface.showI18nInfoDialog(key, lambda result: None, I18nInfoDialogMeta(key, messageCtx={'userName': key}))
Example #12
0
 def onReplayFinished(self):
     if not self.scriptModalWindowsEnabled:
         self.stop()
         return
     if self.__isPlayingPlayList:
         self.stop()
         BigWorld.callback(1.0, self.play)
         return
     DialogsInterface.showI18nInfoDialog('replayStopped', self.stop)
Example #13
0
 def onDossierReceived(databaseID, _):
     clanID, clanInfo = g_itemsCache.items.getClanInfo(databaseID)
     if clanID != 0:
         clanInfo = ClanInfo(*clanInfo)
         shared_events.showClanProfileWindow(clanID, clanInfo.getClanAbbrev())
     else:
         from gui import DialogsInterface
         key = 'clan data is not available'
         DialogsInterface.showI18nInfoDialog(key, lambda result: None, I18nInfoDialogMeta(key, messageCtx={'userName': key}))
Example #14
0
 def onReplayFinished(self):
     if not self.scriptModalWindowsEnabled:
         self.stop()
         return
     if self.__isPlayingPlayList:
         self.stop()
         BigWorld.callback(1.0, self.play)
         return
     DialogsInterface.showI18nInfoDialog('replayStopped', self.stop)
 def bootcampClick(self):
     if self.bootcamp.isInBootcamp():
         if not self.bootcamp.needAwarding():
             self.bootcamp.stopBootcamp(False)
         else:
             self.__doBootcamp(isSkip=True)
     elif BigWorld.player().isLongDisconnectedFromCenter:
         DialogsInterface.showI18nInfoDialog('bootcampCenterUnavailable', lambda result: None)
     else:
         self.__doBootcamp(isSkip=False)
    def execute(self, customData):
        if self._functional.isCreator():
            func = self._functional
            fullData = func.getUnitFullData(
                unitIdx=self._functional.getUnitIdx())
            if fullData is None:
                return {}
            _, _, unitStats, pInfo, slotsIter = fullData
            isAutoFill = func.getRosterType(
            ) == ROSTER_TYPE.FALLOUT_MULTITEAM_ROSTER
            notReadyCount = 0
            for slot in slotsIter:
                slotPlayer = slot.player
                if slotPlayer:
                    if slotPlayer.isInArena() or slotPlayer.isInPreArena(
                    ) or pInfo.isInSearch() or pInfo.isInQueue():
                        DialogsInterface.showI18nInfoDialog(
                            'squadHavePlayersInBattle', lambda result: None)
                        return True
                    if not slotPlayer.isReady:
                        notReadyCount += 1

            if not pInfo.isReady:
                notReadyCount -= 1
            if isAutoFill:
                if notReadyCount == 1:
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta('squadHaveNotReadyPlayerAuto'),
                        self._setCreatorReady)
                    return True
                if unitStats.freeSlotsCount == 1:
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta('squadHaveNoPlayerAuto'),
                        self._setCreatorReady)
                    return True
            else:
                if unitStats.occupiedSlotsCount == 1:
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta('squadHaveNoPlayers'),
                        self._setCreatorReady)
                    return True
                if notReadyCount > 0:
                    if notReadyCount == 1:
                        DialogsInterface.showDialog(
                            I18nConfirmDialogMeta('squadHaveNotReadyPlayer'),
                            self._setCreatorReady)
                        return True
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta('squadHaveNotReadyPlayers'),
                        self._setCreatorReady)
                    return True
            self._setCreatorReady(True)
        else:
            self._functional.togglePlayerReadyAction()
        return True
Example #17
0
 def runBootcamp(self):
     if self.isInBootcamp():
         if not self.needAwarding():
             self.stopBootcamp(inBattle=False)
         else:
             self.__doBootcamp(isSkip=True)
     elif isLongDisconnectedFromCenter():
         DialogsInterface.showI18nInfoDialog('bootcampCenterUnavailable',
                                             lambda result: None)
     else:
         self.__doBootcamp(isSkip=False)
Example #18
0
 def showUserInfo(self, uid, userName):
     (userDossier, _, isHidden,) = yield g_itemsCache.items.requestUserDossier(int(uid))
     if userDossier is None:
         if isHidden:
             key = 'messenger/userInfoHidden'
         else:
             key = 'messenger/userInfoNotAvailable'
         DialogsInterface.showI18nInfoDialog(key, lambda result: None, I18nInfoDialogMeta(key, messageCtx={'userName': userName}))
     else:
         self.fireEvent(events.LoadViewEvent(VIEW_ALIAS.PROFILE_WINDOW, getViewName(VIEW_ALIAS.PROFILE_WINDOW, uid), {'userName': userName,
          'databaseID': int(uid)}), EVENT_BUS_SCOPE.LOBBY)
Example #19
0
def requestProfile(databaseID, userName, successCallback):
    userDossier, _, isHidden = yield g_itemsCache.items.requestUserDossier(databaseID)
    if userDossier is None:
        if isHidden:
            key = 'messenger/userInfoHidden'
        else:
            key = 'messenger/userInfoNotAvailable'
        from gui import DialogsInterface
        DialogsInterface.showI18nInfoDialog(key, lambda result: None, I18nInfoDialogMeta(key, messageCtx={'userName': userName}))
    else:
        successCallback(databaseID, userName)
    return
 def showUserInfo(self, uid, userName):
     userDossier, isHidden = yield g_itemsCache.items.requestUserDossier(int(uid))
     if userDossier is None:
         if isHidden:
             key = 'messenger/userInfoHidden'
         else:
             key = 'messenger/userInfoNotAvailable'
         DialogsInterface.showI18nInfoDialog(key, lambda result: None, I18nInfoDialogMeta(key, messageCtx={'userName': userName}))
     else:
         self.fireEvent(events.ShowWindowEvent(events.ShowWindowEvent.SHOW_PROFILE_WINDOW, {'userName': userName,
          'databaseID': int(uid)}), EVENT_BUS_SCOPE.LOBBY)
     return
Example #21
0
 def onReplayFinished(self):
     if not self.scriptModalWindowsEnabled:
         self.stop()
         return 
     if self.__isPlayingPlayList:
         self.stop()
         BigWorld.callback(1.0, self.play)
         return 
     self.__isMenuShowed = False
     DialogsInterface.showI18nInfoDialog('replayStopped', self.stop)
     self.__isFinished = True
     self.setPlaybackSpeedIdx(0)
Example #22
0
def requestProfile(databaseID, userName, successCallback):
    userDossier, _, isHidden = yield g_itemsCache.items.requestUserDossier(databaseID)
    if userDossier is None:
        if isHidden:
            key = 'messenger/userInfoHidden'
        else:
            key = 'messenger/userInfoNotAvailable'
        from gui import DialogsInterface
        DialogsInterface.showI18nInfoDialog(key, lambda result: None, I18nInfoDialogMeta(key, messageCtx={'userName': userName}))
    else:
        successCallback(databaseID, userName)
    return
Example #23
0
    def execute(self):
        if self._entity.isCommander():
            entity = self._entity
            fullData = entity.getUnitFullData(unitIdx=entity.getUnitIdx())
            isAutoFill = entity.getRosterType(
            ) == ROSTER_TYPE.FALLOUT_MULTITEAM_ROSTER
            notReadyCount = 0
            for slot in fullData.slotsIterator:
                slotPlayer = slot.player
                if slotPlayer:
                    if slotPlayer.isInArena() or slotPlayer.isInPreArena(
                    ) or fullData.playerInfo.isInSearch(
                    ) or fullData.playerInfo.isInQueue():
                        DialogsInterface.showI18nInfoDialog(
                            'squadHavePlayersInBattle', lambda result: None)
                        return True
                    if not slotPlayer.isReady:
                        notReadyCount += 1

            if not fullData.playerInfo.isReady:
                notReadyCount -= 1
            if isAutoFill:
                if notReadyCount == 1:
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta('squadHaveNotReadyPlayerAuto'),
                        self._confirmCallback)
                    return True
                if fullData.stats.freeSlotsCount == 1:
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta('squadHaveNoPlayerAuto'),
                        self._confirmCallback)
                    return True
            else:
                if fullData.stats.occupiedSlotsCount == 1:
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta('squadHaveNoPlayers'),
                        self._confirmCallback)
                    return True
                if notReadyCount > 0:
                    if notReadyCount == 1:
                        DialogsInterface.showDialog(
                            I18nConfirmDialogMeta('squadHaveNotReadyPlayer'),
                            self._confirmCallback)
                        return True
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta('squadHaveNotReadyPlayers'),
                        self._confirmCallback)
                    return True
            self._setCreatorReady()
        else:
            self._entity.togglePlayerReadyAction()
        return True
Example #24
0
 def onReplayFinished(self):
     if not self.scriptModalWindowsEnabled:
         self.stop()
         return
     if self.__isPlayingPlayList:
         self.stop()
         BigWorld.callback(1.0, self.play)
         return
     self.__isMenuShowed = False
     from gui import DialogsInterface
     DialogsInterface.showI18nInfoDialog('replayStopped', self.__setStopDelay)
     self.__isFinished = True
     self.setPlaybackSpeedIdx(0)
Example #25
0
 def showUserInfo(self):
     databaseID = self.databaseID
     userName = self.userName
     userDossier, _, isHidden = yield g_itemsCache.items.requestUserDossier(databaseID)
     if userDossier is None:
         if isHidden:
             key = 'messenger/userInfoHidden'
         else:
             key = 'messenger/userInfoNotAvailable'
         from gui import DialogsInterface
         DialogsInterface.showI18nInfoDialog(key, lambda result: None, I18nInfoDialogMeta(key, messageCtx={'userName': userName}))
     else:
         shared_events.showProfileWindow(databaseID, userName)
     return
    def execute(self, customData):
        if self._functional.isCreator():
            func = self._functional
            fullData = func.getUnitFullData(unitIdx=self._functional.getUnitIdx())
            if fullData is None:
                return {}
            _, _, unitStats, pInfo, slotsIter = fullData
            notReadyCount = 0
            for slot in slotsIter:
                slotPlayer = slot.player
                if slotPlayer:
                    if slotPlayer.isInArena() or slotPlayer.isInPreArena() or pInfo.isInSearch() or pInfo.isInQueue():
                        DialogsInterface.showI18nInfoDialog("squadHavePlayersInBattle", lambda result: None)
                        return True
                    if not slotPlayer.isReady:
                        notReadyCount += 1

            if not pInfo.isReady:
                notReadyCount -= 1
            if unitStats.occupiedSlotsCount == 1:
                DialogsInterface.showDialog(I18nConfirmDialogMeta("squadHaveNoPlayers"), self._setCreatorReady)
                return True
            if notReadyCount > 0:
                if notReadyCount == 1:
                    DialogsInterface.showDialog(I18nConfirmDialogMeta("squadHaveNotReadyPlayer"), self._setCreatorReady)
                    return True
                DialogsInterface.showDialog(I18nConfirmDialogMeta("squadHaveNotReadyPlayers"), self._setCreatorReady)
                return True
            if not g_currentVehicle.isLocked():
                _, unit = self._functional.getUnit()
                playerVehicles = unit.getVehicles()
                if playerVehicles:
                    commanderLevel = g_currentVehicle.item.level
                    lowerBound, upperBound = self._functional.getSquadLevelBounds()
                    minLevel = max(MIN_VEHICLE_LEVEL, commanderLevel + lowerBound)
                    maxLevel = min(MAX_VEHICLE_LEVEL, commanderLevel + upperBound)
                    levelRange = range(minLevel, maxLevel + 1)
                    for _, unitVehicles in playerVehicles.iteritems():
                        for vehicle in unitVehicles:
                            if vehicle.vehLevel not in levelRange:
                                DialogsInterface.showDialog(
                                    I18nConfirmDialogMeta("squadHaveNoPlayers"), self._setCreatorReady
                                )
                                return True

            self._setCreatorReady(True)
        else:
            self._functional.togglePlayerReadyAction(True)
        return True
    def execute(self, customData):
        if self._functional.isCreator():
            func = self._functional
            fullData = func.getUnitFullData(unitIdx=self._functional.getUnitIdx())
            if fullData is None:
                return {}
            _, _, unitStats, pInfo, slotsIter = fullData
            isAutoFill = func.getRosterType() == ROSTER_TYPE.FALLOUT_MULTITEAM_ROSTER
            notReadyCount = 0
            for slot in slotsIter:
                slotPlayer = slot.player
                if slotPlayer:
                    if slotPlayer.isInArena() or slotPlayer.isInPreArena() or pInfo.isInSearch() or pInfo.isInQueue():
                        DialogsInterface.showI18nInfoDialog("squadHavePlayersInBattle", lambda result: None)
                        return True
                    if not slotPlayer.isReady:
                        notReadyCount += 1

            if not pInfo.isReady:
                notReadyCount -= 1
            if isAutoFill:
                if notReadyCount == 1:
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta("squadHaveNotReadyPlayerAuto"), self._setCreatorReady
                    )
                    return True
                if unitStats.freeSlotsCount == 1:
                    DialogsInterface.showDialog(I18nConfirmDialogMeta("squadHaveNoPlayerAuto"), self._setCreatorReady)
                    return True
            else:
                if unitStats.occupiedSlotsCount == 1:
                    DialogsInterface.showDialog(I18nConfirmDialogMeta("squadHaveNoPlayers"), self._setCreatorReady)
                    return True
                if notReadyCount > 0:
                    if notReadyCount == 1:
                        DialogsInterface.showDialog(
                            I18nConfirmDialogMeta("squadHaveNotReadyPlayer"), self._setCreatorReady
                        )
                        return True
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta("squadHaveNotReadyPlayers"), self._setCreatorReady
                    )
                    return True
            self._setCreatorReady(True)
        else:
            self._functional.togglePlayerReadyAction()
        return True
Example #28
0
    def execute(self, customData):
        if self._functional.isCreator():
            fullData = self._functional.getUnitFullData(
                unitIdx=self._functional.getUnitIdx())
            if fullData is None:
                return {}
            _, _, _, pInfo, slotsIter = fullData
            playerIsIdle = False
            playersCount = 0
            notReadyCount = 0
            for slot in slotsIter:
                slotPlayer = slot.player
                if slotPlayer:
                    if not playerIsIdle:
                        playerIsIdle = slotPlayer.isInArena(
                        ) or slotPlayer.isInPreArena() or pInfo.isInSearch(
                        ) or pInfo.isInQueue()
                    playersCount += 1
                    if not slotPlayer.isReady:
                        notReadyCount += 1

            if playerIsIdle:
                DialogsInterface.showI18nInfoDialog('squadHavePlayersInBattle',
                                                    lambda result: None)
                return True
            if playersCount == 1:
                DialogsInterface.showDialog(
                    I18nConfirmDialogMeta('squadHaveNoPlayers'),
                    self.__setCreatorReady)
                return True
            if not pInfo.isReady:
                notReadyCount -= 1
            if notReadyCount == 1:
                DialogsInterface.showDialog(
                    I18nConfirmDialogMeta('squadHaveNotReadyPlayer'),
                    self.__setCreatorReady)
                return True
            if notReadyCount > 1:
                DialogsInterface.showDialog(
                    I18nConfirmDialogMeta('squadHaveNotReadyPlayers'),
                    self.__setCreatorReady)
                return True
            self.__setCreatorReady(True)
        else:
            self._functional.togglePlayerReadyAction(True)
        return True
Example #29
0
 def doAction(self, action = None):
     if self.isCreator():
         if self.getRosterKey() != PREBATTLE_ROSTER.ASSIGNED_IN_TEAM1:
             DialogsInterface.showI18nInfoDialog('teamDoesNotHaveCommander', lambda result: None)
             return True
         stats = self.getPlayersStateStats()
         creatorWeight = 1 if not self.getPlayerInfo().isReady() else 0
         readyCount = stats.playersCount - stats.notReadyCount
         if readyCount < stats.limitMaxCount - creatorWeight:
             DialogsInterface.showDialog(I18nConfirmDialogMeta('teamHaveNotReadyPlayers', messageCtx={'readyCount': readyCount,
              'playersCount': stats.playersCount}), self.__setCreatorReady)
             return True
         self.__setCreatorReady(True)
     elif self.getPlayerInfo().isReady():
         self.setPlayerState(prb_ctx.SetPlayerStateCtx(False, waitingID='prebattle/player_not_ready'))
     else:
         self.setPlayerState(prb_ctx.SetPlayerStateCtx(True, waitingID='prebattle/player_ready'))
     return True
 def showUserInfo(self, uid, userName):
     userDossier, isHidden = yield g_itemsCache.items.requestUserDossier(
         int(uid))
     if userDossier is None:
         if isHidden:
             key = 'messenger/userInfoHidden'
         else:
             key = 'messenger/userInfoNotAvailable'
         DialogsInterface.showI18nInfoDialog(
             key, lambda result: None,
             I18nInfoDialogMeta(key, messageCtx={'userName': userName}))
     else:
         self.fireEvent(
             events.ShowWindowEvent(
                 events.ShowWindowEvent.SHOW_PROFILE_WINDOW, {
                     'userName': userName,
                     'databaseID': int(uid)
                 }), EVENT_BUS_SCOPE.LOBBY)
     return
Example #31
0
 def doAction(self, action = None, dispatcher = None):
     if self.isCreator():
         stats = self.getPlayersStateStats()
         if stats.haveInBattle:
             DialogsInterface.showI18nInfoDialog('squadHavePlayersInBattle', lambda result: None)
             return True
         notReadyCount = stats.notReadyCount
         if not self.getPlayerInfo().isReady():
             notReadyCount -= 1
         if notReadyCount > 0:
             DialogsInterface.showDialog(I18nConfirmDialogMeta('squadHaveNotReadyPlayers', messageCtx={'notReadyCount': notReadyCount,
              'playersCount': stats.playersCount}), self.__setCreatorReady)
             return True
         self.__setCreatorReady(True)
     elif self.getPlayerInfo().isReady():
         self.setPlayerState(context.SetPlayerStateCtx(False, waitingID='prebattle/player_not_ready'))
     else:
         self.setPlayerState(context.SetPlayerStateCtx(True, waitingID='prebattle/player_ready'))
     return True
def showDisabledDialog():
    DialogsInterface.showI18nInfoDialog('hofDisabled', lambda result: None)
Example #33
0
 def __showElenPopupDlg(self):
     yield DialogsInterface.showI18nInfoDialog('elenDisabled')
     g_eventBus.handleEvent(g_entitiesFactories.makeLoadEvent(
         VIEW_ALIAS.LOBBY_HANGAR),
                            scope=EVENT_BUS_SCOPE.LOBBY)
Example #34
0
    def applyCustomization(self, sections):
        if g_currentVehicle.isLocked():
            SystemMessages.pushI18nMessage(
                SYSTEM_MESSAGES.CUSTOMIZATION_VEHICLE_LOCKED,
                type=SystemMessages.SM_TYPE.Error)
            yield lambda callback=None: callback
        if g_currentVehicle.isBroken():
            SystemMessages.pushI18nMessage(
                SYSTEM_MESSAGES.customization_vehicle(
                    g_currentVehicle.item.getState()),
                type=SystemMessages.SM_TYPE.Error)
            yield lambda callback=None: callback
        notSelected = []
        selected = []
        remove = []
        selectedNames = []
        totalGold = 0
        totalCredits = 0
        newItemsByType = defaultdict(list)
        for section in sections:
            interface = self.__interfaces.get(section.sectionName)
            if interface is not None:
                newItems = interface.getNewItems()
                if newItems is not None:
                    self.__updateNewItemsByType(newItemsByType, newItems,
                                                interface._type)

        for section in sections:
            interface = self.__interfaces.get(section.sectionName)
            if interface is not None:
                newItems = interface.getNewItems()
                if newItems is not None:
                    removeStr = None
                    hasMatches = self.__hasNewItemsDuplicates(
                        newItemsByType, newItems, interface._type)
                    if not hasMatches:
                        costValue = interface.getSelectedItemCost()
                        if isinstance(costValue, list):
                            for price in costValue:
                                cost = price.get('cost')
                                isGold = price.get('isGold')
                                if cost > 0:
                                    if isGold and section.isGold:
                                        totalGold += cost
                                    elif not isGold and not section.isGold:
                                        totalCredits += cost

                        else:
                            cost, isGold = costValue
                            if cost > 0:
                                if isGold:
                                    totalGold += cost
                                else:
                                    totalCredits += cost
                    if section.sectionName not in selectedNames:
                        selected.append(
                            i18n.makeString(
                                '#menu:customization/change/{0:>s}'.format(
                                    section.sectionName)))
                        selectedNames.append(section.sectionName)
                        removeStr = interface.getCurrentItemRemoveStr()
                    if removeStr is not None:
                        remove.extend(removeStr)
                else:
                    notSelected.append(
                        i18n.makeString(
                            '#menu:customization/items/{0:>s}'.format(
                                section.sectionName)))
            else:
                LOG_ERROR('Section not found', section.sectionName)

        if len(notSelected) > 0:
            DialogsInterface.showI18nInfoDialog(
                'customization/selectNewItems', lambda success: None,
                I18nInfoDialogMeta(
                    'customization/selectNewItems',
                    messageCtx={'items': ', '.join(notSelected)}))
            yield lambda callback=None: callback
        if totalGold or totalCredits:
            titleKey = DIALOGS.CUSTOMIZATION_CHANGECONFIRMATION_BUY
        else:
            titleKey = DIALOGS.CUSTOMIZATION_CHANGECONFIRMATION_CHANGE
        isConfirmed = yield DialogsInterface.showDialog(
            I18nConfirmDialogMeta(
                'customization/changeConfirmation',
                titleCtx={'action': i18n.makeString(titleKey)},
                messageCtx={
                    'selected': ', '.join(selected),
                    'remove': '\n'.join(remove)
                }))
        if isConfirmed:
            creditsNotEnough = totalCredits > self.__credits
            goldNotEnough = totalGold > self.__gold
            if creditsNotEnough or goldNotEnough:
                if creditsNotEnough and goldNotEnough:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_CREDITS_AND_GOLD_NOT_ENOUGH
                elif goldNotEnough:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_GOLD_NOT_ENOUGH
                else:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_CREDITS_NOT_ENOUGH
                SystemMessages.pushI18nMessage(
                    key, type=SystemMessages.SM_TYPE.Error)
                yield lambda callback=None: callback
            self.__returnHangar = True
            vehInvID = g_currentVehicle.invID
            self.__steps = 0
            self.__messages = []
            self.flashObject.applyButton.disabled = True
            if len(sections) > 0:
                Waiting.show('customizationApply')
                self.__lockUpdate = True
            selectedNames = []
            for section in sections:
                interface = self.__interfaces.get(section.sectionName)
                if interface is not None:
                    newItems = interface.getNewItems()
                    if newItems is not None:
                        hasMatches = self.__hasNewItemsDuplicates(
                            newItemsByType, newItems, interface._type)
                        self.__steps += interface.getSelectedItemsCount(
                            section.isGold)
                        if section.sectionName not in selectedNames:
                            interface.change(vehInvID, section, hasMatches)
                            selectedNames.append(section.sectionName)
                else:
                    LOG_ERROR('Change operation, section not found', section)
                    self.__steps -= 1

            if not self.__steps:
                self.__onServerResponsesReceived()
        return
Example #35
0
 def _showDialog(self, key):
     """
     Show a modal dialog with the message in the key provided.
     :param key: key for the message
     """
     DialogsInterface.showI18nInfoDialog(key, lambda result: None)
Example #36
0
 def __showDialog(self, key):
     DialogsInterface.showI18nInfoDialog(key, lambda result: None)
Example #37
0
    def applyCustomization(self, sections):
        if g_currentVehicle.isLocked():
            SystemMessages.pushI18nMessage(
                SYSTEM_MESSAGES.CUSTOMIZATION_VEHICLE_LOCKED,
                type=SystemMessages.SM_TYPE.Error)
            yield lambda callback=None: callback
        if g_currentVehicle.isBroken():
            SystemMessages.pushI18nMessage(
                SYSTEM_MESSAGES.customization_vehicle(
                    g_currentVehicle.item.getState()),
                type=SystemMessages.SM_TYPE.Error)
            yield lambda callback=None: callback
        notSelected = []
        selected = []
        remove = []
        selectedNames = []
        totalGold = 0
        totalCredits = 0
        for section in sections:
            interface = self.__interfaces.get(section.sectionName)
            if interface is not None:
                if interface.isNewItemSelected():
                    costValue = interface.getSelectedItemCost()
                    if type(costValue) is list:
                        for price in costValue:
                            cost = price.get('cost')
                            isGold = price.get('isGold')
                            if cost > 0:
                                if isGold and section.isGold:
                                    totalGold += cost
                                elif not isGold and not section.isGold:
                                    totalCredits += cost

                    else:
                        cost, isGold = costValue
                        if cost > 0:
                            if isGold:
                                totalGold += cost
                            else:
                                totalCredits += cost
                    if section.sectionName not in selectedNames:
                        selected.append(
                            i18n.makeString(
                                '#menu:customization/change/{0:>s}'.format(
                                    section.sectionName)))
                        selectedNames.append(section.sectionName)
                    if interface.isCurrentItemRemove():
                        remove.append(
                            gui.makeHtmlString(
                                'html_templates:lobby/customization',
                                'remove-{0:>s}'.format(section.sectionName)))
                else:
                    notSelected.append(
                        i18n.makeString(
                            '#menu:customization/items/{0:>s}'.format(
                                section.sectionName)))
            else:
                LOG_ERROR('Section not found', section.sectionName)

        if len(notSelected) > 0:
            DialogsInterface.showI18nInfoDialog(
                'customization/selectNewItems', lambda success: None,
                I18nInfoDialogMeta(
                    'customization/selectNewItems',
                    messageCtx={'items': ', '.join(notSelected)}))
            yield lambda callback=None: callback
        isConfirmed = yield DialogsInterface.showDialog(
            I18nConfirmDialogMeta('customization/changeConfirmation',
                                  messageCtx={
                                      'selected': ', '.join(selected),
                                      'remove': '\n'.join(remove)
                                  }))
        if isConfirmed:
            creditsNotEnough = totalCredits > self.__credits
            goldNotEnough = totalGold > self.__gold
            if creditsNotEnough or goldNotEnough:
                if creditsNotEnough and goldNotEnough:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_CREDITS_AND_GOLD_NOT_ENOUGH
                elif goldNotEnough:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_GOLD_NOT_ENOUGH
                else:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_CREDITS_NOT_ENOUGH
                SystemMessages.pushI18nMessage(
                    key, type=SystemMessages.SM_TYPE.Error)
                yield lambda callback=None: callback
            self.__returnHangar = True
            vehInvID = g_currentVehicle.invID
            self.__steps = 0
            self.__messages = []
            self.flashObject.applyButton.disabled = True
            if len(sections) > 0:
                Waiting.show('customizationApply')
                self.__lockUpdate = True
            selectedNames = []
            for section in sections:
                interface = self.__interfaces.get(section.sectionName)
                if interface is not None:
                    self.__steps += interface.getSelectedItemsCount(
                        section.isGold)
                    if section.sectionName not in selectedNames:
                        interface.change(vehInvID, section)
                        selectedNames.append(section.sectionName)
                else:
                    LOG_ERROR('Change operation, section not found', section)
                    self.__steps -= 1

            if not self.__steps:
                self.__onServerResponsesReceived()
        return
Example #38
0
 def __showDialog(self, key):
     DialogsInterface.showI18nInfoDialog(key, lambda result: None)
Example #39
0
def showDisabledDialog():
    DialogsInterface.showI18nInfoDialog('hofDisabled', None)
    return
 def __checkWgcAvailable(self):
     if not self._loginManager.wgcAvailable:
         DialogsInterface.showI18nInfoDialog('steamStartNeeded',
                                             self.__onDialogCallback)
         return False
     return True
Example #41
0
def showFortDisabledDialog():
    yield DialogsInterface.showI18nInfoDialog('fortDisabled')
    def applyCustomization(self, sections):
        if g_currentVehicle.isLocked():
            SystemMessages.pushI18nMessage(SYSTEM_MESSAGES.CUSTOMIZATION_VEHICLE_LOCKED, type=SystemMessages.SM_TYPE.Error)
            yield lambda callback = None: callback
        if g_currentVehicle.isBroken():
            SystemMessages.pushI18nMessage(SYSTEM_MESSAGES.customization_vehicle(g_currentVehicle.item.getState()), type=SystemMessages.SM_TYPE.Error)
            yield lambda callback = None: callback
        notSelected = []
        selected = []
        remove = []
        selectedNames = []
        totalGold = 0
        totalCredits = 0
        for section in sections:
            interface = self.__interfaces.get(section.sectionName)
            if interface is not None:
                if interface.isNewItemSelected():
                    costValue = interface.getSelectedItemCost()
                    if type(costValue) is list:
                        for price in costValue:
                            cost = price.get('cost')
                            isGold = price.get('isGold')
                            if cost > 0:
                                if isGold and section.isGold:
                                    totalGold += cost
                                elif not isGold and not section.isGold:
                                    totalCredits += cost

                    else:
                        cost, isGold = costValue
                        if cost > 0:
                            if isGold:
                                totalGold += cost
                            else:
                                totalCredits += cost
                    if section.sectionName not in selectedNames:
                        selected.append(i18n.makeString('#menu:customization/change/{0:>s}'.format(section.sectionName)))
                        selectedNames.append(section.sectionName)
                    if interface.isCurrentItemRemove():
                        remove.append(gui.makeHtmlString('html_templates:lobby/customization', 'remove-{0:>s}'.format(section.sectionName)))
                else:
                    notSelected.append(i18n.makeString('#menu:customization/items/{0:>s}'.format(section.sectionName)))
            else:
                LOG_ERROR('Section not found', section.sectionName)

        if len(notSelected) > 0:
            DialogsInterface.showI18nInfoDialog('customization/selectNewItems', lambda success: None, I18nInfoDialogMeta('customization/selectNewItems', messageCtx={'items': ', '.join(notSelected)}))
            yield lambda callback = None: callback
        isConfirmed = yield DialogsInterface.showDialog(I18nConfirmDialogMeta('customization/changeConfirmation', messageCtx={'selected': ', '.join(selected),
         'remove': '\n'.join(remove)}))
        if isConfirmed:
            creditsNotEnough = totalCredits > self.__credits
            goldNotEnough = totalGold > self.__gold
            if creditsNotEnough or goldNotEnough:
                if creditsNotEnough and goldNotEnough:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_CREDITS_AND_GOLD_NOT_ENOUGH
                elif goldNotEnough:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_GOLD_NOT_ENOUGH
                else:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_CREDITS_NOT_ENOUGH
                SystemMessages.pushI18nMessage(key, type=SystemMessages.SM_TYPE.Error)
                yield lambda callback = None: callback
            self.__returnHangar = True
            vehInvID = g_currentVehicle.invID
            self.__steps = 0
            self.__messages = []
            self.flashObject.applyButton.disabled = True
            if len(sections) > 0:
                Waiting.show('customizationApply')
                self.__lockUpdate = True
            selectedNames = []
            for section in sections:
                interface = self.__interfaces.get(section.sectionName)
                if interface is not None:
                    self.__steps += interface.getSelectedItemsCount(section.isGold)
                    if section.sectionName not in selectedNames:
                        interface.change(vehInvID, section)
                        selectedNames.append(section.sectionName)
                else:
                    LOG_ERROR('Change operation, section not found', section)
                    self.__steps -= 1

            if not self.__steps:
                self.__onServerResponsesReceived()
        return
Example #43
0
 def _showDialog(self, key):
     """
     Show a modal dialog with the message in the key provided.
     :param key: key for the message
     """
     DialogsInterface.showI18nInfoDialog(key, lambda result: None)
    def applyCustomization(self, sections):
        if g_currentVehicle.isLocked():
            SystemMessages.pushI18nMessage(SYSTEM_MESSAGES.CUSTOMIZATION_VEHICLE_LOCKED, type=SystemMessages.SM_TYPE.Error)
            yield lambda callback = None: callback
        if g_currentVehicle.isBroken():
            SystemMessages.pushI18nMessage(SYSTEM_MESSAGES.customization_vehicle(g_currentVehicle.item.getState()), type=SystemMessages.SM_TYPE.Error)
            yield lambda callback = None: callback
        notSelected = []
        selected = []
        remove = []
        selectedNames = []
        totalGold = 0
        totalCredits = 0
        newItemsByType = defaultdict(list)
        for section in sections:
            interface = self.__interfaces.get(section.sectionName)
            if interface is not None:
                newItems = interface.getNewItems()
                if newItems is not None:
                    self.__updateNewItemsByType(newItemsByType, newItems, interface._type)

        for section in sections:
            interface = self.__interfaces.get(section.sectionName)
            if interface is not None:
                newItems = interface.getNewItems()
                if newItems is not None:
                    removeStr = None
                    hasMatches = self.__hasNewItemsDuplicates(newItemsByType, newItems, interface._type)
                    if not hasMatches:
                        costValue = interface.getSelectedItemCost()
                        if isinstance(costValue, list):
                            for price in costValue:
                                cost = price.get('cost')
                                isGold = price.get('isGold')
                                if cost > 0:
                                    if isGold and section.isGold:
                                        totalGold += cost
                                    elif not isGold and not section.isGold:
                                        totalCredits += cost

                        else:
                            cost, isGold = costValue
                            if cost > 0:
                                if isGold:
                                    totalGold += cost
                                else:
                                    totalCredits += cost
                    if section.sectionName not in selectedNames:
                        selected.append(i18n.makeString('#menu:customization/change/{0:>s}'.format(section.sectionName)))
                        selectedNames.append(section.sectionName)
                        removeStr = interface.getCurrentItemRemoveStr()
                    if removeStr is not None:
                        remove.extend(removeStr)
                else:
                    notSelected.append(i18n.makeString('#menu:customization/items/{0:>s}'.format(section.sectionName)))
            else:
                LOG_ERROR('Section not found', section.sectionName)

        if len(notSelected) > 0:
            DialogsInterface.showI18nInfoDialog('customization/selectNewItems', lambda success: None, I18nInfoDialogMeta('customization/selectNewItems', messageCtx={'items': ', '.join(notSelected)}))
            yield lambda callback = None: callback
        if totalGold or totalCredits:
            titleKey = DIALOGS.CUSTOMIZATION_CHANGECONFIRMATION_BUY
        else:
            titleKey = DIALOGS.CUSTOMIZATION_CHANGECONFIRMATION_CHANGE
        isConfirmed = yield DialogsInterface.showDialog(I18nConfirmDialogMeta('customization/changeConfirmation', titleCtx={'action': i18n.makeString(titleKey)}, messageCtx={'selected': ', '.join(selected),
         'remove': '\n'.join(remove)}))
        if isConfirmed:
            creditsNotEnough = totalCredits > self.__credits
            goldNotEnough = totalGold > self.__gold
            if creditsNotEnough or goldNotEnough:
                if creditsNotEnough and goldNotEnough:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_CREDITS_AND_GOLD_NOT_ENOUGH
                elif goldNotEnough:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_GOLD_NOT_ENOUGH
                else:
                    key = SYSTEM_MESSAGES.CUSTOMIZATION_CREDITS_NOT_ENOUGH
                SystemMessages.pushI18nMessage(key, type=SystemMessages.SM_TYPE.Error)
                yield lambda callback = None: callback
            self.__returnHangar = True
            vehInvID = g_currentVehicle.invID
            self.__steps = 0
            self.__messages = []
            self.flashObject.applyButton.disabled = True
            if len(sections) > 0:
                Waiting.show('customizationApply')
                self.__lockUpdate = True
            selectedNames = []
            for section in sections:
                interface = self.__interfaces.get(section.sectionName)
                if interface is not None:
                    newItems = interface.getNewItems()
                    if newItems is not None:
                        hasMatches = self.__hasNewItemsDuplicates(newItemsByType, newItems, interface._type)
                        self.__steps += interface.getSelectedItemsCount(section.isGold)
                        if section.sectionName not in selectedNames:
                            interface.change(vehInvID, section, hasMatches)
                            selectedNames.append(section.sectionName)
                else:
                    LOG_ERROR('Change operation, section not found', section)
                    self.__steps -= 1

            if not self.__steps:
                self.__onServerResponsesReceived()
        return
Example #45
0
def showFortDisabledDialog():
    yield DialogsInterface.showI18nInfoDialog('fortDisabled')
def showDisabledDialog():
    DialogsInterface.showI18nInfoDialog('ingameShopDisabled', None)
    return
 def __showPopupDlg(self):
     yield DialogsInterface.showI18nInfoDialog('fortDisabled')
    def execute(self, customData):
        if self._functional.isCreator():
            func = self._functional
            fullData = func.getUnitFullData(
                unitIdx=self._functional.getUnitIdx())
            if fullData is None:
                return {}
            _, _, unitStats, pInfo, slotsIter = fullData
            notReadyCount = 0
            for slot in slotsIter:
                slotPlayer = slot.player
                if slotPlayer:
                    if slotPlayer.isInArena() or slotPlayer.isInPreArena(
                    ) or pInfo.isInSearch() or pInfo.isInQueue():
                        DialogsInterface.showI18nInfoDialog(
                            'squadHavePlayersInBattle', lambda result: None)
                        return True
                    if not slotPlayer.isReady:
                        notReadyCount += 1

            if not pInfo.isReady:
                notReadyCount -= 1
            if unitStats.occupiedSlotsCount == 1:
                DialogsInterface.showDialog(
                    I18nConfirmDialogMeta('squadHaveNoPlayers'),
                    self._setCreatorReady)
                return True
            if notReadyCount > 0:
                if notReadyCount == 1:
                    DialogsInterface.showDialog(
                        I18nConfirmDialogMeta('squadHaveNotReadyPlayer'),
                        self._setCreatorReady)
                    return True
                DialogsInterface.showDialog(
                    I18nConfirmDialogMeta('squadHaveNotReadyPlayers'),
                    self._setCreatorReady)
                return True
            if not g_currentVehicle.isLocked():
                _, unit = self._functional.getUnit()
                playerVehicles = unit.getVehicles()
                if playerVehicles:
                    commanderLevel = g_currentVehicle.item.level
                    lowerBound, upperBound = self._functional.getSquadLevelBounds(
                    )
                    minLevel = max(MIN_VEHICLE_LEVEL,
                                   commanderLevel + lowerBound)
                    maxLevel = min(MAX_VEHICLE_LEVEL,
                                   commanderLevel + upperBound)
                    levelRange = range(minLevel, maxLevel + 1)
                    for _, unitVehicles in playerVehicles.iteritems():
                        for vehicle in unitVehicles:
                            if vehicle.vehLevel not in levelRange:
                                DialogsInterface.showDialog(
                                    I18nConfirmDialogMeta(
                                        'squadHaveNoPlayers'),
                                    self._setCreatorReady)
                                return True

            self._setCreatorReady(True)
        else:
            self._functional.togglePlayerReadyAction(True)
        return True