public void SetPlayerInfo(bool isAutoSelect, Dictionary <int, PartyIconColor> playerPartyIcons, Dictionary <long, string> matchAwardDictionary)
        {
            var playerInfo = Database.ReplaysDb().HotsPlayer.ReadRecordFromPlayerId(Player.PlayerId);

            Hero hero = HeroesIcons.HeroesData(Build).HeroData(Player.Character, includeAbilities: false, additionalUnits: false);

            LeaderboardPortrait = Player.Character != "None" ? hero.HeroPortrait.LeaderboardImage() : null;
            Silenced            = Player.IsSilenced;
            VoiceSilenced       = Player.IsVoiceSilenced;
            CharacterName       = hero.Name;
            PlayerName          = Database.SettingsDb().UserSettings.IsBattleTagHidden ? HeroesHelpers.BattleTags.GetNameFromBattleTagName(playerInfo.BattleTagName) : playerInfo.BattleTagName;
            PlayerBattleTagName = playerInfo.BattleTagName;
            PlayerRegion        = (Region)playerInfo.BattleNetRegionId;
            IsUserPlayer        = (playerInfo.PlayerId == UserProfile.PlayerId && playerInfo.BattleNetRegionId == UserProfile.RegionId) ? true : false;
            HasActiveBoost      = Player.HasActiveBoost;

            if (Player.Team == 4)
            {
                CharacterLevel = "Observer";
            }
            else
            {
                CharacterLevel = isAutoSelect ? "Auto Select" : Player.CharacterLevel.ToString();
            }

            PlayerTag = new PlayerTag
            {
                PlayerName        = PlayerName,
                AccountLevel      = Player.AccountLevel > 0 ? Player.AccountLevel.ToString() : "N/A",
                TotalSeen         = playerInfo.Seen,
                LastSeenBefore    = playerInfo.LastSeenBefore.HasValue ? playerInfo.LastSeenBefore.Value.ToString() : "Never",
                FormerPlayerNames = Database.ReplaysDb().RenamedPlayer.ReadPlayersFromPlayerId(playerInfo.PlayerId),
                Notes             = playerInfo.Notes ?? string.Empty,
            };

            HeroDescription = new HeroDescription
            {
                HeroName     = hero.Name,
                Description  = hero.Description.ColoredText,
                Franchise    = hero.HeroFranchiseImage(),
                Type         = hero.Type,
                Difficulty   = hero.Difficulty,
                Roles        = hero.Roles.ToList(),
                ExpandedRole = hero.ExpandedRole,
            };

            if (playerPartyIcons.ContainsKey(Player.PlayerNumber))
            {
                SetPartyIcon(playerPartyIcons[Player.PlayerNumber]);
            }

            if (matchAwardDictionary.ContainsKey(Player.PlayerId))
            {
                SetMVPAward(matchAwardDictionary[Player.PlayerId]);
            }
        }
        public void SetTalents(ReplayMatchPlayerTalent playerTalentList)
        {
            Talent talent1  = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName1);
            Talent talent4  = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName4);
            Talent talent7  = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName7);
            Talent talent10 = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName10);
            Talent talent13 = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName13);
            Talent talent16 = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName16);
            Talent talent20 = HeroesIcons.HeroesData(Build).HeroData(playerTalentList.Character).GetTalent(playerTalentList.TalentName20);

            Talents.Add(talent1.AbilityTalentImage());
            Talents.Add(talent4.AbilityTalentImage());
            Talents.Add(talent7.AbilityTalentImage());
            Talents.Add(talent10.AbilityTalentImage());
            Talents.Add(talent13.AbilityTalentImage());
            Talents.Add(talent16.AbilityTalentImage());
            Talents.Add(talent20.AbilityTalentImage());

            TalentNames.Add(talent1.Name);
            TalentNames.Add(talent4.Name);
            TalentNames.Add(talent7.Name);
            TalentNames.Add(talent10.Name);
            TalentNames.Add(talent13.Name);
            TalentNames.Add(talent16.Name);
            TalentNames.Add(talent20.Name);

            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent1.Name}:</c> {talent1.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent4.Name}:</c> {talent4.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent7.Name}:</c> {talent7.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent10.Name}:</c> {talent10.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent13.Name}:</c> {talent13.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent16.Name}:</c> {talent16.Tooltip?.ShortTooltip?.ColoredText}");
            TalentShortTooltips.Add($"<c val=\"FFFFFF\">{talent20.Name}:</c> {talent20.Tooltip?.ShortTooltip?.ColoredText}");

            TalentFullTooltips.Add(talent1.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent4.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent7.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent10.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent13.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent16.Tooltip?.FullTooltip?.ColoredText);
            TalentFullTooltips.Add(talent20.Tooltip?.FullTooltip?.ColoredText);

            TalentSubInfo.Add(talent1.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent4.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent7.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent10.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent13.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent16.Tooltip.GetTalentSubInfo());
            TalentSubInfo.Add(talent20.Tooltip.GetTalentSubInfo());
        }
