Vanilla species names fit in health box without narrowing (#4979)

This commit is contained in:
iriv24 2024-07-15 11:01:36 -04:00 committed by GitHub
parent 2b40e79ac3
commit 684e8af181
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 21 additions and 2 deletions

View File

@ -1743,7 +1743,7 @@ static void UpdateNickInHealthbox(u8 healthboxSpriteId, struct Pokemon *mon)
break;
}
windowTileData = AddTextPrinterAndCreateWindowOnHealthboxToFit(gDisplayedStringBattle, 0, 3, 2, &windowId, 54);
windowTileData = AddTextPrinterAndCreateWindowOnHealthboxToFit(gDisplayedStringBattle, 0, 3, 2, &windowId, 55);
spriteTileNum = gSprites[healthboxSpriteId].oam.tileNum * TILE_SIZE_4BPP;

View File

@ -275,7 +275,7 @@ TEST("Item names fit on Shop Screen")
TEST("Species names fit on Battle Screen HP box")
{
u32 i, genderWidthPx;
const u32 fontId = FONT_SMALL_NARROWER, widthPx = 54;
const u32 fontId = FONT_SMALL_NARROWER, widthPx = 55;
u32 species = SPECIES_NONE;
genderWidthPx = GetStringWidth(fontId, COMPOUND_STRING(""), 0);
for (i = 1; i < NUM_SPECIES; i++)
@ -501,6 +501,25 @@ TEST("Species names fit on PokeNav Ribbon List Screen")
EXPECT_LE(GetStringWidth(fontId, gSpeciesInfo[species].speciesName, 0), widthPx);
}
TEST("Species names fit on Battle Screen HP box for vanilla mons with the default font")
{
u32 i, genderWidthPx;
const u32 fontId = FONT_SMALL, widthPx = 55;
u32 species = SPECIES_NONE;
genderWidthPx = GetStringWidth(fontId, COMPOUND_STRING(""), 0);
for (i = 1; i < SPECIES_TURTWIG; i++)
{
if (IsSpeciesEnabled(i))
{
PARAMETRIZE_LABEL("%S", gSpeciesInfo[i].speciesName) { species = i; }
}
}
if (gSpeciesInfo[i].genderRatio != MON_GENDERLESS)
EXPECT_LE(GetStringWidth(fontId, gSpeciesInfo[species].speciesName, 0) - genderWidthPx, widthPx);
else
EXPECT_LE(GetStringWidth(fontId, gSpeciesInfo[species].speciesName, 0), widthPx);
}
TEST("Ability names fit on Pokemon Summary Screen")
{
u32 i;