def _populate(self):
     selectorUtils.setBattleTypeAsKnown(SELECTOR_BATTLE_TYPES.SORTIE)
     self.addListener(events.HideWindowEvent.HIDE_UNIT_WINDOW, self.__handleUnitWindowHide, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(events.RenameWindowEvent.RENAME_WINDOW, self.__handleWindowRename, scope=EVENT_BUS_SCOPE.LOBBY)
     super(StrongholdBattleRoomWindow, self)._populate()
     self.prbEntity.initEvents(self)
     g_eventDispatcher.hideUnitProgressInCarousel(self.getPrbType())
 def _doSelect(self, dispatcher):
     if self.__funRandomCtrl.getCurrentSeason(
     ) is None and self.__funRandomCtrl.getNextSeason() is not None:
         event_dispatcher.showFunRandomInfoPage()
     elif self.__funRandomCtrl.isAvailable():
         isSuccess = yield dispatcher.doSelectAction(PrbAction(self._data))
         if isSuccess:
             selectorUtils.setBattleTypeAsKnown(self._selectorType)
     return
예제 #3
0
 def select(self):
     if not self.rankedController.hasSuitableVehicles():
         g_eventDispatcher.loadRankedUnreachable()
     else:
         if self.rankedController.isAvailable():
             super(_RankedItem, self).select()
         elif self.__hasPastSeason:
             self.rankedController.openWebLeaguePage()
         selectorUtils.setBattleTypeAsKnown(self._selectorType)
 def _doSelect(self, dispatcher):
     if self.__eventProgression.getCurrentSeason(
     ) is not None or self.__eventProgression.getNextSeason() is not None:
         isSuccess = yield dispatcher.doSelectAction(PrbAction(self._data))
         if isSuccess and self._isNew:
             selectorUtils.setBattleTypeAsKnown(self._selectorType)
         else:
             return
     self.__eventProgression.openURL()
     return
예제 #5
0
 def __rememberGameMode(self):
     currentCycleID = self.getCurrentCycleID()
     rememberedCycleID = AccountSettings.getSettings(
         FUN_RANDOM_LAST_CYCLE_ID)
     if currentCycleID is not None and currentCycleID != rememberedCycleID:
         AccountSettings.setSettings(FUN_RANDOM_LAST_CYCLE_ID,
                                     currentCycleID)
         SelectorBattleTypesUtils.setBattleTypeAsUnknown(
             SELECTOR_BATTLE_TYPES.FUN_RANDOM)
     return
 def __init__(self, ctx = None):
     super(HistoricalBattlesListWindow, self).__init__()
     self.selectedBattleID = self.preQueueFunctional.getSetting(PREQUEUE_SETTING_NAME.BATTLE_ID, -1)
     defaultVehicleID = -1
     if g_currentVehicle.isPresent():
         defaultVehicleID = g_currentVehicle.item.intCD
     self.selectedVehicleID = defaultVehicleID
     self.priceIndex, _ = self.preQueueFunctional.getSelectedPrice(self.selectedBattleID, self.selectedVehicleID)
     self.startCooldownCBID = None
     self.cooldownUpdateCBID = None
     selectorUtils.setBattleTypeAsKnown(SELECTOR_BATTLE_TYPES.HISTORICAL)
예제 #7
0
 def __onClose(self):
     self.destroyWindow()
     if not SelectorBattleTypesUtils.isKnownBattleType(SELECTOR_BATTLE_TYPES.MAPBOX):
         SelectorBattleTypesUtils.setBattleTypeAsKnown(SELECTOR_BATTLE_TYPES.MAPBOX)
     if self.__closeCallback is not None:
         self.__closeCallback()
     elif not self.__mapboxCtrl.isActive():
         showModeSelectorWindow(False)
     else:
         showMissionsMapboxProgression()
     return
 def __init__(self, ctx = None):
     super(HistoricalBattlesListWindow, self).__init__()
     self.selectedBattleID = self.preQueueFunctional.getSetting(PREQUEUE_SETTING_NAME.BATTLE_ID, -1)
     defaultVehicleID = -1
     if g_currentVehicle.isPresent():
         defaultVehicleID = g_currentVehicle.item.intCD
     self.selectedVehicleID = defaultVehicleID
     self.priceIndex, _ = self.preQueueFunctional.getSelectedPrice(self.selectedBattleID, self.selectedVehicleID)
     self.startCooldownCBID = None
     self.cooldownUpdateCBID = None
     selectorUtils.setBattleTypeAsKnown(SELECTOR_BATTLE_TYPES.HISTORICAL)
     return
예제 #9
0
 def _populate(self):
     super(FortBattleRoomWindow, self)._populate()
     from gui.shared.utils import SelectorBattleTypesUtils as selectorUtils
     selectorUtils.setBattleTypeAsKnown(SELECTOR_BATTLE_TYPES.SORTIE)
     self.addListener(events.HideWindowEvent.HIDE_UNIT_WINDOW, self.__handleUnitWindowHide, scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(FortEvent.CHOICE_DIVISION, self.__onLoadStart, scope=EVENT_BUS_SCOPE.LOBBY)
     unitMgrID = self.unitFunctional.getID()
     if unitMgrID > 0:
         self.__loadRoomView()
     else:
         self.__initIntroView()
     self.unitFunctional.initEvents(self)
     g_eventDispatcher.hideUnitProgressInCarousel(PREBATTLE_TYPE.SORTIE)
예제 #10
0
 def _populate(self):
     super(FortBattleRoomWindow, self)._populate()
     from gui.shared.utils import SelectorBattleTypesUtils as selectorUtils
     selectorUtils.setBattleTypeAsKnown(SELECTOR_BATTLE_TYPES.SORTIE)
     self.addListener(events.HideWindowEvent.HIDE_UNIT_WINDOW,
                      self.__handleUnitWindowHide,
                      scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(FortEvent.CHOICE_DIVISION,
                      self.__onDivisionSet,
                      scope=EVENT_BUS_SCOPE.LOBBY)
     self.prbEntity.initEvents(self)
     g_eventDispatcher.hideUnitProgressInCarousel(self.getPrbType())
     self.startFortListening()
 def select(self):
     if self.rankedController.isAvailable():
         super(_RankedItem, self).select()
     elif self.__hasPastSeason:
         ctx = {
             'selectedItemID': RANKEDBATTLES_CONSTS.RANKED_BATTLES_RANKS_ID
         }
         if self.rankedController.isYearLBEnabled(
         ) and self.rankedController.isYearGap():
             ctx = {
                 'selectedItemID':
                 RANKEDBATTLES_CONSTS.RANKED_BATTLES_YEAR_RATING_ID
             }
         self.rankedController.showRankedBattlePage(ctx)
     selectorUtils.setBattleTypeAsKnown(self._selectorType)
 def _doSelect(self, dispatcher):
     currentSeason = self.__epicController.getCurrentSeason()
     isEventActive = False
     if currentSeason is not None:
         isActiveCycle = self.__epicController.getCurrentCycleInfo()[1]
         nextCycle = currentSeason.getNextByTimeCycle(
             time_utils.getCurrentLocalServerTimestamp())
         if isActiveCycle or nextCycle:
             isEventActive = True
             yield dispatcher.doSelectAction(PrbAction(self._data))
     if self._isNew or not isEventActive:
         self.__epicController.openURL()
         if self._isNew:
             selectorUtils.setBattleTypeAsKnown(self._selectorType)
     return
예제 #13
0
 def update(self, state):
     if self._selectorType is not None:
         self._isNew = not selectorUtils.isKnownBattleType(
             self._selectorType)
     if not self._isLocked:
         self._update(state)
     return
예제 #14
0
 def _doSelect(self, dispatcher):
     currentSeason = self.__battleRoyaleController.getCurrentSeason()
     if currentSeason is not None:
         isActiveCycle = self.__battleRoyaleController.getCurrentCycleInfo(
         )[1]
         nextCycle = currentSeason.getNextByTimeCycle(
             time_utils.getCurrentLocalServerTimestamp())
         if isActiveCycle or nextCycle:
             self.__battleRoyaleController.setDefaultHangarEntryPoint()
             isSuccess = yield dispatcher.doSelectAction(
                 PrbAction(self._data))
             if isSuccess and self._isNew:
                 selectorUtils.setBattleTypeAsKnown(self._selectorType)
             else:
                 return
     self.__battleRoyaleController.openURL()
     return
예제 #15
0
 def _populate(self):
     super(FortBattleRoomWindow, self)._populate()
     from gui.shared.utils import SelectorBattleTypesUtils as selectorUtils
     selectorUtils.setBattleTypeAsKnown(SELECTOR_BATTLE_TYPES.SORTIE)
     self.addListener(events.HideWindowEvent.HIDE_UNIT_WINDOW,
                      self.__handleUnitWindowHide,
                      scope=EVENT_BUS_SCOPE.LOBBY)
     self.addListener(FortEvent.CHOICE_DIVISION,
                      self.__onLoadStart,
                      scope=EVENT_BUS_SCOPE.LOBBY)
     unitMgrID = self.unitFunctional.getID()
     if unitMgrID > 0:
         self.__loadRoomView()
     else:
         self.__initIntroView()
     self.unitFunctional.initEvents(self)
     g_eventDispatcher.hideUnitProgressInCarousel(PREBATTLE_TYPE.SORTIE)
     self.startFortListening()
 def _update(self, state):
     self._isVisible = any((self.__epicController.getCurrentSeason(),
                            self.__epicController.getNextSeason()))
     self._isDisabled = not self.__epicController.isEnabled(
     ) or state.hasLockedState
     self._isSelected = state.isQueueSelected(QUEUE_TYPE.EPIC)
     if self._selectorType is not None:
         self._isNew = not selectorUtils.isKnownBattleType(
             self._selectorType)
     return
 def updateState(self):
     self._label = backport.text(self.__eventProgression.selectorLabelTxtId)
     self._data = self.__eventProgression.selectorData
     self._selectorType = self.__eventProgression.selectorType
     self.__queueType = self.__eventProgression.selectorQueueType
     self._isVisible = False
     if self.isAvailable() or self.__eventProgression.isFrozen():
         self._isVisible = any((self.__eventProgression.getCurrentSeason(),
                                self.__eventProgression.getNextSeason()))
     if self._selectorType is not None:
         self._isNew = not selectorUtils.isKnownBattleType(
             self._selectorType)
     self._isDisabled = not self.__eventProgression.modeIsEnabled()
     return
 def __onClick(self):
     self.__funRandomCtrl.selectFunRandomBattle()
     selectorUtils.setBattleTypeAsKnown(SELECTOR_BATTLE_TYPES.FUN_RANDOM)
 def __onClick(self):
     self.__rankedController.doActionOnEntryPointClick()
     selectorUtils.setBattleTypeAsKnown(SELECTOR_BATTLE_TYPES.RANKED)
예제 #20
0
 def __init__(self, _ = None):
     super(CyberSportMainWindow, self).__init__()
     self.currentState = ''
     selectorUtils.setBattleTypeAsKnown(SELECTOR_BATTLE_TYPES.UNIT)
 def _doSelect(self, dispatcher):
     isSuccess = yield dispatcher.doSelectAction(PrbAction(self.getData()))
     if isSuccess:
         if self._isNew:
             selectorUtils.setBattleTypeAsKnown(self._selectorType)
         self.mapsTrainingController.showMapsTrainingPage()
예제 #22
0
 def update(self, state):
     if self._selectorType is not None:
         self._isNew = not selectorUtils.isKnownBattleType(self._selectorType)
     if not self._isLocked:
         self._update(state)
     return
 def select(self):
     self.rankedController.doActionOnEntryPointClick()
     selectorUtils.setBattleTypeAsKnown(self._selectorType)
예제 #24
0
 def __init__(self, _ = None):
     super(CyberSportMainWindow, self).__init__()
     self.__currentState = ''
     selectorUtils.setBattleTypeAsKnown(SELECTOR_BATTLE_TYPES.UNIT)
 def _doSelect(self, dispatcher):
     isSuccess = yield dispatcher.doSelectAction(PrbAction(self._data))
     if isSuccess and self._isNew:
         selectorUtils.setBattleTypeAsKnown(self._selectorType)
 def select(self):
     if self.rankedController.isAvailable():
         super(_RankedItem, self).select()
     elif self.__hasPastSeason:
         self.rankedController.openWebLeaguePage()
     selectorUtils.setBattleTypeAsKnown(self._selectorType)
 def select(self):
     super(_EpicTrainingItem, self).select()
     selectorUtils.setBattleTypeAsKnown(self._selectorType)