From 252d40293ad42534fe0d7b19977f768c6fd30201 Mon Sep 17 00:00:00 2001 From: Kurt Date: Thu, 30 Apr 2015 00:01:17 -0700 Subject: [PATCH] Use the PKX sprite fetch method instead Should be always up to date now. --- SAV/SAV_Wondercard.cs | 24 +++++------------------- 1 file changed, 5 insertions(+), 19 deletions(-) diff --git a/SAV/SAV_Wondercard.cs b/SAV/SAV_Wondercard.cs index 5b17a4d0c..6b5e07444 100644 --- a/SAV/SAV_Wondercard.cs +++ b/SAV/SAV_Wondercard.cs @@ -290,30 +290,16 @@ private string getWCDescriptionString(byte[] data) private Image getWCPreviewImage(byte[] data) { Image img; - switch (data[0x51]) + switch (data[0x51]) // Gift Type { case 0: ushort species = BitConverter.ToUInt16(data, 0x82); - byte altforms = data[0x84]; + byte form = data[0x84]; byte gender = data[0xA1]; - string file = "_" + species; - if (altforms > 0) // Alt Form Handling - file = file + "_" + altforms; - else if (gender == 1 && (species == 592 || species == 593)) // Frillish & Jellicent - file = file + "_" + gender; - else if (gender == 1 && (species == 521 || species == 668)) // Unfezant & Pyroar - file = "_" + species + "f"; - img = (Image) Properties.Resources.ResourceManager.GetObject(file); - - // Improve the Preview ushort item = BitConverter.ToUInt16(data, 0x78); - if (data[0xD1] > 0) img = Util.LayerImage(img, Properties.Resources.egg, 0, 0, 1); - if (data[0xA3] == 2) img = Util.LayerImage(img, Properties.Resources.rare_icon, 0, 0, 0.7); - if (item > 0) - { - Image itemimg = (Image)Properties.Resources.ResourceManager.GetObject("item_" + item) ?? Properties.Resources.helditem; - img = Util.LayerImage(img, itemimg, 22 + (15 - itemimg.Width) / 2, 15 + (15 - itemimg.Height), 1); - } + bool isEgg = data[0xD1] == 1; + bool isShiny = data[0xA3] == 2; + img = PKX.getSprite(species, form, gender, item, isEgg, isShiny); break; case 1: img = (Image)(Properties.Resources.ResourceManager.GetObject("item_" + BitConverter.ToUInt16(data, 0x68)) ?? Properties.Resources.unknown);