コード例 #1
0
 def _makeVO(self, province):
     isRobbed = self.__isRobbed(province)
     result = {
         'front':
         '%s %s' %
         (self.__getFront(province),
          text_styles.standard(
              formatField(province.getFrontLevel,
                          formatter=fort_formatters.getTextLevel))),
         'province':
         self.__getProvinceName(province),
         'map':
         self.__getMap(province),
         'primeTime':
         text_styles.main(province.getUserPrimeTime()),
         'days':
         text_styles.main(
             BigWorld.wg_getIntegralFormat(self.__getDays(province))),
         'isRobbed':
         isRobbed
     }
     if isRobbed:
         restoreTime = province.getPillageEndDatetime()
         result.update({
             'robbedTooltip':
             makeTooltip(
                 None,
                 text_styles.concatStylesToMultiLine(
                     text_styles.main(
                         _ms(CLANS.
                             GLOBALMAPVIEW_TABLE_PROVINCEROBBED_TOOLTIP_NOINCOME
                             )),
                     text_styles.neutral(
                         _ms(CLANS.
                             GLOBALMAPVIEW_TABLE_PROVINCEROBBED_TOOLTIP_RESTORETIME,
                             date=text_styles.main(
                                 formatters.formatShortDateShortTimeString(
                                     restoreTime))))))
         })
     if self.__showTreasuryData:
         result.update({
             'income':
             text_styles.gold(
                 BigWorld.wg_getIntegralFormat(self.__getIncome(province))),
             'noIncomeIconVisible':
             not province.isHqConnected() or isRobbed,
             'noIncomeTooltip':
             CLANS.GLOBALMAPVIEW_NOINCOME_TOOLTIP
         })
     return result
コード例 #2
0
 def _makeVO(self, province):
     isRobbed = self.__isRobbed(province)
     result = {
         "front": "%s %s"
         % (
             self.__getFront(province),
             text_styles.standard(formatField(province.getFrontLevel, formatter=fort_formatters.getTextLevel)),
         ),
         "province": self.__getProvinceName(province),
         "map": self.__getMap(province),
         "primeTime": text_styles.main(province.getUserPrimeTime()),
         "days": text_styles.main(BigWorld.wg_getIntegralFormat(self.__getDays(province))),
         "isRobbed": isRobbed,
     }
     if isRobbed:
         restoreTime = province.getPillageEndDatetime()
         result.update(
             {
                 "robbedTooltip": makeTooltip(
                     None,
                     text_styles.concatStylesToMultiLine(
                         text_styles.main(_ms(CLANS.GLOBALMAPVIEW_TABLE_PROVINCEROBBED_TOOLTIP_NOINCOME)),
                         text_styles.neutral(
                             _ms(
                                 CLANS.GLOBALMAPVIEW_TABLE_PROVINCEROBBED_TOOLTIP_RESTORETIME,
                                 date=text_styles.main(formatters.formatShortDateShortTimeString(restoreTime)),
                             )
                         ),
                     ),
                 )
             }
         )
     if self.__showTreasuryData:
         result.update(
             {
                 "income": text_styles.gold(BigWorld.wg_getIntegralFormat(self.__getIncome(province))),
                 "noIncomeIconVisible": not province.isHqConnected() or isRobbed,
                 "noIncomeTooltip": CLANS.GLOBALMAPVIEW_NOINCOME_TOOLTIP,
             }
         )
     return result
コード例 #3
0
 def __buildActionsSection(self, inviteStatus):
     acceptButtonEnabled = False
     declineButtonEnabled = False
     acceptButtonVisible = False
     declineButtonVisible = False
     acceptButtonTooltip = None
     clanHasFreeSpaces = True
     clanAcceptJoinRequests = True
     if inviteStatus == CLAN_INVITE_STATES.ACTIVE:
         declineButtonVisible = True
         acceptButtonVisible = True
         declineButtonEnabled = self.isActionsAllowed()
         if not clanAcceptJoinRequests:
             acceptButtonTooltip = CLANS.CLANINVITESWINDOW_HEADER_TOOLTIPS_RECRUITEMENTSTOPPED
         elif not clanHasFreeSpaces:
             acceptButtonTooltip = CLANS.CLANINVITESWINDOW_TOOLTIPS_TABLE_CANTSENDINVITE_BODY
         else:
             accProfile = self.clansCtrl.getAccountProfile()
             if accProfile.isInClanEnterCooldown():
                 acceptButtonTooltip = _ms(
                     text_styles.concatStylesToMultiLine(
                         text_styles.standard(
                             _ms(CLANS.
                                 CLANPERSONALINVITESWINDOW_TOOLTIPS_TABLE_CANTACCEPTREQUESTDUETOCD_BODY
                                 )),
                         text_styles.main(
                             formatters.formatShortDateShortTimeString(
                                 accProfile.getClanCooldownTill()))))
             else:
                 acceptButtonEnabled = self.isActionsAllowed()
     return {
         'acceptButtonEnabled': acceptButtonEnabled,
         'declineButtonEnabled': declineButtonEnabled,
         'acceptButtonVisible': acceptButtonVisible,
         'declineButtonVisible': declineButtonVisible,
         'acceptButtonTooltip':
         self._makeTooltip(body=_ms(acceptButtonTooltip))
     }
