示例#1
0
        /// <summary>
        /// Returns the MVPScreen award BitmapImage of the given mvpAwardType and color
        /// </summary>
        /// <param name="mvpAwardType">Reference name of award</param>
        /// <param name="mvpColor">Color of icon</param>
        /// <param name="awardName"></param>
        /// <returns></returns>
        public BitmapImage GetMVPScreenAward(string mvpAwardType, MVPScreenColor mvpColor, out string awardName)
        {
            if (MVPAwardDescriptionByAwardType.ContainsKey(mvpAwardType))
            {
                var award     = MVPScreenAwardByAwardType[mvpAwardType];
                var uriString = award.Item2.AbsoluteUri.Replace("%7BmvpColor%7D", mvpColor.ToString());

                awardName = award.Item1;

                try
                {
                    return(HeroesBitmapImage(uriString));
                }
                catch (IOException)
                {
                    LogMissingImage($"Missing image: {uriString}");
                    awardName = mvpAwardType;
                    return(HeroesBitmapImage($@"Talents\_Generic\{NoTalentIconFound}"));
                }
            }
            else
            {
                LogReferenceNameNotFound($"MVP screen award type: {mvpAwardType}");
                awardName = mvpAwardType;
                return(HeroesBitmapImage($@"Talents\_Generic\{NoTalentIconFound}"));
            }
        }
示例#2
0
        /// <summary>
        /// Returns the MVPScreen award Stream of the given mvpAwardType and color
        /// </summary>
        /// <param name="mvpAwardType">Reference name of award</param>
        /// <param name="mvpColor">Color of icon</param>
        /// <param name="awardName"></param>
        /// <returns></returns>
        public Stream GetMVPScreenAward(string mvpAwardType, MVPScreenColor mvpColor, out string awardName)
        {
            if (MVPAwardDescriptionByAwardType.ContainsKey(mvpAwardType))
            {
                var award = MVPScreenAwardByAwardType[mvpAwardType];

                awardName = award.Item1;
                return(HeroesIcons.GetHeroesIconsAssembly().GetManifestResourceStream(award.Item2.Replace("{mvpColor}", mvpColor.ToString().ToLowerInvariant())));
            }
            else
            {
                LogReferenceNameNotFound($"MVP screen award type: {mvpAwardType}");
                awardName = mvpAwardType;
                return(HeroesIcons.GetHeroesIconsAssembly().GetManifestResourceStream(SetImageStreamString($"{TalentFolderName}.{TalentGenericFolderName}", NoTalentIconFound)));
            }
        }