From 1417a6d57687d2ae131fec6e79d16798794a97ba Mon Sep 17 00:00:00 2001 From: Kurt Date: Tue, 2 Jan 2018 17:17:30 -0800 Subject: [PATCH] Add shiny sprite fetch & fallback pseudo future proofing in the event new species sprites are added and recolored variants are not Closes #1735 , thanks @trainboy2019 ! (reimplemented alterations with GUI-saved settings) --- PKHeX.WinForms/Util/PKMUtil.cs | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/PKHeX.WinForms/Util/PKMUtil.cs b/PKHeX.WinForms/Util/PKMUtil.cs index 835331c65..b6f25970e 100644 --- a/PKHeX.WinForms/Util/PKMUtil.cs +++ b/PKHeX.WinForms/Util/PKMUtil.cs @@ -45,20 +45,26 @@ namespace PKHeX.WinForms if (generation == 3 && species == 386) // Deoxys, special consideration for Gen3 save files form = GetDeoxysForm(); - string file = PKX.GetResourceStringSprite(species, form, gender, generation); + string file = PKX.GetResourceStringSprite(species, form, gender, generation, shiny); // Redrawing logic Image baseImage = (Image)Resources.ResourceManager.GetObject(file); if (FormConverter.IsTotemForm(species, form)) { form = FormConverter.GetTotemBaseForm(species, form); - file = PKX.GetResourceStringSprite(species, form, gender, generation); + file = PKX.GetResourceStringSprite(species, form, gender, generation, shiny); baseImage = (Image)Resources.ResourceManager.GetObject(file); baseImage = ImageUtil.ToGrayscale(baseImage); } if (baseImage == null) { - baseImage = (Image) Resources.ResourceManager.GetObject($"_{species}"); + if (shiny) // try again without shiny + { + file = PKX.GetResourceStringSprite(species, form, gender, generation); + baseImage = (Image)Resources.ResourceManager.GetObject(file); + } + if (baseImage == null) + baseImage = (Image) Resources.ResourceManager.GetObject($"_{species}"); baseImage = baseImage != null ? ImageUtil.LayerImage(baseImage, Resources.unknown, 0, 0, .5) : Resources.unknown; } if (isegg)