def select(self):
     battle = g_eventsCache.getCompanyBattles()
     if battle.isRunning():
         if battle.needToChangePeriphery():
             g_eventDispatcher.showSwitchPeripheryWindow(ctx=SwitchPeripheryCompanyCtx())
         else:
             super(_CompanyItem, self).select()
Exemple #2
0
 def select(self):
     battle = g_eventsCache.getCompanyBattles()
     if battle.isRunning():
         if battle.needToChangePeriphery():
             g_eventDispatcher.showSwitchPeripheryWindow(ctx=SwitchPeripheryCompanyCtx())
         else:
             super(_CompanyItem, self).select()
 def onCreateRally(self):
     if not BigWorld.player().isLongDisconnectedFromCenter:
         self.__clearCache()
         sortiesAvailable, severAvailable = self.fortProvider.getController().getSortiesCurfewCtrl().getStatus()
         if not severAvailable:
             g_eventDispatcher.showSwitchPeripheryWindow(ctx=SwitchPeripheryFortCtx())
         elif sortiesAvailable:
             self.fireEvent(events.LoadViewEvent(FORTIFICATION_ALIASES.FORT_CHOICE_DIVISION_WINDOW), scope=EVENT_BUS_SCOPE.LOBBY)
         else:
             LOG_ERROR('Sorties is not Available at this moment')
     else:
         SystemMessages.pushI18nMessage('#system_messages:fortification/errors/CENTER_NOT_AVAILABLE', type=SystemMessages.SM_TYPE.Error)
 def __show(self, isInit=False):
     if not self.__isPrimeTime:
         SystemMessages.pushMessage(i18n.makeString(
             SYSTEM_MESSAGES.RANKED_NOTIFICATION_PRIMETIME),
                                    type=SystemMessages.SM_TYPE.PrimeTime)
         if self.rankedController.hasAnyPeripheryWithPrimeTime(
         ) and not constants.IS_CHINA:
             g_eventDispatcher.showSwitchPeripheryWindow(
                 ctx=SwitchPeripheryRankedCtx(), isModal=False)
     elif not isInit:
         SystemMessages.pushMessage(
             i18n.makeString(SYSTEM_MESSAGES.RANKED_NOTIFICATION_AVAILABLE),
             type=SystemMessages.SM_TYPE.RankedBattlesAvailable)
Exemple #5
0
 def __show(self, isInit=False):
     """
     Show UI elements: system message, window
     :param isInit: flag indicating is this method called from init()
     """
     if not self.__isPrimeTime:
         SystemMessages.pushMessage(i18n.makeString(
             SYSTEM_MESSAGES.RANKED_NOTIFICATION_PRIMETIME),
                                    type=SystemMessages.SM_TYPE.PrimeTime)
         if self.rankedController.hasAnyPeripheryWithPrimeTime(
         ) and not constants.IS_CHINA:
             g_eventDispatcher.showSwitchPeripheryWindow(
                 ctx=SwitchPeripheryRankedCtx(), isModal=False)
     elif not isInit:
         SystemMessages.pushMessage(
             i18n.makeString(SYSTEM_MESSAGES.RANKED_NOTIFICATION_AVAILABLE),
             type=SystemMessages.SM_TYPE.RankedBattlesAvailable)
Exemple #6
0
 def onCreateRally(self):
     if not BigWorld.player().isLongDisconnectedFromCenter:
         sortiesAvailable, severAvailable = self.fortProvider.getController(
         ).getSortiesCurfewCtrl().getStatus()
         if not severAvailable:
             g_eventDispatcher.showSwitchPeripheryWindow(
                 ctx=SwitchPeripheryFortCtx())
         elif sortiesAvailable:
             self.fireEvent(events.LoadViewEvent(
                 FORTIFICATION_ALIASES.FORT_CHOICE_DIVISION_WINDOW),
                            scope=EVENT_BUS_SCOPE.LOBBY)
         else:
             LOG_ERROR('Sorties is not Available at this moment')
     else:
         SystemMessages.pushI18nMessage(
             '#system_messages:fortification/errors/CENTER_NOT_AVAILABLE',
             type=SystemMessages.SM_TYPE.Error)