4 digits option for dex numbers

(cherry picked from commit 9bad51cbc6)
This commit is contained in:
Eduardo Quezada 2022-12-23 11:32:01 -03:00 committed by leo60228
parent b3e5c3179f
commit 6cc2a1ef03
No known key found for this signature in database
GPG key ID: 6F3EB461799AD95E
2 changed files with 22 additions and 0 deletions

View file

@ -24,6 +24,9 @@
#define P_HIPPO_GENDER_DIFF_ICONS TRUE // If TRUE, will give Hippopotas and Hippowdon custom icons for their female forms. #define P_HIPPO_GENDER_DIFF_ICONS TRUE // If TRUE, will give Hippopotas and Hippowdon custom icons for their female forms.
#define P_SHUCKLE_BERRY_JUICE TRUE // In Gen 2, Shuckle had a 1/16 chance of converting Berry that it's holding into Berry Juice. Setting this to TRUE will allow to do this with an Oran Berry, which is the spiritual succesor of the Berry item. #define P_SHUCKLE_BERRY_JUICE TRUE // In Gen 2, Shuckle had a 1/16 chance of converting Berry that it's holding into Berry Juice. Setting this to TRUE will allow to do this with an Oran Berry, which is the spiritual succesor of the Berry item.
// Pokédex settings
#define P_DEX_FOUR_DIGITS_AMOUNT TRUE // Since Gen 9, Pokédex numbers are four digits long.
// Other settings // Other settings
#define P_LEGENDARY_PERFECT_IVS GEN_LATEST // Since Gen 6, Legendaries, Mythicals and Ultra Beasts found in the wild or given through gifts have at least 3 perfect IVs. #define P_LEGENDARY_PERFECT_IVS GEN_LATEST // Since Gen 6, Legendaries, Mythicals and Ultra Beasts found in the wild or given through gifts have at least 3 perfect IVs.
#define P_EV_CAP GEN_LATEST // Since Gen 6, the max EVs per stat is 252 instead of 255. #define P_EV_CAP GEN_LATEST // Since Gen 6, the max EVs per stat is 252 instead of 255.

View file

@ -845,7 +845,11 @@ static const struct WindowTemplate sPokemonList_WindowTemplate[] =
DUMMY_WIN_TEMPLATE DUMMY_WIN_TEMPLATE
}; };
#if P_DEX_FOUR_DIGITS_AMOUNT == TRUE
static const u8 sText_No000[] = _("{NO}0000");
#else
static const u8 sText_No000[] = _("{NO}000"); static const u8 sText_No000[] = _("{NO}000");
#endif
static const u8 sCaughtBall_Gfx[] = INCBIN_U8("graphics/pokedex/caught_ball.4bpp"); static const u8 sCaughtBall_Gfx[] = INCBIN_U8("graphics/pokedex/caught_ball.4bpp");
static const u8 sText_TenDashes[] = _("----------"); static const u8 sText_TenDashes[] = _("----------");
@ -2426,16 +2430,27 @@ static void CreateMonListEntry(u8 position, u16 b, u16 ignored)
static void CreateMonDexNum(u16 entryNum, u8 left, u8 top, u16 unused) static void CreateMonDexNum(u16 entryNum, u8 left, u8 top, u16 unused)
{ {
#if P_DEX_FOUR_DIGITS_AMOUNT == TRUE
u8 text[7];
#else
u8 text[6]; u8 text[6];
#endif
u16 dexNum; u16 dexNum;
memcpy(text, sText_No000, ARRAY_COUNT(text)); memcpy(text, sText_No000, ARRAY_COUNT(text));
dexNum = sPokedexView->pokedexList[entryNum].dexNum; dexNum = sPokedexView->pokedexList[entryNum].dexNum;
if (sPokedexView->dexMode == DEX_MODE_HOENN) if (sPokedexView->dexMode == DEX_MODE_HOENN)
dexNum = NationalToHoennOrder(dexNum); dexNum = NationalToHoennOrder(dexNum);
#if P_DEX_FOUR_DIGITS_AMOUNT == TRUE
text[2] = CHAR_0 + dexNum / 1000;
text[3] = CHAR_0 + (dexNum % 1000) / 100;
text[4] = CHAR_0 + (dexNum % 100) / 10;
text[5] = CHAR_0 + (dexNum % 10);
#else
text[2] = CHAR_0 + dexNum / 100; text[2] = CHAR_0 + dexNum / 100;
text[3] = CHAR_0 + (dexNum % 100) / 10; text[3] = CHAR_0 + (dexNum % 100) / 10;
text[4] = CHAR_0 + (dexNum % 100) % 10; text[4] = CHAR_0 + (dexNum % 100) % 10;
#endif
PrintMonDexNumAndName(0, FONT_NARROW, text, left, top); PrintMonDexNumAndName(0, FONT_NARROW, text, left, top);
} }
@ -4119,7 +4134,11 @@ static void PrintMonInfo(u32 num, u32 value, u32 owned, u32 newEntry)
value = NationalToHoennOrder(num); value = NationalToHoennOrder(num);
else else
value = num; value = num;
#if P_DEX_FOUR_DIGITS_AMOUNT == TRUE
ConvertIntToDecimalStringN(StringCopy(str, gText_NumberClear01), value, STR_CONV_MODE_LEADING_ZEROS, 4);
#else
ConvertIntToDecimalStringN(StringCopy(str, gText_NumberClear01), value, STR_CONV_MODE_LEADING_ZEROS, 3); ConvertIntToDecimalStringN(StringCopy(str, gText_NumberClear01), value, STR_CONV_MODE_LEADING_ZEROS, 3);
#endif
PrintInfoScreenText(str, 0x60, 0x19); PrintInfoScreenText(str, 0x60, 0x19);
natNum = NationalPokedexNumToSpecies(num); natNum = NationalPokedexNumToSpecies(num);
if (natNum) if (natNum)