From ed36b5a684143934e94d9a32272f91b55dd358db Mon Sep 17 00:00:00 2001 From: Kurt Date: Sat, 13 Dec 2014 20:28:53 -0800 Subject: [PATCH] Improved item displaying for PKX class tweaked the main form a little bit for clarity --- Misc/PKX.cs | 19 ++++++++++++++++--- PKX/f1-Main.cs | 12 ++++++------ 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/Misc/PKX.cs b/Misc/PKX.cs index 5e4d9150f..b4a0a95d5 100644 --- a/Misc/PKX.cs +++ b/Misc/PKX.cs @@ -822,9 +822,6 @@ namespace PKHeX int gender = (pkx[0x1D] >> 1) & 0x3; string file; - if (isegg == 1) - { file = "egg"; } - else { file = "_" + species.ToString(); if (altforms > 0) // Alt Form Handling @@ -837,11 +834,27 @@ namespace PKHeX pksprite = (Image)Properties.Resources.ResourceManager.GetObject(file); + if (misegg) + { + // Start with a partially transparent species by layering the species with partial opacity onto a blank image. + pksprite = Util.LayerImage((Image)Properties.Resources.ResourceManager.GetObject("_0"), pksprite, 0, 0, 0.33); + // Add the egg layer over-top with full opacity. + pksprite = Util.LayerImage(pksprite, (Image)Properties.Resources.ResourceManager.GetObject("egg"), 0, 0, 1); + } if (misshiny) { // Is Shiny // Redraw our image pksprite = Util.LayerImage(pksprite, Properties.Resources.rare_icon, 0, 0, 0.7); } + if (mhelditem > 0) + { + // Has Item + int item = mhelditem; + Image itemimg = (Image)Properties.Resources.ResourceManager.GetObject("item_" + item.ToString()); + if (itemimg == null) itemimg = Properties.Resources.helditem; + // Redraw + pksprite = Util.LayerImage(pksprite, itemimg, 22 + (15 - itemimg.Width) / 2, 15 + (15 - itemimg.Height), 1); + } } try { diff --git a/PKX/f1-Main.cs b/PKX/f1-Main.cs index 313a20132..e6285af09 100644 --- a/PKX/f1-Main.cs +++ b/PKX/f1-Main.cs @@ -4142,15 +4142,15 @@ namespace PKHeX } if (isegg == 1) { - file = "_0"; // Start with a partially transparent species - baseImage = PKHeX.Util.LayerImage((Image)Properties.Resources.ResourceManager.GetObject(file), baseImage, 0, 0, 0.33); - file = "egg"; // Add the egg layer over-top. - baseImage = PKHeX.Util.LayerImage(baseImage, (Image)Properties.Resources.ResourceManager.GetObject(file), 0, 0, 1); + // Start with a partially transparent species by layering the species with partial opacity onto a blank image. + baseImage = Util.LayerImage((Image)Properties.Resources.ResourceManager.GetObject("_0"), baseImage, 0, 0, 0.33); + // Add the egg layer over-top with full opacity. + baseImage = Util.LayerImage(baseImage, (Image)Properties.Resources.ResourceManager.GetObject("egg"), 0, 0, 1); } if (PKX.getIsShiny(BitConverter.ToUInt32(dslotdata, 0x18),BitConverter.ToUInt16(dslotdata, 0x0C),BitConverter.ToUInt16(dslotdata, 0x0E))) { // Is Shiny // Redraw our image - baseImage = PKHeX.Util.LayerImage(baseImage, Properties.Resources.rare_icon, 0, 0, 0.7); + baseImage = Util.LayerImage(baseImage, Properties.Resources.rare_icon, 0, 0, 0.7); } if (BitConverter.ToUInt16(dslotdata, 0xA) > 0) { @@ -4159,7 +4159,7 @@ namespace PKHeX Image itemimg = (Image)Properties.Resources.ResourceManager.GetObject("item_"+item.ToString()); if (itemimg == null) itemimg = Properties.Resources.helditem; // Redraw - baseImage = PKHeX.Util.LayerImage(baseImage, itemimg, 22 + (15-itemimg.Width)/2, 15 + (15-itemimg.Height), 1); + baseImage = Util.LayerImage(baseImage, itemimg, 22 + (15-itemimg.Width)/2, 15 + (15-itemimg.Height), 1); } pb.Image = baseImage;