Merge pull request #2360 from TheXaman/rhh_pokemon_debug_fix

Fixes: Pokémon Debug isn't loading female icon palettes correctly
This commit is contained in:
ghoulslash 2022-09-26 09:09:14 -04:00 committed by GitHub
commit 8ecdf68491
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 13 additions and 1 deletions

View file

@ -23,6 +23,7 @@ void FreeAndDestroyMonIconSprite(struct Sprite *sprite);
u8 CreateMonIcon(u16 species, void (*callback)(struct Sprite *), s16 x, s16 y, u8 subpriority, u32 personality);
u8 UpdateMonIconFrame(struct Sprite *sprite);
void LoadMonIconPalette(u16 species);
void LoadMonIconPalettePersonality(u16 species, u32 personality);
void SpriteCB_MonIcon(struct Sprite *sprite);
void SetPartyHPBarSprite(struct Sprite *sprite, u8 animNum);
u8 GetMonIconPaletteIndexFromSpecies(u16 species);

View file

@ -1686,7 +1686,7 @@ static void ReloadPokemonSprites(struct PokemonDebugMenu *data)
FreeMonIconPalettes();
AllocateMonSpritesGfx();
LoadMonIconPalette(species);
LoadMonIconPalettePersonality(species, (data->isFemale ? FEMALE_PERSONALITY : MALE_PERSONALITY));
//Update instructions
PrintInstructionsOnWindow(data);

View file

@ -2760,6 +2760,17 @@ void LoadMonIconPalette(u16 species)
LoadSpritePalette(&gMonIconPaletteTable[palIndex]);
}
void LoadMonIconPalettePersonality(u16 species, u32 personality)
{
u8 palIndex;
if (ShouldShowFemaleDifferences(species, personality))
palIndex = gMonIconPaletteIndicesFemale[species];
else
palIndex = gMonIconPaletteIndices[species];
if (IndexOfSpritePaletteTag(gMonIconPaletteTable[palIndex].tag) == 0xFF)
LoadSpritePalette(&gMonIconPaletteTable[palIndex]);
}
void FreeMonIconPalettes(void)
{
u8 i;