Regional Dex numbers are always 3 digits
This commit is contained in:
parent
d27e566b4b
commit
920fd481e7
3 changed files with 45 additions and 33 deletions
|
@ -25,7 +25,7 @@
|
|||
#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.
|
||||
#define P_DEX_FOUR_DIGITS_AMOUNT TRUE // Since Gen 9, National Pokédex numbers are four digits long.
|
||||
|
||||
// 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.
|
||||
|
|
|
@ -845,11 +845,8 @@ static const struct WindowTemplate sPokemonList_WindowTemplate[] =
|
|||
DUMMY_WIN_TEMPLATE
|
||||
};
|
||||
|
||||
#if P_DEX_FOUR_DIGITS_AMOUNT == TRUE
|
||||
static const u8 sText_No000[] = _("{NO}0000");
|
||||
#else
|
||||
static const u8 sText_No0000[] = _("{NO}0000");
|
||||
static const u8 sText_No000[] = _("{NO}000");
|
||||
#endif
|
||||
static const u8 sCaughtBall_Gfx[] = INCBIN_U8("graphics/pokedex/caught_ball.4bpp");
|
||||
static const u8 sText_TenDashes[] = _("----------");
|
||||
|
||||
|
@ -2437,20 +2434,24 @@ static void CreateMonDexNum(u16 entryNum, u8 left, u8 top, u16 unused)
|
|||
#endif
|
||||
u16 dexNum;
|
||||
|
||||
memcpy(text, sText_No000, ARRAY_COUNT(text));
|
||||
dexNum = sPokedexView->pokedexList[entryNum].dexNum;
|
||||
if (sPokedexView->dexMode == DEX_MODE_HOENN)
|
||||
dexNum = NationalToHoennOrder(dexNum);
|
||||
#if P_DEX_FOUR_DIGITS_AMOUNT == TRUE
|
||||
if (sPokedexView->dexMode == DEX_MODE_HOENN || !P_DEX_FOUR_DIGITS_AMOUNT)
|
||||
{
|
||||
memcpy(text, sText_No000, ARRAY_COUNT(sText_No000));
|
||||
text[2] = CHAR_0 + dexNum / 100;
|
||||
text[3] = CHAR_0 + (dexNum % 100) / 10;
|
||||
text[4] = CHAR_0 + (dexNum % 100) % 10;
|
||||
}
|
||||
else
|
||||
{
|
||||
memcpy(text, sText_No0000, ARRAY_COUNT(sText_No0000));
|
||||
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[3] = CHAR_0 + (dexNum % 100) / 10;
|
||||
text[4] = CHAR_0 + (dexNum % 100) % 10;
|
||||
#endif
|
||||
}
|
||||
PrintMonDexNumAndName(0, FONT_NARROW, text, left, top);
|
||||
}
|
||||
|
||||
|
@ -4127,19 +4128,29 @@ static void PrintMonInfo(u32 num, u32 value, u32 owned, u32 newEntry)
|
|||
const u8 *name;
|
||||
const u8 *category;
|
||||
const u8 *description;
|
||||
bool8 isNational;
|
||||
|
||||
if (newEntry)
|
||||
PrintInfoScreenText(gText_PokedexRegistration, GetStringCenterAlignXOffset(FONT_NORMAL, gText_PokedexRegistration, DISPLAY_WIDTH), 0);
|
||||
if (value == 0)
|
||||
{
|
||||
isNational = FALSE;
|
||||
value = NationalToHoennOrder(num);
|
||||
}
|
||||
else
|
||||
{
|
||||
isNational = TRUE;
|
||||
value = num;
|
||||
#if P_DEX_FOUR_DIGITS_AMOUNT == TRUE
|
||||
}
|
||||
if (P_DEX_FOUR_DIGITS_AMOUNT && isNational)
|
||||
{
|
||||
ConvertIntToDecimalStringN(StringCopy(str, gText_NumberClear01), value, STR_CONV_MODE_LEADING_ZEROS, 4);
|
||||
PrintInfoScreenText(str, 0x60, 0x19);
|
||||
name = GetSpeciesName(num);
|
||||
PrintInfoScreenText(name, 0x8A, 0x19);
|
||||
#else
|
||||
}
|
||||
else
|
||||
{
|
||||
ConvertIntToDecimalStringN(StringCopy(str, gText_NumberClear01), value, STR_CONV_MODE_LEADING_ZEROS, 3);
|
||||
PrintInfoScreenText(str, 0x60, 0x19);
|
||||
natNum = NationalPokedexNumToSpecies(num);
|
||||
|
@ -4148,7 +4159,7 @@ static void PrintMonInfo(u32 num, u32 value, u32 owned, u32 newEntry)
|
|||
else
|
||||
name = sText_TenDashes2;
|
||||
PrintInfoScreenText(name, 0x84, 0x19);
|
||||
#endif
|
||||
}
|
||||
if (owned)
|
||||
{
|
||||
CopyMonCategoryText(num, str2);
|
||||
|
|
|
@ -2837,10 +2837,11 @@ static void PrintNotEggInfo(void)
|
|||
{
|
||||
StringCopy(gStringVar1, &gText_NumberClear01[0]);
|
||||
#if P_DEX_FOUR_DIGITS_AMOUNT == TRUE
|
||||
if (IsNationalPokedexEnabled())
|
||||
ConvertIntToDecimalStringN(gStringVar2, dexNum, STR_CONV_MODE_LEADING_ZEROS, 4);
|
||||
#else
|
||||
ConvertIntToDecimalStringN(gStringVar2, dexNum, STR_CONV_MODE_LEADING_ZEROS, 3);
|
||||
else
|
||||
#endif
|
||||
ConvertIntToDecimalStringN(gStringVar2, dexNum, STR_CONV_MODE_LEADING_ZEROS, 3);
|
||||
StringAppend(gStringVar1, gStringVar2);
|
||||
if (!IsMonShiny(mon))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue