Пример #1
0
        public Image <Rgba32> GetIcon(int itemId)
        {
            WZProperty     itemNode = GetItemNode(itemId);
            Image <Rgba32> icon     = itemNode.ResolveForOrNull <Image <Rgba32> >("info/icon");

            if (icon == null)
            {
                WZProperty action = itemNode.Children.First(c => c.NameWithoutExtension != "info");
                return(EquipFrameBook.Parse(action).frames?.FirstOrDefault()?.Effects?.Values.FirstOrDefault()?.Image);
            }
            return(icon);
        }
Пример #2
0
        public static Dictionary <string, EquipFrameBook> ProcessFrameBooks(WZProperty container)
        {
            bool isOnlyDefault = container.Children.Where(c => c.NameWithoutExtension != "info")
                                 .Any(obj => obj.Type == PropertyType.Canvas || int.TryParse(obj.NameWithoutExtension, out int frameTest));

            if (isOnlyDefault)
            {
                return new Dictionary <string, EquipFrameBook>()
                       {
                           { "default", EquipFrameBook.Parse(container) }
                       }
            }
            ;
            else
            {
                return(container.Children.Where(c => c.NameWithoutExtension != "info").ToDictionary(c => c.NameWithoutExtension, obj => EquipFrameBook.Parse(obj)));
            }
        }