Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes: Pokémon Debug isn't loading female icon palettes correctly #2360

Merged
merged 1 commit into from
Sep 26, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions include/pokemon_icon.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/pokemon_debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
11 changes: 11 additions & 0 deletions src/pokemon_icon.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down