def _getTableData(self): data = [] items = self.itemsCache.items params = self.__getSortedParams() infos = self._excelItem.getInfo() infos = sorted(infos, key=lambda info: info.getBattleTs()) for info in infos: vehicleCd = info.getVehicleCd() vehicle = items.getItemByCD(vehicleCd) timeValue = info.getBattleTs() date = formatTimeAndDate(timeValue) methodType = info.getMethodType() if methodType != _cm.SUMMSEQN or methodType == _cm.SUMMSEQN and info.getUsedInCalculations( ): isEnable = True iconAlpha = ICON_ALPHA_USED_IN_CALCULATION date = text_styles.main(date) technicsName = text_styles.main(vehicle.shortUserName) result = text_styles.main( EVENT_BOARDS.summary_result(info.getBattleResult())) platoonIcon = RES_ICONS.MAPS_ICONS_EVENTBOARDS_BATTLE_TYPE_PLATOON else: isEnable = False iconAlpha = ICON_ALPHA_NOT_USED_IN_CALCULATION date = text_styles.disabled(date) technicsName = text_styles.disabled(vehicle.shortUserName) result = text_styles.disabled( EVENT_BOARDS.summary_result(info.getBattleResult())) platoonIcon = RES_ICONS.MAPS_ICONS_EVENTBOARDS_BATTLE_TYPE_PLATOON_DARK icon = platoonIcon if info.getIsInSquad() else None technics = formatVehicleNationAndTypeIcon( vehicle, 'html_templates:lobby/elen/summary') player = { 'icon': icon, 'date': date, 'technics': technics, 'vehicle': vehicle.iconSmall, 'technicsName': technicsName, 'result': result, 'value1': str(_getParameterValue(params[0], info)), 'value2': str(_getParameterValue(params[1], info)), 'value3': str(_getParameterValue(params[2], info)), 'value4': str(info.getFrags()), 'rendererLinkage': EVENTBOARDS_ALIASES.BASE_PLAYER_BATTLE_RENDERER, 'isEnable': isEnable, 'iconAlpha': iconAlpha } data.append(player) return {'tableDP': data}
def _getDescription2(self): info = self._excelItem.getInfo() timeValue = info.getBattleTs() date = formatTimeAndDate(timeValue) inSquad = info.getIsInSquad() squadInfo = _ms( EVENT_BOARDS.SUMMARY_FIGHTINSQUAAD) if inSquad else _ms( EVENT_BOARDS.SUMMARY_FIGHTNOTINSQUAAD) result = _ms(EVENT_BOARDS.summary_result(info.getBattleResult())) return '{}. {} {}'.format(result, squadInfo, date)