diff --git a/data/scripts/debug.inc b/data/scripts/debug.inc index 9da3f529fc..0be780609d 100644 --- a/data/scripts/debug.inc +++ b/data/scripts/debug.inc @@ -449,7 +449,7 @@ Debug_EventScript_EWRAMCounters_Text:: .string "Fishing Chain: {STR_VAR_2}.$" Debug_EventScript_FontTest_Text_1:: - .string "{FONT_SHORT_NARROWER}" @ Edit this to test your font + .string "{FONT_SMALL_NARROWER}" @ Edit this to test your font .string "Angel Adept Blind Bodice Clique\n" .string "Coast Dunce Docile Enact Eosin\l" .string "Furlong Focal Gnome Gondola Human\l" @@ -463,7 +463,7 @@ Debug_EventScript_FontTest_Text_1:: .string "Zloty Zodiac.$" Debug_EventScript_FontTest_Text_2:: - .string "{FONT_SHORT_NARROWER}" @ Edit this to test your font + .string "{FONT_SMALL_NARROWER}" @ Edit this to test your font .string "Angel angel adept for the nuance loads\n" .string "of the arena cocoa and quaalude. Blind\l" .string "blind bodice for the submit oboe of the\l" @@ -474,7 +474,7 @@ Debug_EventScript_FontTest_Text_2:: .string "loud statehood and huddle.$" Debug_EventScript_FontTest_Text_3:: - .string "{FONT_SHORT_NARROWER}" @ Edit this to test your font + .string "{FONT_SMALL_NARROWER}" @ Edit this to test your font .string "Enact enact eosin for the quench coed\n" .string "of the pique canoe and bleep. Furlong\l" .string "furlong focal for the genuflect\l" @@ -486,7 +486,7 @@ Debug_EventScript_FontTest_Text_3:: .string "bathhouse.$" Debug_EventScript_FontTest_Text_4:: - .string "{FONT_SHORT_NARROWER}" @ Edit this to test your font + .string "{FONT_SMALL_NARROWER}" @ Edit this to test your font .string "Inlet inlet iodine for the quince\n" .string "champion of the ennui scampi and shiite.\l" .string "Justin justin jocose for the djibouti\l" @@ -498,7 +498,7 @@ Debug_EventScript_FontTest_Text_4:: .string "shallot.$" Debug_EventScript_FontTest_Text_5:: - .string "{FONT_SHORT_NARROWER}" @ Edit this to test your font + .string "{FONT_SMALL_NARROWER}" @ Edit this to test your font .string "Milliner milliner modal for the alumna\n" .string "solomon of the album custom and summon.\l" .string "Number number nodule for the unmade\l" @@ -510,7 +510,7 @@ Debug_EventScript_FontTest_Text_5:: .string "bishop and supplies.$" Debug_EventScript_FontTest_Text_6:: - .string "{FONT_SHORT_NARROWER}" @ Edit this to test your font + .string "{FONT_SMALL_NARROWER}" @ Edit this to test your font .string "Quanta quanta qophs for the inquest\n" .string "sheqel of the cinq coq and suqqu. Rhone\l" .string "rhone roman for the burnt porous of the\l" @@ -521,7 +521,7 @@ Debug_EventScript_FontTest_Text_6:: .string "of the peasant ingot and ottoman.$" Debug_EventScript_FontTest_Text_7:: - .string "{FONT_SHORT_NARROWER}" @ Edit this to test your font + .string "{FONT_SMALL_NARROWER}" @ Edit this to test your font .string "Uncle uncle udder for the dunes cloud\n" .string "of the hindu thou and continuum. Vulcan\l" .string "vulcan vocal for the alluvial ovoid of\l" @@ -533,12 +533,24 @@ Debug_EventScript_FontTest_Text_7:: .string "exxon.$" Debug_EventScript_FontTest_Text_8:: - .string "{FONT_SHORT_NARROWER}" @ Edit this to test your font + .string "{FONT_SMALL_NARROWER}" @ Edit this to test your font .string "Yunnan yunnan young for the dynamo\n" .string "coyote of the obloquy employ and\l" .string "sayyid. Zloty zloty zodiac for the gizmo\l" .string "ozone of the franz laissez and buzzing.$" + +Debug_EventScript_FontTest_Text_9:: @ Special thanks to Nintendo for this nice pangram to test other glyphs + .string "{FONT_SMALL_NARROWER}" @ Edit this to test your font + .string "42 × 138 = 5796.\n" + .string "Mr Jock, TV quiz PhD: bags 20% fewer\l" + .string "lynx at a café; voilà, they're “worth”\l" + .string "♂1/♀1 = ¥1. That's 10 + 9 - 8 = 11\l" + .string "Nintendo GBA can connect to a Nintendo\l" + .string "GameCube console! He claimed-though I don't\l" + .string "believe him-to have done so in an eyes-shut\l" + .string "state…?$" + Debug_PrintFontTest:: msgbox Debug_EventScript_FontTest_Text_1, MSGBOX_DEFAULT msgbox Debug_EventScript_FontTest_Text_2, MSGBOX_DEFAULT @@ -548,6 +560,7 @@ Debug_PrintFontTest:: msgbox Debug_EventScript_FontTest_Text_6, MSGBOX_DEFAULT msgbox Debug_EventScript_FontTest_Text_7, MSGBOX_DEFAULT msgbox Debug_EventScript_FontTest_Text_8, MSGBOX_DEFAULT + msgbox Debug_EventScript_FontTest_Text_9, MSGBOX_DEFAULT releaseall end diff --git a/graphics/fonts/latin_narrower.png b/graphics/fonts/latin_narrower.png index 2b92e411c3..19a6a98fb6 100644 Binary files a/graphics/fonts/latin_narrower.png and b/graphics/fonts/latin_narrower.png differ diff --git a/graphics/fonts/latin_short_narrower.png b/graphics/fonts/latin_short_narrower.png index 830a90389f..5c4f4c1d4d 100644 Binary files a/graphics/fonts/latin_short_narrower.png and b/graphics/fonts/latin_short_narrower.png differ diff --git a/graphics/fonts/latin_small_narrower.png b/graphics/fonts/latin_small_narrower.png index 576dac01e4..c20fa4ae48 100644 Binary files a/graphics/fonts/latin_small_narrower.png and b/graphics/fonts/latin_small_narrower.png differ diff --git a/src/debug.c b/src/debug.c index 590e415b7e..3615ef1997 100644 --- a/src/debug.c +++ b/src/debug.c @@ -159,7 +159,7 @@ enum FlagsVarsDebugMenu DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS, - DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION, + DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLLISION, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE, @@ -788,7 +788,7 @@ static const struct ListMenuItem sDebugMenu_Items_FlagsVars[] = [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS] = {sDebugText_FlagsVars_ToggleFlyFlags, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS}, [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL] = {sDebugText_FlagsVars_ToggleAllBadges, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL}, [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS] = {sDebugText_FlagsVars_ToggleFrontierPass, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS}, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION] = {sDebugText_FlagsVars_SwitchCollision, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION}, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLLISION] = {sDebugText_FlagsVars_SwitchCollision, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLLISION}, [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER] = {sDebugText_FlagsVars_SwitchEncounter, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER}, [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE] = {sDebugText_FlagsVars_SwitchTrainerSee, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE}, [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE] = {sDebugText_FlagsVars_SwitchBagUse, DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE}, @@ -959,7 +959,7 @@ static void (*const sDebugMenu_Actions_Flags[])(u8) = [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_LOCATIONS] = DebugAction_FlagsVars_ToggleFlyFlags, [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BADGES_ALL] = DebugAction_FlagsVars_ToggleBadgeFlags, [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_FRONTIER_PASS] = DebugAction_FlagsVars_ToggleFrontierPass, - [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION] = DebugAction_FlagsVars_CollisionOnOff, + [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLLISION] = DebugAction_FlagsVars_CollisionOnOff, [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_ENCOUNTER] = DebugAction_FlagsVars_EncounterOnOff, [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_TRAINER_SEE] = DebugAction_FlagsVars_TrainerSeeOnOff, [DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_BAG_USE] = DebugAction_FlagsVars_BagUseOnOff, @@ -1312,7 +1312,7 @@ static u8 Debug_CheckToggleFlags(u8 id) result = FlagGet(FLAG_SYS_FRONTIER_PASS); break; #if OW_FLAG_NO_COLLISION != 0 - case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLISSION: + case DEBUG_FLAGVAR_MENU_ITEM_TOGGLE_COLLISION: result = FlagGet(OW_FLAG_NO_COLLISION); break; #endif @@ -1927,7 +1927,7 @@ static void DebugAction_Util_Warp_Warp(u8 taskId) StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax); StringCopy(gStringVar3, gText_DigitIndicator[0]); StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMapGroup); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Util_Warp_SelectMapGroup; gTasks[taskId].tSubWindowId = windowId; @@ -1971,7 +1971,7 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId) StringExpandPlaceholders(gStringVar1, sDebugText_Util_WarpToMap_SelMax); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].tDigit]); StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMapGroup); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -1986,7 +1986,7 @@ static void DebugAction_Util_Warp_SelectMapGroup(u8 taskId) GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].tMapGroup, gTasks[taskId].tInput)->regionMapSectionId, 0); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].tDigit]); StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMap); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Util_Warp_SelectMap; } @@ -2033,7 +2033,7 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId) GetMapName(gStringVar2, Overworld_GetMapHeaderByGroupAndId(gTasks[taskId].tMapGroup, gTasks[taskId].tInput)->regionMapSectionId, 0); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].tDigit]); StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectMap); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -2045,7 +2045,7 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId) StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].tDigit]); ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectWarp); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Util_Warp_SelectWarp; } else if (JOY_NEW(B_BUTTON)) @@ -2076,7 +2076,7 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId) StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].tDigit]); ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); StringExpandPlaceholders(gStringVar4, sDebugText_Util_WarpToMap_SelectWarp); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -2236,7 +2236,7 @@ static void DebugAction_Util_Weather(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar1, sWeatherNames[0], CHAR_SPACE, 30); StringExpandPlaceholders(gStringVar4, sDebugText_Util_Weather_ID); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Util_Weather_SelectId; gTasks[taskId].tSubWindowId = windowId; @@ -2282,7 +2282,7 @@ static void DebugAction_Util_Weather_SelectId(u8 taskId) StringCopyPadded(gStringVar1, sDebugText_WeatherNotDefined, CHAR_SPACE, 30); StringExpandPlaceholders(gStringVar4, sDebugText_Util_Weather_ID); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -2445,7 +2445,7 @@ static void DebugAction_FlagsVars_Flags(u8 taskId) StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); StringCopy(gStringVar3, gText_DigitIndicator[0]); StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Flag); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_FlagsVars_FlagsSelect; gTasks[taskId].tSubWindowId = windowId; @@ -2506,7 +2506,7 @@ static void DebugAction_FlagsVars_FlagsSelect(u8 taskId) StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); StringCopy(gStringVar3, gText_DigitIndicator[gTasks[taskId].tDigit]); StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Flag); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } } @@ -2534,7 +2534,7 @@ static void DebugAction_FlagsVars_Vars(u8 taskId) StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[0]); StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Variable); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_FlagsVars_Select; gTasks[taskId].tSubWindowId = windowId; @@ -2586,7 +2586,7 @@ static void DebugAction_FlagsVars_Select(u8 taskId) //Combine str's to full window string StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_Variable); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -2606,7 +2606,7 @@ static void DebugAction_FlagsVars_Select(u8 taskId) StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_VariableValueSet); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].data[6] = gTasks[taskId].data[5]; //New value selector gTasks[taskId].func = DebugAction_FlagsVars_SetValue; @@ -2674,7 +2674,7 @@ static void DebugAction_FlagsVars_SetValue(u8 taskId) StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); StringExpandPlaceholders(gStringVar4, sDebugText_FlagsVars_VariableValueSet); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } } @@ -2960,10 +2960,11 @@ static void DebugAction_Give_Item(u8 taskId) // Display initial item StringCopy(gStringVar2, gText_DigitIndicator[0]); ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); - CopyItemName(1, gStringVar1); + u8* end = CopyItemName(1, gStringVar1); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(windowId)); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_ItemID); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Item_SelectId; gTasks[taskId].tSubWindowId = windowId; @@ -3005,11 +3006,12 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) } StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - CopyItemName(gTasks[taskId].tInput, gStringVar1); + u8* end = CopyItemName(gTasks[taskId].tInput, gStringVar1); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(gTasks[taskId].tSubWindowId)); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringExpandPlaceholders(gStringVar4, sDebugText_ItemID); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); FreeSpriteTilesByTag(ITEM_TAG); //Destroy item icon FreeSpritePaletteByTag(ITEM_TAG); //Destroy item icon @@ -3031,7 +3033,7 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEM_QUANTITY); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_ItemQuantity); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Item_SelectQuantity; } @@ -3082,7 +3084,7 @@ static void DebugAction_Give_Item_SelectQuantity(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEM_QUANTITY); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_ItemQuantity); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -3158,11 +3160,12 @@ static void DebugAction_Give_PokemonSimple(u8 taskId) // Display initial Pokémon StringCopy(gStringVar2, gText_DigitIndicator[0]); - ConvertIntToDecimalStringN(gStringVar3, sDebugMonData->species, STR_CONV_MODE_LEADING_ZEROS, 3); - StringCopy(gStringVar1, GetSpeciesName(sDebugMonData->species)); + ConvertIntToDecimalStringN(gStringVar3, sDebugMonData->species, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); + u8 *end = StringCopy(gStringVar1, GetSpeciesName(sDebugMonData->species)); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(windowId)); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); //Set task data gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId; @@ -3198,11 +3201,12 @@ static void DebugAction_Give_PokemonComplex(u8 taskId) // Display initial Pokémon StringCopy(gStringVar2, gText_DigitIndicator[0]); - ConvertIntToDecimalStringN(gStringVar3, sDebugMonData->species, STR_CONV_MODE_LEADING_ZEROS, 4); - StringCopy(gStringVar1, GetSpeciesName(sDebugMonData->species)); + ConvertIntToDecimalStringN(gStringVar3, sDebugMonData->species, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); + u8 *end = StringCopy(gStringVar1, GetSpeciesName(sDebugMonData->species)); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(windowId)); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectId; gTasks[taskId].tSubWindowId = windowId; @@ -3247,11 +3251,12 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) } StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - StringCopy(gStringVar1, GetSpeciesName(gTasks[taskId].tInput)); //CopyItemName(gTasks[taskId].tInput, gStringVar1); + u8 *end = StringCopy(gStringVar1, GetSpeciesName(gTasks[taskId].tInput)); //CopyItemName(gTasks[taskId].tInput, gStringVar1); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(gTasks[taskId].tSubWindowId)); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); - ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 4); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonID); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); FreeAndDestroyMonIconSprite(&gSprites[gTasks[taskId].tSpriteId]); FreeMonIconPalettes(); @@ -3270,7 +3275,7 @@ static void DebugAction_Give_Pokemon_SelectId(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonLevel); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectLevel; } @@ -3317,7 +3322,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) ConvertIntToDecimalStringN(gStringVar1, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonLevel); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -3343,7 +3348,7 @@ static void DebugAction_Give_Pokemon_SelectLevel(u8 taskId) StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopyPadded(gStringVar2, sDebugText_False, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonShiny); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectShiny; } @@ -3371,7 +3376,7 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 0); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonShiny); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -3385,7 +3390,7 @@ static void DebugAction_Give_Pokemon_SelectShiny(u8 taskId) StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar1, gNaturesInfo[0].name); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonNature); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectNature; } @@ -3421,7 +3426,7 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringCopy(gStringVar1, gNaturesInfo[gTasks[taskId].tInput].name); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonNature); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -3435,9 +3440,10 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); abilityId = GetAbilityBySpecies(sDebugMonData->species, 0); - StringCopy(gStringVar1, gAbilitiesInfo[abilityId].name); + u8 *end = StringCopy(gStringVar1, gAbilitiesInfo[abilityId].name); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(gTasks[taskId].tSubWindowId)); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonAbility); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectAbility; } @@ -3480,9 +3486,10 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); - StringCopy(gStringVar1, gAbilitiesInfo[abilityId].name); + u8 *end = StringCopy(gStringVar1, gAbilitiesInfo[abilityId].name); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(gTasks[taskId].tSubWindowId)); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonAbility); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -3495,7 +3502,7 @@ static void DebugAction_Give_Pokemon_SelectAbility(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 2); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_IV_HP); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs; } @@ -3560,7 +3567,7 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) StringExpandPlaceholders(gStringVar4, sDebugText_IV_SpDefense); break; } - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } //If A or B button @@ -3619,7 +3626,7 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) StringExpandPlaceholders(gStringVar4, sDebugText_IV_SpDefense); break; } - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectIVs; } @@ -3633,7 +3640,7 @@ static void DebugAction_Give_Pokemon_SelectIVs(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_EV_HP); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectEVs; } } @@ -3710,7 +3717,7 @@ static void DebugAction_Give_Pokemon_SelectEVs(u8 taskId) StringExpandPlaceholders(gStringVar4, sDebugText_EV_SpDefense); break; } - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } //If A or B button @@ -3769,7 +3776,7 @@ static void DebugAction_Give_Pokemon_SelectEVs(u8 taskId) StringExpandPlaceholders(gStringVar4, sDebugText_EV_SpDefense); break; } - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectEVs; } @@ -3793,18 +3800,19 @@ static void DebugAction_Give_Pokemon_SelectEVs(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); StringCopyPadded(gStringVar3, gStringVar3, CHAR_SPACE, 15); StringExpandPlaceholders(gStringVar4, sDebugText_EV_HP); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_SelectEVs; } else { StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - StringCopy(gStringVar1, GetMoveName(gTasks[taskId].tInput)); + u8 *end = StringCopy(gStringVar1, GetMoveName(gTasks[taskId].tInput)); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(gTasks[taskId].tSubWindowId)); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_0); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_Move; } @@ -3848,7 +3856,8 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) } StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - StringCopy(gStringVar1, GetMoveName(gTasks[taskId].tInput)); + u8 *end = StringCopy(gStringVar1, GetMoveName(gTasks[taskId].tInput)); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(gTasks[taskId].tSubWindowId)); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); switch (gTasks[taskId].tIterator) @@ -3866,7 +3875,7 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_3); break; } - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -3900,7 +3909,8 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) gTasks[taskId].tDigit = 0; StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].tDigit]); - StringCopy(gStringVar1, GetMoveName(gTasks[taskId].tInput)); + u8 *end = StringCopy(gStringVar1, GetMoveName(gTasks[taskId].tInput)); + WrapFontIdToFit(gStringVar1, end, DEBUG_MENU_FONT, WindowWidthPx(gTasks[taskId].tSubWindowId)); StringCopyPadded(gStringVar1, gStringVar1, CHAR_SPACE, 15); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, 3); switch (gTasks[taskId].tIterator) @@ -3918,7 +3928,7 @@ static void DebugAction_Give_Pokemon_Move(u8 taskId) StringExpandPlaceholders(gStringVar4, sDebugText_PokemonMove_3); break; } - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); gTasks[taskId].func = DebugAction_Give_Pokemon_Move; } @@ -4271,7 +4281,7 @@ static void DebugAction_Sound_SE(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringCopyPadded(gStringVar1, sSENames[0], CHAR_SPACE, 35); StringExpandPlaceholders(gStringVar4, sDebugText_Sound_SFX_ID); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); StopMapMusic(); //Stop map music to better hear sounds @@ -4313,7 +4323,7 @@ static void DebugAction_Sound_SE_SelectId(u8 taskId) StringCopyPadded(gStringVar1, sSENames[gTasks[taskId].tInput-1], CHAR_SPACE, 35); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringExpandPlaceholders(gStringVar4, sDebugText_Sound_SFX_ID); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) @@ -4353,7 +4363,7 @@ static void DebugAction_Sound_MUS(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, START_MUS, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringCopyPadded(gStringVar1, sBGMNames[0], CHAR_SPACE, 35); StringExpandPlaceholders(gStringVar4, sDebugText_Sound_Music_ID); - AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(windowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); StopMapMusic(); //Stop map music to better hear new music @@ -4395,7 +4405,7 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) StringCopyPadded(gStringVar1, sBGMNames[gTasks[taskId].tInput-START_MUS], CHAR_SPACE, 35); ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].tInput, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_ITEMS); StringExpandPlaceholders(gStringVar4, sDebugText_Sound_Music_ID); - AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 1, 1, 0, NULL); + AddTextPrinterParameterized(gTasks[taskId].tSubWindowId, DEBUG_MENU_FONT, gStringVar4, 0, 0, 0, NULL); } if (JOY_NEW(A_BUTTON)) diff --git a/src/fonts.c b/src/fonts.c index fba0dfb7a6..853f6fbde2 100644 --- a/src/fonts.c +++ b/src/fonts.c @@ -185,19 +185,19 @@ ALIGNED(4) const u8 gFontNarrowerLatinGlyphWidths[] = { 3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 7, 4, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, - 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 5, 3, 5, 3, - 5, 5, 5, 3, 3, 5, 5, 6, 3, 6, 6, 4, 4, 4, 4, 4, - 4, 4, 4, 4, 4, 4, 4, 5, 5, 4, 4, 4, 4, 4, 4, 4, - 4, 5, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, 4, + 7, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 6, 6, 5, 4, 5, + 6, 6, 6, 3, 3, 6, 6, 8, 3, 9, 6, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, + 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 2, 4, 4, 2, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 8, - 4, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, + 5, 4, 4, 4, 4, 4, 4, 3, 3, 3, 3, 3, 3, 3, 3, 3, 10, 10, 10, 10, 8, 8, 10, 8, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, diff --git a/src/item_menu.c b/src/item_menu.c index d885f0a8ec..eae1c17eab 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -910,7 +910,7 @@ static void GetItemName(u8 *dest, u16 itemId) { case TMHM_POCKET: end = StringCopy(gStringVar2, GetMoveName(ItemIdToBattleMoveId(itemId))); - PrependFontIdToFit(gStringVar2, end, FONT_NARROW, 73); + PrependFontIdToFit(gStringVar2, end, FONT_NARROW, 61); if (itemId >= ITEM_HM01) { // Get HM number @@ -927,7 +927,7 @@ static void GetItemName(u8 *dest, u16 itemId) case BERRIES_POCKET: ConvertIntToDecimalStringN(gStringVar1, itemId - FIRST_BERRY_INDEX + 1, STR_CONV_MODE_LEADING_ZEROS, 2); end = CopyItemName(itemId, gStringVar2); - PrependFontIdToFit(gStringVar2, end, FONT_NARROW, 73); + PrependFontIdToFit(gStringVar2, end, FONT_NARROW, 61); StringExpandPlaceholders(dest, gText_NumberItem_TMBerry); break; default: diff --git a/test/text.c b/test/text.c index 17d9ab0ee9..ed343d1039 100644 --- a/test/text.c +++ b/test/text.c @@ -44,7 +44,7 @@ TEST("Move names fit on Battle Screen") TEST("Move names fit on Contest Screen") { u32 i; - const u32 fontId = FONT_NARROWER, widthPx = 61; + const u32 fontId = FONT_NARROWER, widthPx = 59; u32 move = MOVE_NONE; for (i = 1; i < MOVES_COUNT; i++) { @@ -53,7 +53,9 @@ TEST("Move names fit on Contest Screen") // All moves explicitly listed here are too big to fit. switch (move) { + case MOVE_STOMPING_TANTRUM: case MOVE_NATURES_MADNESS: + case MOVE_DOUBLE_IRON_BASH: EXPECT_GT(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx); break; default: @@ -65,14 +67,11 @@ TEST("Move names fit on Contest Screen") TEST("Move names fit on TMs & HMs Bag Screen") { u32 i; - const u32 fontId = FONT_NARROWER, widthPx = 63; + const u32 fontId = FONT_NARROWER, widthPx = 61; u32 move = MOVE_NONE; - for (i = 1; i < ITEMS_COUNT; i++) + for (i = 1; i < MOVES_COUNT; i++) { - if (gItemsInfo[i].pocket == POCKET_TM_HM) - { - PARAMETRIZE_LABEL("%S", gMovesInfo[gItemsInfo[i].secondaryId].name) { move = gItemsInfo[i].secondaryId; } - } + PARAMETRIZE_LABEL("%S", gMovesInfo[i].name) { move = i; } } EXPECT_LE(GetStringWidth(fontId, gMovesInfo[move].name, 0), widthPx); } @@ -105,7 +104,7 @@ TEST("Item names fit on Bag Screen (list)") { u32 i; const u32 fontId = FONT_NARROWER; - const u32 tmHmBerryWidthPx = 71, restWidthPx = 88; + const u32 tmHmBerryWidthPx = 61, restWidthPx = 88; u32 item = ITEM_NONE; for (i = 1; i < ITEMS_COUNT; i++) { @@ -122,7 +121,7 @@ TEST("Item plural names fit on Bag Screen (left box)") { u32 i; // -6 for the question mark in FONT_NORMAL. - const u32 fontId = FONT_NARROWER, widthPx = 102 - 6; + const u32 fontId = FONT_NARROWER, widthPx = 101 - 6; u32 item = ITEM_NONE; u8 pluralName[ITEM_NAME_PLURAL_LENGTH + 1]; for (i = 1; i < ITEMS_COUNT; i++) @@ -133,6 +132,18 @@ TEST("Item plural names fit on Bag Screen (left box)") EXPECT_LE(GetStringWidth(fontId, pluralName, 0), widthPx); } +TEST("Item names fit on PC Storage (list)") +{ + u32 i; + const u32 fontId = FONT_NARROWER, widthPx = 73; + u32 item = ITEM_NONE; + for (i = 1; i < ITEMS_COUNT; i++) + { + PARAMETRIZE_LABEL("%S", gItemsInfo[i].name) { item = i; } + } + EXPECT_LE(GetStringWidth(fontId, gItemsInfo[item].name, 0), widthPx); +} + TEST("Item plural names fit on PC storage (left box)") { u32 i; @@ -151,108 +162,22 @@ TEST("Item plural names fit on PC storage (left box)") TEST("Item names fit on Pokemon Storage System") { u32 i; - const u32 fontId = FONT_SMALL_NARROWER, widthPx = 50; + const u32 fontId = FONT_SMALL_NARROWER, widthPx = 66; u32 item = ITEM_NONE; for (i = 1; i < ITEMS_COUNT; i++) { if (gItemsInfo[i].importance) continue; PARAMETRIZE_LABEL("%S", gItemsInfo[i].name) { item = i; } } - // All items explicitly listed here are too big to fit. The ones - // with a hold effect are listed at the bottom in case you want to - // focus on making them fit (they are the most likely to appear on - // the storage system UI, along with anything that could be held - // in the wild). + // All items explicitly listed here are too big to fit. switch (item) { - case ITEM_ENERGY_POWDER: - case ITEM_PEWTER_CRUNCHIES: - case ITEM_RAGE_CANDY_BAR: - case ITEM_LUMIOSE_GALETTE: - case ITEM_HEALTH_FEATHER: - case ITEM_MUSCLE_FEATHER: - case ITEM_RESIST_FEATHER: - case ITEM_GENIUS_FEATHER: - case ITEM_CLEVER_FEATHER: - case ITEM_ABILITY_CAPSULE: - case ITEM_DYNAMAX_CANDY: - case ITEM_MAX_MUSHROOMS: - case ITEM_GOLD_BOTTLE_CAP: - case ITEM_PRETTY_FEATHER: - case ITEM_STRANGE_SOUVENIR: - case ITEM_FOSSILIZED_BIRD: - case ITEM_FOSSILIZED_FISH: - case ITEM_FOSSILIZED_DRAKE: - case ITEM_FOSSILIZED_DINO: - case ITEM_SURPRISE_MULCH: - case ITEM_YELLOW_APRICORN: - case ITEM_GREEN_APRICORN: - case ITEM_WHITE_APRICORN: - case ITEM_BLACK_APRICORN: - case ITEM_THUNDER_STONE: - case ITEM_GALARICA_WREATH: - case ITEM_STRAWBERRY_SWEET: - case ITEM_AUSPICIOUS_ARMOR: - case ITEM_BIG_BAMBOO_SHOOT: - case ITEM_GIMMIGHOUL_COIN: - case ITEM_LEADERS_CREST: - case ITEM_MALICIOUS_ARMOR: - case ITEM_TINY_BAMBOO_SHOOT: - case ITEM_BUG_TERA_SHARD: - case ITEM_DARK_TERA_SHARD: - case ITEM_DRAGON_TERA_SHARD: case ITEM_ELECTRIC_TERA_SHARD: - case ITEM_FAIRY_TERA_SHARD: case ITEM_FIGHTING_TERA_SHARD: - case ITEM_FIRE_TERA_SHARD: - case ITEM_FLYING_TERA_SHARD: - case ITEM_GHOST_TERA_SHARD: - case ITEM_GRASS_TERA_SHARD: - case ITEM_GROUND_TERA_SHARD: - case ITEM_ICE_TERA_SHARD: - case ITEM_NORMAL_TERA_SHARD: - case ITEM_POISON_TERA_SHARD: case ITEM_PSYCHIC_TERA_SHARD: - case ITEM_ROCK_TERA_SHARD: - case ITEM_STEEL_TERA_SHARD: - case ITEM_WATER_TERA_SHARD: - case ITEM_BLACK_AUGURITE: case ITEM_UNREMARKABLE_TEACUP: case ITEM_MASTERPIECE_TEACUP: - case ITEM_FRESH_START_MOCHI: - case ITEM_STELLAR_TERA_SHARD: - case ITEM_JUBILIFE_MUFFIN: - case ITEM_SUPERB_REMEDY: - case ITEM_AUX_POWERGUARD: - case ITEM_CHOICE_DUMPLING: case ITEM_TWICE_SPICED_RADISH: - // Items with hold effects: - case ITEM_ELECTRIC_MEMORY: - case ITEM_FIGHTING_MEMORY: - case ITEM_GROUND_MEMORY: - case ITEM_PSYCHIC_MEMORY: - case ITEM_DRAGON_MEMORY: - case ITEM_CHARIZARDITE_X: - case ITEM_CHARIZARDITE_Y: - case ITEM_ULTRANECROZIUM_Z: - case ITEM_DEEP_SEA_SCALE: - case ITEM_DEEP_SEA_TOOTH: - case ITEM_NEVER_MELT_ICE: - case ITEM_WEAKNESS_POLICY: - case ITEM_SAFETY_GOGGLES: - case ITEM_ADRENALINE_ORB: - case ITEM_TERRAIN_EXTENDER: - case ITEM_PROTECTIVE_PADS: - case ITEM_HEAVY_DUTY_BOOTS: - case ITEM_UTILITY_UMBRELLA: - case ITEM_MARANGA_BERRY: - case ITEM_PUNCHING_GLOVE: - case ITEM_BOOSTER_ENERGY: - case ITEM_ADAMANT_CRYSTAL: - case ITEM_LUSTROUS_GLOBE: - case ITEM_CORNERSTONE_MASK: - case ITEM_WELLSPRING_MASK: - case ITEM_HEARTHFLAME_MASK: EXPECT_GT(GetStringWidth(fontId, gItemsInfo[item].name, 0), widthPx); break; default: @@ -398,7 +323,7 @@ TEST("Species names fit on Pokemon Storage System") } } EXPECT_LE(GetStringWidth(FONT_NARROWER, gSpeciesInfo[species].speciesName, 0), 66); - EXPECT_LE(GetStringWidth(FONT_SHORT_NARROW, gSpeciesInfo[species].speciesName, 0), 60); + EXPECT_LE(GetStringWidth(FONT_SHORT_NARROWER, gSpeciesInfo[species].speciesName, 0), 60); } TEST("Species names fit on Contest Screen") @@ -434,7 +359,7 @@ TEST("Species names fit on Contest Screen - Rankings") TEST("Species names fit on Battle Dome Screen") { u32 i; - const u32 fontId = FONT_SHORT_NARROW, widthPx = 60; + const u32 fontId = FONT_SHORT_NARROWER, widthPx = 60; u32 species = SPECIES_NONE; for (i = 1; i < NUM_SPECIES; i++) {