diff options
author | garak <garakmon@gmail.com> | 2018-09-24 08:40:33 -0400 |
---|---|---|
committer | garak <garakmon@gmail.com> | 2018-09-24 08:40:33 -0400 |
commit | 72f9afcbf4a81909019f21acad0484b72ed217f6 (patch) | |
tree | bc7e9a48b8056e28403e251dab7ac64f649ad9e4 /src/berry_tag_screen.c | |
parent | 3964dbd4822f1b22bbc696add7e56ff0c5b2caea (diff) | |
parent | 7ceabffc842dfdf127fd594055f895a0803f54f6 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/berry_tag_screen.c')
-rw-r--r-- | src/berry_tag_screen.c | 78 |
1 files changed, 55 insertions, 23 deletions
diff --git a/src/berry_tag_screen.c b/src/berry_tag_screen.c index fb4bf6817..07fb6bd9e 100644 --- a/src/berry_tag_screen.c +++ b/src/berry_tag_screen.c @@ -101,10 +101,42 @@ static const u8 sTextColors[2][3] = static const struct WindowTemplate sWindowTemplates[] = { - {0x01, 0x0b, 0x04, 0x08, 0x02, 0x0f, 0x0045}, // WIN_BERRY_NAME - {0x01, 0x0b, 0x07, 0x12, 0x04, 0x0f, 0x0055}, // WIN_SIZE_FIRM - {0x01, 0x04, 0x0e, 0x19, 0x04, 0x0f, 0x009d}, // WIN_DESC - {0x00, 0x02, 0x00, 0x08, 0x02, 0x0f, 0x0101}, // WIN_BERRY_TAG + { // WIN_BERRY_NAME + .priority = 1, + .tilemapLeft = 11, + .tilemapTop = 4, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 69, + }, + { // WIN_SIZE_FIRM + .priority = 1, + .tilemapLeft = 11, + .tilemapTop = 7, + .width = 18, + .height = 4, + .paletteNum = 15, + .baseBlock = 85, + }, + { // WIN_DESC + .priority = 1, + .tilemapLeft = 4, + .tilemapTop = 14, + .width = 25, + .height = 4, + .paletteNum = 15, + .baseBlock = 157, + }, + { // WIN_BERRY_TAG + .priority = 0, + .tilemapLeft = 2, + .tilemapTop = 0, + .width = 8, + .height = 2, + .paletteNum = 15, + .baseBlock = 257, + }, DUMMY_WIN_TEMPLATE }; @@ -343,7 +375,7 @@ static void HandleInitWindows(void) static void PrintTextInBerryTagScreen(u8 windowId, const u8 *text, u8 x, u8 y, s32 speed, u8 colorStructId) { - AddTextPrinterParameterized2(windowId, 1, x, y, 0, 0, sTextColors[colorStructId], speed, text); + AddTextPrinterParameterized4(windowId, 1, x, y, 0, 0, sTextColors[colorStructId], speed, text); } static void AddBerryTagTextToBg0(void) @@ -376,7 +408,7 @@ static void PrintBerryNumberAndName(void) static void PrintBerrySize(void) { const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); - PrintTextOnWindow(WIN_SIZE_FIRM, 1, gText_SizeSlash, 0, 1, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, 1, gText_SizeSlash, 0, 1, TEXT_SPEED_FF, NULL); if (berry->size != 0) { u32 inches, fraction; @@ -390,34 +422,34 @@ static void PrintBerrySize(void) ConvertIntToDecimalStringN(gStringVar1, inches, 0, 2); ConvertIntToDecimalStringN(gStringVar2, fraction, 0, 2); StringExpandPlaceholders(gStringVar4, gText_Var1DotVar2); - PrintTextOnWindow(WIN_SIZE_FIRM, 1, gStringVar4, 0x28, 1, 0, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, 1, gStringVar4, 0x28, 1, 0, NULL); } else { - PrintTextOnWindow(WIN_SIZE_FIRM, 1, gText_ThreeMarks, 0x28, 1, 0, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, 1, gText_ThreeMarks, 0x28, 1, 0, NULL); } } static void PrintBerryFirmness(void) { const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); - PrintTextOnWindow(WIN_SIZE_FIRM, 1, gText_FirmSlash, 0, 0x11, TEXT_SPEED_FF, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, 1, gText_FirmSlash, 0, 0x11, TEXT_SPEED_FF, NULL); if (berry->firmness != 0) - PrintTextOnWindow(WIN_SIZE_FIRM, 1, sBerryFirmnessStrings[berry->firmness - 1], 0x28, 0x11, 0, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, 1, sBerryFirmnessStrings[berry->firmness - 1], 0x28, 0x11, 0, NULL); else - PrintTextOnWindow(WIN_SIZE_FIRM, 1, gText_ThreeMarks, 0x28, 0x11, 0, NULL); + AddTextPrinterParameterized(WIN_SIZE_FIRM, 1, gText_ThreeMarks, 0x28, 0x11, 0, NULL); } static void PrintBerryDescription1(void) { const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); - PrintTextOnWindow(WIN_DESC, 1, berry->description1, 0, 1, 0, NULL); + AddTextPrinterParameterized(WIN_DESC, 1, berry->description1, 0, 1, 0, NULL); } static void PrintBerryDescription2(void) { const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); - PrintTextOnWindow(WIN_DESC, 1, berry->description2, 0, 0x11, 0, NULL); + AddTextPrinterParameterized(WIN_DESC, 1, berry->description2, 0, 0x11, 0, NULL); } static void CreateBerrySprite(void) @@ -445,29 +477,29 @@ static void SetFlavorCirclesVisiblity(void) const struct Berry *berry = GetBerryInfo(sBerryTag->berryId); if (berry->spicy) - gSprites[sBerryTag->flavorCircleIds[FLAVOR_SPICY]].invisible = 0; + gSprites[sBerryTag->flavorCircleIds[FLAVOR_SPICY]].invisible = FALSE; else - gSprites[sBerryTag->flavorCircleIds[FLAVOR_SPICY]].invisible = 1; + gSprites[sBerryTag->flavorCircleIds[FLAVOR_SPICY]].invisible = TRUE; if (berry->dry) - gSprites[sBerryTag->flavorCircleIds[FLAVOR_DRY]].invisible = 0; + gSprites[sBerryTag->flavorCircleIds[FLAVOR_DRY]].invisible = FALSE; else - gSprites[sBerryTag->flavorCircleIds[FLAVOR_DRY]].invisible = 1; + gSprites[sBerryTag->flavorCircleIds[FLAVOR_DRY]].invisible = TRUE; if (berry->sweet) - gSprites[sBerryTag->flavorCircleIds[FLAVOR_SWEET]].invisible = 0; + gSprites[sBerryTag->flavorCircleIds[FLAVOR_SWEET]].invisible = FALSE; else - gSprites[sBerryTag->flavorCircleIds[FLAVOR_SWEET]].invisible = 1; + gSprites[sBerryTag->flavorCircleIds[FLAVOR_SWEET]].invisible = TRUE; if (berry->bitter) - gSprites[sBerryTag->flavorCircleIds[FLAVOR_BITTER]].invisible = 0; + gSprites[sBerryTag->flavorCircleIds[FLAVOR_BITTER]].invisible = FALSE; else - gSprites[sBerryTag->flavorCircleIds[FLAVOR_BITTER]].invisible = 1; + gSprites[sBerryTag->flavorCircleIds[FLAVOR_BITTER]].invisible = TRUE; if (berry->sour) - gSprites[sBerryTag->flavorCircleIds[FLAVOR_SOUR]].invisible = 0; + gSprites[sBerryTag->flavorCircleIds[FLAVOR_SOUR]].invisible = FALSE; else - gSprites[sBerryTag->flavorCircleIds[FLAVOR_SOUR]].invisible = 1; + gSprites[sBerryTag->flavorCircleIds[FLAVOR_SOUR]].invisible = TRUE; } static void DestroyFlavorCircleSprites(void) |