def onDefenceHourActivated(self, hour, initiatorDBID): if initiatorDBID == 0: return None if initiatorDBID == BigWorld.player().databaseID: self.__intelligenceArrowVisible = self.__setTutorialArrowToIntelligenceVisibility() setRosterIntroWindowSetting(FortRosterIntroWindow.TYPE_DEFENCE_START) setRosterIntroWindowSetting(FortRosterIntroWindow.TYPE_FORT_UPGRADE) return None self.fireEvent(events.LoadViewEvent(FORTIFICATION_ALIASES.FORT_ROSTER_INTRO_WINDOW_ALIAS, ctx={'type': FortRosterIntroWindow.TYPE_DEFENCE_START}), EVENT_BUS_SCOPE.LOBBY)
def _updateData(self): if self.fortCtrl.getFort().level >= FORT_BATTLE_DIVISIONS.ABSOLUTE.minFortLevel: defenceDivisionName = _ms(FORTIFICATIONS.ROSTERINTROWINDOW_ABSOLUTEDIVISIONNAME) else: defenceDivisionName = _ms(FORTIFICATIONS.ROSTERINTROWINDOW_CHAMPIONDIVISIONNAME) defenceStart, defenceEnd = self.fortCtrl.getFort().getDefencePeriod() if self._type == FortRosterIntroWindow.TYPE_FORT_UPGRADE: bgIcon = RES_FORT.MAPS_FORT_ABSOLUTEROSTERINTRO header = _ms(FORTIFICATIONS.ROSTERINTROWINDOW_ABSOLUTE_HEADER) else: bgIcon = RES_FORT.MAPS_FORT_CHAMPIONROSTERINTRO header = _ms(FORTIFICATIONS.ROSTERINTROWINDOW_CHAMPION_HEADER) offDay = self.fortCtrl.getFort().getOffDayStr() if self.fortCtrl.getFort().isOffDayEnabled() else None if offDay is not None: defenceDescription = _ms( FORTIFICATIONS.ROSTERINTROWINDOW_DEFENCEDESCRIPTION_OFFDAY, start=BigWorld.wg_getShortTimeFormat(defenceStart), end=BigWorld.wg_getShortTimeFormat(defenceEnd), offDay=offDay, ) else: defenceDescription = _ms( FORTIFICATIONS.ROSTERINTROWINDOW_DEFENCEDESCRIPTION_NOOFFDAY, start=BigWorld.wg_getShortTimeFormat(defenceStart), end=BigWorld.wg_getShortTimeFormat(defenceEnd), ) fortLevel = self.fortCtrl.getFort().level self.as_setDataS( { "windowTitle": _ms(FORTIFICATIONS.ROSTERINTROWINDOW_WINDOWTITLE), "bgIcon": bgIcon, "header": header, "defenceTitle": _ms(FORTIFICATIONS.ROSTERINTROWINDOW_DEFENCETITLE), "defenceIcon": RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_DEFENCEFUTURE, "defenceDescription": defenceDescription, "defenceDivisionName": defenceDivisionName, "defenceDivisionIcon": getDivisionIcon( fortLevel, FORT_BATTLE_DIVISIONS.ABSOLUTE.minFortLevel, determineAlert=False ), "attackTitle": _ms(FORTIFICATIONS.ROSTERINTROWINDOW_ATTACKTITLE), "attackIcon": _ms(RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_OFFENCEFUTURE), "championDivisionDescription": _ms(FORTIFICATIONS.ROSTERINTROWINDOW_CHAMPIONDIVISIONDESCRIPTION), "championDivisionName": _ms(FORTIFICATIONS.ROSTERINTROWINDOW_CHAMPIONDIVISIONNAME), "championDivisionIcon": getDivisionIcon( FORT_BATTLE_DIVISIONS.CHAMPION.minFortLevel, fortLevel, determineAlert=True ), "absoluteDivisionDescription": _ms(FORTIFICATIONS.ROSTERINTROWINDOW_ABSOLUTEDIVISIONDESCRIPTION), "absoluteDivisionName": _ms(FORTIFICATIONS.ROSTERINTROWINDOW_ABSOLUTEDIVISIONNAME), "absoluteDivisionIcon": getDivisionIcon( FORT_BATTLE_DIVISIONS.ABSOLUTE.minFortLevel, fortLevel, determineAlert=True ), "acceptBtnLabel": _ms(MENU.AWARDWINDOW_OKBUTTON), } ) setRosterIntroWindowSetting(self._type) return
def onDefenceHourActivated(self, hour, initiatorDBID): if initiatorDBID == 0: return None elif initiatorDBID == BigWorld.player().databaseID: self.__intelligenceArrowVisible = self.__setTutorialArrowToIntelligenceVisibility() setRosterIntroWindowSetting(FortRosterIntroWindow.TYPE_DEFENCE_START) setRosterIntroWindowSetting(FortRosterIntroWindow.TYPE_FORT_UPGRADE) return None else: self.__showRosterIntroWindow(FortRosterIntroWindow.TYPE_DEFENCE_START) return None
def onDefenceHourActivated(self, hour, initiatorDBID): if initiatorDBID == 0: return None elif initiatorDBID == BigWorld.player().databaseID: self.__intelligenceArrowVisible = self.__setTutorialArrowToIntelligenceVisibility() setRosterIntroWindowSetting(FortRosterIntroWindow.TYPE_DEFENCE_START) setRosterIntroWindowSetting(FortRosterIntroWindow.TYPE_FORT_UPGRADE) return None else: self.__showRosterIntroWindow(FortRosterIntroWindow.TYPE_DEFENCE_START) return None
def onDefenceHourActivated(self, hour, initiatorDBID): if initiatorDBID == 0: return None if initiatorDBID == BigWorld.player().databaseID: self.__intelligenceArrowVisible = self.__setTutorialArrowToIntelligenceVisibility( ) setRosterIntroWindowSetting( FortRosterIntroWindow.TYPE_DEFENCE_START) setRosterIntroWindowSetting( FortRosterIntroWindow.TYPE_FORT_UPGRADE) return None self.fireEvent( events.LoadViewEvent( FORTIFICATION_ALIASES.FORT_ROSTER_INTRO_WINDOW_ALIAS, ctx={'type': FortRosterIntroWindow.TYPE_DEFENCE_START}), EVENT_BUS_SCOPE.LOBBY)
def _updateData(self): if self.fortCtrl.getFort( ).level >= FORT_BATTLE_DIVISIONS.ABSOLUTE.minFortLevel: defenceDivisionName = _ms( FORTIFICATIONS.ROSTERINTROWINDOW_ABSOLUTEDIVISIONNAME) else: defenceDivisionName = _ms( FORTIFICATIONS.ROSTERINTROWINDOW_CHAMPIONDIVISIONNAME) defenceStart, defenceEnd = self.fortCtrl.getFort().getDefencePeriod() if self._type == FortRosterIntroWindow.TYPE_FORT_UPGRADE: bgIcon = RES_FORT.MAPS_FORT_ABSOLUTEROSTERINTRO header = _ms(FORTIFICATIONS.ROSTERINTROWINDOW_ABSOLUTE_HEADER) else: bgIcon = RES_FORT.MAPS_FORT_CHAMPIONROSTERINTRO header = _ms(FORTIFICATIONS.ROSTERINTROWINDOW_CHAMPION_HEADER) offDay = self.fortCtrl.getFort().getOffDayStr( ) if self.fortCtrl.getFort().isOffDayEnabled() else None if offDay is not None: defenceDescription = _ms( FORTIFICATIONS.ROSTERINTROWINDOW_DEFENCEDESCRIPTION_OFFDAY, start=BigWorld.wg_getShortTimeFormat(defenceStart), end=BigWorld.wg_getShortTimeFormat(defenceEnd), offDay=offDay) else: defenceDescription = _ms( FORTIFICATIONS.ROSTERINTROWINDOW_DEFENCEDESCRIPTION_NOOFFDAY, start=BigWorld.wg_getShortTimeFormat(defenceStart), end=BigWorld.wg_getShortTimeFormat(defenceEnd)) fortLevel = self.fortCtrl.getFort().level self.as_setDataS({ 'windowTitle': _ms(FORTIFICATIONS.ROSTERINTROWINDOW_WINDOWTITLE), 'bgIcon': bgIcon, 'header': header, 'defenceTitle': _ms(FORTIFICATIONS.ROSTERINTROWINDOW_DEFENCETITLE), 'defenceIcon': RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_DEFENCEFUTURE, 'defenceDescription': defenceDescription, 'defenceDivisionName': defenceDivisionName, 'defenceDivisionIcon': getDivisionIcon(fortLevel, FORT_BATTLE_DIVISIONS.ABSOLUTE.minFortLevel, determineAlert=False), 'attackTitle': _ms(FORTIFICATIONS.ROSTERINTROWINDOW_ATTACKTITLE), 'attackIcon': _ms(RES_ICONS.MAPS_ICONS_LIBRARY_FORTIFICATION_OFFENCEFUTURE), 'championDivisionDescription': _ms(FORTIFICATIONS.ROSTERINTROWINDOW_CHAMPIONDIVISIONDESCRIPTION), 'championDivisionName': _ms(FORTIFICATIONS.ROSTERINTROWINDOW_CHAMPIONDIVISIONNAME), 'championDivisionIcon': getDivisionIcon(FORT_BATTLE_DIVISIONS.CHAMPION.minFortLevel, fortLevel, determineAlert=True), 'absoluteDivisionDescription': _ms(FORTIFICATIONS.ROSTERINTROWINDOW_ABSOLUTEDIVISIONDESCRIPTION), 'absoluteDivisionName': _ms(FORTIFICATIONS.ROSTERINTROWINDOW_ABSOLUTEDIVISIONNAME), 'absoluteDivisionIcon': getDivisionIcon(FORT_BATTLE_DIVISIONS.ABSOLUTE.minFortLevel, fortLevel, determineAlert=True), 'acceptBtnLabel': _ms(MENU.AWARDWINDOW_OKBUTTON) }) setRosterIntroWindowSetting(self._type)