Added LoadMonIconPalettePersonality to load gender specific pokemon icon palettes

This commit is contained in:
TheXaman 2022-09-26 12:40:30 +02:00
parent 2a02cefc81
commit 886a487bf1
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;