def _updateTitle(self, isSortie, direction, resourceMultiplier):
     if isSortie:
         title = i18n.makeString(FORTIFICATIONS.STRONGHOLDTITLE_SORTIE)
     else:
         direction = vo_converters.getDirection(direction)
         title = i18n.makeString(FORTIFICATIONS.STRONGHOLDTITLE_STRONGHOLD) % {'direction': direction}
         if resourceMultiplier > 1:
             title += ' (x%s)' % resourceMultiplier
     self.fireEvent(events.RenameWindowEvent(events.RenameWindowEvent.RENAME_WINDOW, ctx={'data': title}), scope=EVENT_BUS_SCOPE.LOBBY)
 def _onMatchmakingTimerChanged(self, event):
     data = event.ctx
     isBattleTimerVisible = False
     wfbDescr = None
     playerClanName = None
     enemyClanName = None
     currentBattle = data['currentBattle']
     mapId = currentBattle.getMapId() if currentBattle else 0
     enemyclanData = data['enemyClan']
     enemyVisible = enemyclanData is not None
     isInBattle = self.prbEntity.getFlags().isInArena()
     textid = data['textid']
     maxLvl = data['maxLevel']
     level = int2roman(maxLvl)
     if data['isSortie']:
         headerDescr = i18n.makeString(FORTIFICATIONS.STRONGHOLDINFO_SORTIE) % {'level': level}
         timetext = None
         if textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_ENDOFBATTLESOON:
             timetext = time_utils.getTimeLeftFormat(data['dtime'])
         elif textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLESOON:
             timetext = time_utils.getTimeLeftFormat(data['dtime'])
         elif textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLETOMORROW:
             timetext = BigWorld.wg_getShortTimeFormat(data['peripheryStartTimestamp'])
         elif textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLETODAY:
             timetext = BigWorld.wg_getShortTimeFormat(data['peripheryStartTimestamp'])
         wfbDescr = i18n.makeString(textid, nextDate=timetext)
     else:
         direction = vo_converters.getDirection(data['direction'])
         headerDescr = i18n.makeString(FORTIFICATIONS.STRONGHOLDINFO_STRONGHOLD) % {'direction': direction}
         if textid != FORTIFICATIONS.ROSTERINTROWINDOW_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLESOON:
             timetext = None
             if textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLETOMORROW:
                 timetext = BigWorld.wg_getShortTimeFormat(data['matchmakerNextTick'])
             elif textid == FORTIFICATIONS.SORTIE_INTROVIEW_FORTBATTLES_NEXTTIMEOFBATTLETODAY:
                 timetext = BigWorld.wg_getShortTimeFormat(data['matchmakerNextTick'])
             wfbDescr = i18n.makeString(textid, nextDate=timetext)
         else:
             isBattleTimerVisible = True
             fontColors = GUI_SETTINGS.lookup('StrongholdsTimerColors')
             colorRegular = fontColors.get('regular', '#FFDD99')
             colorAlarm = fontColors.get('alarm', '#ff7f00')
             enemyClanName = '?'
             if enemyVisible:
                 clColor = enemyclanData.getColor()
                 clColor = '#%06x' % clColor if clColor else '#ffffff'
                 enemyClanName = "<b><font face='$FieldFont' color='{0}'>[{1}]</font></b>".format(clColor, enemyclanData.getTag())
             clan = data['clan']
             if clan:
                 clColor = clan.getColor()
                 clColor = '#%06x' % clColor if clColor else '#ffffff'
                 playerClanName = "<b><font face='$FieldFont' color='{0}'>[{1}]</font></b>".format(clColor, clan.getTag())
             self.as_setTimerDeltaS(vo_converters.makeClanBattleTimerVO(data['dtime'] if not isInBattle else 0, "<font face='$FieldFont' size='18' color='{0}'>###</font>".format(colorRegular), "<font face='$FieldFont' size='18' color='{0}'>###</font>".format(colorAlarm), self.TIMER_GLOW_COLORS.NORMAL, self.TIMER_GLOW_COLORS.ALERT, '00', 0 if data['isFirstBattle'] else 1))
             self.as_updateReadyStatusS(self.prbEntity.getFlags().isInQueue(), self.__enemyReadyIndicator)
     self.as_setBattleRoomDataS(vo_converters.makeFortClanBattleRoomVO(mapId, headerDescr, playerClanName, enemyClanName, wfbDescr, enemyVisible, isBattleTimerVisible, data['isSortie']))
     if data['forceUpdateBuildings']:
         self.__forceUpdateBuildings()
     return
 def __getTitle(self):
     entity = self.prbEntity
     if entity is not None and entity.isStrongholdSettingsValid():
         header = entity.getStrongholdSettings().getHeader()
         if header.isSortie():
             level = int2roman(header.getMaxLevel())
             title = makeString(FORTIFICATIONS.STRONGHOLDINFO_SORTIE) % {'level': level}
         else:
             direction = vo_converters.getDirection(header.getDirection())
             title = makeString(FORTIFICATIONS.STRONGHOLDINFO_STRONGHOLD) % {'direction': direction}
     else:
         title = ''
     return title