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); }
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))); } }