diff options
Diffstat (limited to 'src/save_menu_util.c')
-rw-r--r-- | src/save_menu_util.c | 40 |
1 files changed, 19 insertions, 21 deletions
diff --git a/src/save_menu_util.c b/src/save_menu_util.c index c5c00500e..c811f5244 100644 --- a/src/save_menu_util.c +++ b/src/save_menu_util.c @@ -1,7 +1,7 @@ #include "global.h" #include "menu.h" +#include "flag.h" -extern u8 FlagGet(u16); extern u8 gOtherText_Player[]; extern u8 gOtherText_Badges[]; extern u8 gOtherText_Pokedex[]; @@ -25,7 +25,7 @@ void HandleDrawSaveWindowInfo(s16 left, s16 top) if (sub_809473C()) width = 13; - if (FlagGet(2049)) // player has Pokédex? + if (FlagGet(SYS_POKEDEX_GET)) { // print info + dex information. MenuDrawTextWindow(left, top, left + width, top + 11); @@ -53,7 +53,7 @@ void sub_80946C8(u16 left, u16 top) if (sub_809473C()) width = 13; - if (FlagGet(2049)) // player has Pokédex? + if (FlagGet(SYS_POKEDEX_GET)) MenuZeroFillWindowRect(left, top, left + width, top + 11); else MenuZeroFillWindowRect(left, top, left + width, top + 9); @@ -73,7 +73,7 @@ void PrintSavePlayerName(s16 x, s16 y) void PrintSaveMapName(s16 x, s16 y) { char name[32]; - + CopyMapName(name, gMapHeader.name); MenuPrint(name, x, y); } @@ -82,7 +82,7 @@ void PrintSaveBadges(s16 x, s16 y) { char badges[16]; u8 badgeCount; - + MenuPrint(gOtherText_Badges, x, y); badgeCount = GetBadgeCount(); ConvertIntToDecimalString(badges, badgeCount); @@ -93,7 +93,7 @@ void PrintSavePokedexCount(s16 x, s16 y) { char pokedex[16]; u16 pokedexCount; - + MenuPrint(gOtherText_Pokedex, x, y); pokedexCount = GetPokedexSeenCount(); ConvertIntToDecimalStringN(pokedex, pokedexCount, 1, 3); @@ -103,7 +103,7 @@ void PrintSavePokedexCount(s16 x, s16 y) void PrintSavePlayTime(s16 x, s16 y) { char playtime[16]; - + MenuPrint(gOtherText_PlayTime, x, y); FormatPlayTime(playtime, gSaveBlock2.playTimeHours, gSaveBlock2.playTimeMinutes, 1); MenuPrint_RightAligned(playtime, x + 12, y); @@ -112,26 +112,24 @@ void PrintSavePlayTime(s16 x, s16 y) u8 GetBadgeCount(void) { u8 badgeCount = 0; - int badgeFlag = 0x807; // first badge flag is located here. - - for(;badgeFlag <= 0x80E; badgeFlag++) - { - if ( FlagGet(badgeFlag) ) + int badgeFlag; + + for (badgeFlag = BADGE01_GET; badgeFlag <= BADGE08_GET; badgeFlag++) + if (FlagGet(badgeFlag)) badgeCount++; - } - + return badgeCount; } u16 GetPokedexSeenCount() { u16 pokedexSeenCount; - - if ( IsNationalPokedex() ) // national dex check? + + if (IsNationalPokedex()) pokedexSeenCount = GetNationalPokedexCount(1); else pokedexSeenCount = GetHoennPokedexCount(1); - + return pokedexSeenCount; } @@ -139,18 +137,18 @@ void FormatPlayTime(char *playtime, u16 hours, u16 minutes, u16 unk) { s16 colon = unk; playtime = ConvertIntToDecimalString(playtime, hours); - + // playtime[0] is hours. // playtime[1] is the character to render between hours and minutes. // playtime[2] is minutes. - + playtime[0] = 0; - + if (colon) playtime[1] = 0xF0; // set middle character to ":" else playtime[1] = 0; - + playtime[2] = 0; playtime += 3; |