コード例 #4
0
 def __buildActionsSection(self, accountDbId, inviteStatus):
     acceptButtonEnabled = False
     declineButtonEnabled = False
     inviteButtonEnabled = False
     acceptButtonVisible = False
     declineButtonVisible = False
     inviteButtonVisible = False
     invBtnTooltip = None
     acceptButtonTooltip = None
     clanHasFreeSpaces = self.proxy.clanInfo.hasFreePlaces()
     if self.proxy.currentFilterName == CLANS_ALIASES.INVITE_WINDOW_FILTER_ACTUAL:
         if inviteStatus == CLAN_INVITE_STATES.ACTIVE:
             declineButtonVisible = True
             acceptButtonVisible = True
             declineButtonEnabled = self.isActionsAllowed()
             if not clanHasFreeSpaces:
                 acceptButtonTooltip = self._makeTooltip(body=_ms(
                     CLANS.
                     CLANINVITESWINDOW_TOOLTIPS_TABLE_CANTSENDINVITE_BODY))
             else:
                 accInfo = self.__accountsInfo.get(accountDbId)
                 if accInfo and isInClanEnterCooldown(
                         accInfo.getClanCooldownTill()):
                     acceptButtonTooltip = self._makeTooltip(body=_ms(
                         text_styles.concatStylesToMultiLine(
                             text_styles.standard(
                                 _ms(CLANS.
                                     CLANINVITESWINDOW_TOOLTIPS_TABLE_CANTACCEPTREQUESTDUETOCD_BODY
                                     )),
                             text_styles.main(
                                 formatters.formatShortDateShortTimeString(
                                     accInfo.getClanCooldownTill())))))
                 else:
                     acceptButtonEnabled = self.isActionsAllowed()
     elif self.proxy.currentFilterName == CLANS_ALIASES.INVITE_WINDOW_FILTER_EXPIRED:
         if inviteStatus == CLAN_INVITE_STATES.EXPIRED:
             inviteButtonVisible = True
             if not clanHasFreeSpaces:
                 invBtnTooltip = CLANS.CLANINVITESWINDOW_TOOLTIPS_TABLE_CANTACCEPTREQUEST_BODY
             else:
                 invBtnTooltip = CLANS.CLANINVITESWINDOW_TOOLTIPS_TABLE_INVITES_INVITEBUTTON
                 inviteButtonEnabled = self.isActionsAllowed()
     elif self.proxy.currentFilterName == CLANS_ALIASES.INVITE_WINDOW_FILTER_PROCESSED:
         if inviteStatus == CLAN_INVITE_STATES.DECLINED:
             inviteButtonVisible = True
             if not clanHasFreeSpaces:
                 invBtnTooltip = CLANS.CLANINVITESWINDOW_TOOLTIPS_TABLE_CANTACCEPTREQUEST_BODY
             else:
                 invBtnTooltip = CLANS.CLANINVITESWINDOW_TOOLTIPS_TABLE_INVITES_INVITEBUTTON
                 inviteButtonEnabled = self.isActionsAllowed()
     return {
         'acceptButtonEnabled': acceptButtonEnabled,
         'declineButtonEnabled': declineButtonEnabled,
         'inviteButtonEnabled': inviteButtonEnabled,
         'acceptButtonVisible': acceptButtonVisible,
         'declineButtonVisible': declineButtonVisible,
         'inviteButtonVisible': inviteButtonVisible,
         'inviteButtonText':
         _ms(CLANS.CLANINVITESWINDOW_TABLE_INVITEBUTTON),
         'inviteButtonTooltip': self._makeTooltip(body=_ms(invBtnTooltip)),
         'acceptButtonTooltip': acceptButtonTooltip
     }