Clean up redundancy for mugshots (#5906)

This commit is contained in:
Alex 2024-12-30 18:32:21 +01:00 committed by GitHub
parent af19b13195
commit 3db351359a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 1165 additions and 1170 deletions

View File

@ -11,6 +11,7 @@ void GetBg0TilesDst(u16 **tilemap, u16 **tileset);
extern const struct SpritePalette gSpritePalette_Pokeball;
enum {
MUGSHOT_COLOR_NONE,
MUGSHOT_COLOR_PURPLE,
MUGSHOT_COLOR_GREEN,
MUGSHOT_COLOR_PINK,

View File

@ -88,7 +88,7 @@ struct Trainer
/*0x12*/ u8 trainerPic;
/*0x13*/ u8 trainerName[TRAINER_NAME_LENGTH + 1];
/*0x1E*/ bool8 doubleBattle:1;
bool8 mugshotEnabled:1;
bool8 padding:1;
u8 startingStatus:6; // this trainer starts a battle with a given status. see include/constants/battle.h for values
/*0x1F*/ u8 mugshotColor;
/*0x20*/ u8 partySize;
@ -235,7 +235,7 @@ static inline const u8 GetTrainerPartySizeFromId(u16 trainerId)
static inline const bool32 DoesTrainerHaveMugshot(u16 trainerId)
{
return gTrainers[SanitizeTrainerId(trainerId)].mugshotEnabled;
return gTrainers[SanitizeTrainerId(trainerId)].mugshotColor;
}
static inline const u8 GetTrainerMugshotColorFromId(u16 trainerId)

File diff suppressed because it is too large Load Diff

View File

@ -1705,7 +1705,6 @@ static void fprint_trainers(const char *output_path, FILE *f, struct Parsed *par
if (!is_empty_string(trainer->mugshot))
{
fprintf(f, "#line %d\n", trainer->mugshot_line);
fprintf(f, " .mugshotEnabled = TRUE,\n");
fprintf(f, " .mugshotColor = ");
fprint_constant(f, "MUGSHOT_COLOR", trainer->mugshot);
fprintf(f, ",\n");