zyro670 / PokeViewer.NET

App for viewing encounters across all Pokemon Switch titles
GNU General Public License v3.0
23 stars 12 forks source link

Crash when breeding Hisuian Sneasel #17

Closed CardBreaker closed 1 year ago

CardBreaker commented 1 year ago

The program crashes when loading the information about a Hisuian Sneasel egg. Looking at the URL it's accessing, it's trying to load https://raw.githubusercontent.com/zyro670/HomeImages/master/128x128/poke_capture_0215_001_mf_n_00000000_f_n.png. Images with "mf" don't exist and it should instead be "md" or "fd". Additionally, the program should probably try to gracefully handle a missing image by just showing some default image it can always access. This occurred on commit 6624264219c426d1441da65da6bedc49f21d5776.

zyro670 commented 1 year ago

Thanks will fix it in the next commit. Basculegion probably breaks it as well. Not sure about Basculin

CardBreaker commented 1 year ago

At least for Egg Viewer, breeding Basculegion means you get Basculin which doesn't have the same crashing problem. I can't speak for the other PokeViewer tools. Though, I do see another minor issue with Egg Viewer. It's pulling the correct sprite for Basculin-White, but the text in the UI says Basculin-Blue.

zyro670 commented 1 year ago
        if (pkm.Species is (ushort)Species.Sneasel)
        {
            if (pkm.Gender is 0)
                md = true;
            else fd = true;
        }

        if (pkm.Species is (ushort)Species.Basculegion)
        {
            if (pkm.Gender is 0)
            {
                md = true;
                pkm.Form = 0;
            }
            else
                pkm.Form = 1;

            string s = pkm.IsShiny ? "r" : "n";
            string g = md && pkm.Gender is not 1 ? "md" : "fd";
            return $"https://raw.githubusercontent.com/zyro670/HomeImages/master/128x128/poke_capture_0" + $"{pkm.Species}" + "_00" + $"{pkm.Form}" + "_" + $"{g}" + "_n_00000000_f_" + $"{s}" + ".png";
        }

       Can do that locally for a temp fix until I push, have quite a bit of changes but it might be for the PokeViewer 2.0.0 release. I haven't bred anything hisui yet so i'll need to see what else is having issues. Thanks for the heads up! Lmk if you encounter other sprites that break via egg or box viewing.
zyro670 commented 1 year ago

Will push PokeViewer.NET 2.0.0 prob friday or saturday with try/catches for image fails + the other updates.