Exemplo n.º 1
0
        public BitmapImage?imageSourceForEnchantment(EnchantmentType enchantmentType)
        {
            if (enchantmentType == EnchantmentType.Unset)
            {
                return(imageSource("/Dungeons/Content/UI/Materials/MissionSelectMap/marker/locked_node"));
            }

            var name     = enchantmentType.ToString();
            var filename = string.Format("T_{0}_Icon", name);
            var path     = Path.Combine(PathToEnchantmentImages, name, filename).Replace('\\', '/');
            var fullPath = "/" + path;

            return(imageSource(fullPath) ?? _backupResolver.imageSourceForEnchantment(enchantmentType));
        }
Exemplo n.º 2
0
        public BitmapImage?imageSourceForEnchantment(string enchantment)
        {
            var enchantmentId = enchantment;

            if (enchantmentId == Constants.DEFAULT_ENCHANTMENT_ID)
            {
                return(imageSource("/Dungeons/Content/UI/Materials/MissionSelectMap/marker/locked_node"));
            }

            if (_enchantments.TryGetValue(enchantmentId, out string fullPath))
            {
                var image = imageSource(fullPath);
                if (image != null)
                {
                    return(image);
                }
            }
            EventLogger.logError($"Could not find full path for enchantment {enchantmentId}");
            return(_backupResolver.imageSourceForEnchantment(enchantmentId));
        }