def getProfileCommonInfo(userName, dossier, clanInfo, clanEmblemId): clanNameProp = 'clanName' clanNameDescrProp = 'clanNameDescr' clanJoinTimeProp = 'clanJoinTime' clanPositionProp = 'clanPosition' clanEmblemProp = 'clanEmblem' import cgi lastBattleTimeUserString = None if dossier['total']['lastBattleTime']: lbt = dossier['total']['lastBattleTime'] lastBattleTimeUserString = '%s %s' % (BigWorld.wg_getLongDateFormat(lbt), BigWorld.wg_getShortTimeFormat(lbt)) value = {'name': userName, 'registrationDate': '%s' % BigWorld.wg_getLongDateFormat(dossier['total']['creationTime']), 'lastBattleDate': lastBattleTimeUserString, clanNameProp: '', clanNameDescrProp: '', clanJoinTimeProp: '', clanPositionProp: '', clanEmblemProp: 'img://' + clanEmblemId if clanEmblemId is not None else None} def getGoldFmt(str): return str if clanInfo is not None: value[clanNameProp] = cgi.escape(clanInfo[1]) value[clanNameDescrProp] = cgi.escape(clanInfo[0]) value[clanJoinTimeProp] = makeString(MENU.PROFILE_HEADER_CLAN_JOINDATE) % getGoldFmt(BigWorld.wg_getLongDateFormat(clanInfo[4])) value[clanPositionProp] = getGoldFmt(getClanRoleString(clanInfo[3])) return value
def _requestClanInfo(self): isShowClanProfileBtnVisible = self._databaseID is None and isStartingScriptDone( ) clanDBID, clanInfo = g_itemsCache.items.getClanInfo(self._userID) if clanInfo is not None: clanInfo = ClanInfo(*clanInfo) self.as_setClanDataS({ 'id': clanDBID, 'header': clanInfo.getClanName(), 'topLabel': _ms(PROFILE.PROFILE_SUMMARY_CLAN_POST), 'topValue': text_styles.main(getClanRoleString( clanInfo.getMembersFlags())), 'bottomLabel': _ms(PROFILE.PROFILE_SUMMARY_CLAN_JOINDATE), 'bottomValue': text_styles.main( BigWorld.wg_getLongDateFormat(clanInfo.getJoiningTime())), 'btnLabel': _ms(PROFILE.PROFILE_SUMMARY_CLAN_BTNLABEL), 'btnEnabled': True, 'btnVisible': isShowClanProfileBtnVisible }) self.requestClanEmblem32x32(clanDBID)
def __makeRosters(self): result = [] for dbID in self.__fixedPlayers: player = findFirst(lambda m: m.getID() == dbID, g_clanCache.clanMembers) if player is not None: intTotalMining, intWeekMining = self.fortCtrl.getFort().getPlayerContributions(dbID) role = text_styles.standard(i18n.makeString(getClanRoleString(player.getClanRole()))) roleID = self.CLAN_MEMBER_ROLES.index(player.getClanRole()) vo = vo_converters.makeSimpleClanListRenderVO(player, intTotalMining, intWeekMining, role, roleID) result.append(vo) return result
def _requestClanInfo(self): isShowClanProfileBtnVisible = self._databaseID is None and isStartingScriptDone() clanDBID, clanInfo = g_itemsCache.items.getClanInfo(self._userID) if clanInfo is not None: clanInfo = ClanInfo(*clanInfo) self.as_setClanDataS({'id': clanDBID, 'header': clanInfo.getClanName(), 'topLabel': _ms(PROFILE.PROFILE_SUMMARY_CLAN_POST), 'topValue': text_styles.main(getClanRoleString(clanInfo.getMembersFlags())), 'bottomLabel': _ms(PROFILE.PROFILE_SUMMARY_CLAN_JOINDATE), 'bottomValue': text_styles.main(BigWorld.wg_getLongDateFormat(clanInfo.getJoiningTime())), 'btnLabel': _ms(PROFILE.PROFILE_SUMMARY_CLAN_BTNLABEL), 'btnEnabled': True, 'btnVisible': isShowClanProfileBtnVisible}) self.requestClanEmblem32x32(clanDBID)
def getClanRoleUserString(self): position = self.clanInfo[3] return getClanRoleString(position)
def _getClanRole(self, member): return text_styles.standard( i18n.makeString(getClanRoleString(member.getClanRole())))
def _getClanRole(self, member): return text_styles.standard(i18n.makeString(getClanRoleString(member.getClanRole())))
def _getClanRole(self, member): return self.app.utilsManager.textManager.getText(TextType.STANDARD_TEXT, i18n.makeString(getClanRoleString(member.getClanRole())))