예제 #3
0
        public StatsPartiesViewModel(IInternalService internalService, ILoadingOverlayWindowService loadingOverlayWindow)
            : base(internalService)
        {
            LoadingOverlayWindow = loadingOverlayWindow;

            SeasonList.Add(InitialSeasonListOption);
            SeasonList.AddRange(HeroesHelpers.Seasons.GetSeasonList());
            SelectedSeason = SeasonList[0];

            HeroesList.Add(InitialHeroListOption);
            HeroesList.AddRange(HeroesIcons.HeroesData().HeroNames().OrderBy(x => x).ToList());

            SelectedCharacter = Enumerable.Repeat(InitialHeroListOption, SelectedCharacter.Length).ToArray();

            ClearOptions();
        }
예제 #4
0
        public MatchesBase(IInternalService internalService, IWebsiteService website, IMatchesTabService matchesTab, GameMode matchGameMode, MatchesTab currentTab)
            : base(internalService)
        {
            Website           = website;
            MatchesTabService = matchesTab;
            MatchGameMode     = matchGameMode;
            CurrentTab        = currentTab;

            ShowMatchSummaryButtonEnabled = true;

            SeasonList.AddRange(HeroesHelpers.Seasons.GetSeasonList());
            SelectedSeasonOption = SeasonList[0];

            GameTimeList           = HeroesHelpers.GameDateFilters.GameTimeList;
            SelectedGameTimeOption = FilterGameTimeOption.Any.GetFriendlyName();

            GameDateList           = HeroesHelpers.GameDateFilters.GameDateList;
            SelectedGameDateOption = FilterGameDateOption.Any.GetFriendlyName();

            MapsList.Add("Any");
            MapsList.AddRange(HeroesIcons.Battlegrounds().Battlegrounds(true).Select(x => x.Name).ToList());
            SelectedMapOption = MapsList[0];

            ReplayBuildsList.Add("Any");
            ReplayBuildsList.AddRange(HeroesIcons.HeroBuilds().Builds);
            SelectedBuildOption = ReplayBuildsList[0];

            HeroesList.Add("Any");
            HeroesList.AddRange(HeroesIcons.HeroesData().HeroNames().OrderBy(x => x).ToList());
            SelectedCharacter = HeroesList[0];

            PartyCountList.Add("Any");
            PartyCountList.AddRange(HeroesHelpers.Parties.GetPartyList());
            SelectedParty = PartyCountList[0];

            SelectedAccountLevel = 0;

            Messenger.Default.Register <MatchesDataMessage>(this, (message) => ReceivedMatchSearchData(message));
            Messenger.Default.Register <NotificationMessage>(this, async(message) => await ReceivedMessageAsync(message));
        }
예제 #5
0
        public StatsHeroesViewModel(IInternalService internalService, ILoadingOverlayWindowService loadingOverlayWindow)
            : base(internalService)
        {
            LoadingOverlayWindow = loadingOverlayWindow;

            IsTotalsAveragesChecked = true;
            IsTalentsChecked        = true;
            IsAwardsChecked         = true;

            SeasonList.Add(InitialSeasonListOption);
            SeasonList.AddRange(HeroesHelpers.Seasons.GetSeasonList());
            SelectedSeason = SeasonList[0];

            HeroesList.Add(InitialHeroListOption);
            HeroesList.AddRange(HeroesIcons.HeroesData().HeroNames().OrderBy(x => x).ToList());
            SelectedHero = HeroesList[0];

            GameModeList.AddRange(HeroesHelpers.GameModes.GetAllGameModesList());
            MapList.AddRange(HeroesIcons.Battlegrounds().Battlegrounds(true).Select(x => x.Name).ToList());

            StatsHeroesDataViewModel = new StatsHeroesDataViewModel(internalService, MapList);
        }