예제 #1
0
 def _getHeader(self, currentEvent):
     eventID = currentEvent.getEventID()
     isRegistered = self._eventsController.getHangarFlagData().isRegistered(
         eventID)
     isRegistrationNeeded = currentEvent.getLimits(
     ).getIsRegistrationNeeded()
     if isRegistrationNeeded and not isRegistered:
         if currentEvent.isRegistrationFinishSoon():
             flagIcon = icons.makeImageTag(
                 RES_ICONS.MAPS_ICONS_EVENTBOARDS_FLAGICONS_TIME_ICON)
         else:
             flagIcon = icons.makeImageTag(
                 RES_ICONS.MAPS_ICONS_EVENTBOARDS_FLAGICONS_FLAG_ICON)
         textData = currentEvent.getFormattedRemainingTime(
             EVENT_DATE_TYPE.PARTICIPANTS_FREEZE)
         msgText = TOOLTIPS.HANGAR_ELEN_HEADER_TOENDOFREGISTRATION
         time = textData[0] if textData[0] is not 0 else 1
         timeText = textData[1] if textData[1] else FORMAT_MINUTE_STR
         timeName = EVENT_BOARDS.time_period(str(timeText))
         text = '{} {} {} {}'.format(flagIcon,
                                     text_styles.tutorial(_ms(msgText)),
                                     text_styles.tutorial(time),
                                     text_styles.tutorial(timeName))
     else:
         textData = currentEvent.getFormattedRemainingTime(
             EVENT_DATE_TYPE.END)
         msgText = TOOLTIPS.HANGAR_ELEN_HEADER_TOEND
         time = textData[0] if textData[0] is not 0 else 1
         timeText = textData[1] if textData[1] else FORMAT_MINUTE_STR
         timeName = EVENT_BOARDS.time_period(str(timeText))
         if currentEvent.isEndSoon():
             flagIcon = icons.makeImageTag(
                 RES_ICONS.MAPS_ICONS_EVENTBOARDS_FLAGICONS_TIME_ICON)
             text = '{} {} {} {}'.format(flagIcon,
                                         text_styles.tutorial(_ms(msgText)),
                                         text_styles.tutorial(time),
                                         text_styles.tutorial(timeName))
         else:
             flagIcon = icons.makeImageTag(
                 RES_ICONS.MAPS_ICONS_EVENTBOARDS_FLAGICONS_FLAG_ICON)
             text = '{} {} {} {}'.format(flagIcon,
                                         text_styles.main(_ms(msgText)),
                                         text_styles.stats(time),
                                         text_styles.stats(timeName))
     return formatters.packImageTextBlockData(
         title=text_styles.highTitle(
             _ms(TOOLTIPS.HANGAR_ELEN_HEADER_NAME,
                 name=currentEvent.getName())),
         img=currentEvent.getKeyArtSmall(),
         txtPadding=formatters.packPadding(top=22),
         txtOffset=20,
         txtGap=-8,
         desc=text)
예제 #2
0
def formatTimeToEnd(timeValue, period):
    if timeValue is 0:
        timeValue = 1
        period = FORMAT_MINUTE_STR
    timeName = EVENT_BOARDS.time_period(period)
    text = '{} {}'.format(timeValue, _ms(timeName))
    return text