Font constants and slight PSS sync

This commit is contained in:
Eduardo Quezada
2022-07-31 21:00:27 -04:00
parent bcfebc7de4
commit 95dd979f09
93 changed files with 1243 additions and 1206 deletions
+21 -21
View File
@@ -63,7 +63,7 @@ struct ShopData
/*0x12*/ u16 field12;
/*0x14*/ u16 maxQuantity;
/*0x16*/ u16 martType:4; // 0x1 if tm list
u16 unk16_4:5;
u16 fontId:5;
u16 itemSlot:2;
u16 unk16_11:5;
/*0x18*/ u16 unk18;
@@ -218,14 +218,14 @@ static u8 CreateShopMenu(u8 a0)
gShopData.martType = GetMartTypeFromItemList(a0);
gShopData.selectedRow = 0;
if (ContextNpcGetTextColor() == 0)
gShopData.unk16_4 = 4;
gShopData.fontId = FONT_4;
else
gShopData.unk16_4 = 5;
gShopData.fontId = FONT_5;
sShopMenuWindowId = AddWindow(&sShopMenuWindowTemplate);
SetStdWindowBorderStyle(sShopMenuWindowId, 0);
PrintTextArray(sShopMenuWindowId, 2, GetMenuCursorDimensionByFont(2, 0), 2, 16, 3, sShopMenuActions_BuySellQuit);
Menu_InitCursor(sShopMenuWindowId, 2, 0, 2, 16, 3, 0);
PrintTextArray(sShopMenuWindowId, FONT_2, GetMenuCursorDimensionByFont(FONT_2, 0), 2, 16, 3, sShopMenuActions_BuySellQuit);
Menu_InitCursor(sShopMenuWindowId, FONT_2, 0, 2, 16, 3, 0);
PutWindowTilemap(sShopMenuWindowId);
CopyWindowToVram(sShopMenuWindowId, COPYWIN_MAP);
return CreateTask(Task_ShopMenu, 8);
@@ -338,7 +338,7 @@ static void Task_ReturnToShopMenu(u8 taskId)
if (IsWeatherNotFadingIn() != TRUE)
return;
DisplayItemMessageOnField(taskId, GetMartUnk16_4(), gText_CanIHelpWithAnythingElse, ShowShopMenuAfterExitingBuyOrSellMenu);
DisplayItemMessageOnField(taskId, GetMartFontId(), gText_CanIHelpWithAnythingElse, ShowShopMenuAfterExitingBuyOrSellMenu);
}
static void ShowShopMenuAfterExitingBuyOrSellMenu(u8 taskId)
@@ -547,8 +547,8 @@ bool8 BuyMenuBuildListMenuTemplate(void)
gMultiuseListMenuTemplate.upText_Y = 2;
gMultiuseListMenuTemplate.fontId = 2;
gMultiuseListMenuTemplate.fillValue = 0;
gMultiuseListMenuTemplate.cursorPal = GetFontAttribute(2, FONTATTR_COLOR_FOREGROUND);
gMultiuseListMenuTemplate.cursorShadowPal = GetFontAttribute(2, FONTATTR_COLOR_SHADOW);
gMultiuseListMenuTemplate.cursorPal = GetFontAttribute(FONT_2, FONTATTR_COLOR_FOREGROUND);
gMultiuseListMenuTemplate.cursorShadowPal = GetFontAttribute(FONT_2, FONTATTR_COLOR_SHADOW);
gMultiuseListMenuTemplate.moveCursorFunc = BuyMenuPrintItemDescriptionAndShowItemIcon;
gMultiuseListMenuTemplate.itemPrintFunc = BuyMenuPrintPriceInList;
gMultiuseListMenuTemplate.scrollMultiple = 0;
@@ -597,13 +597,13 @@ static void BuyMenuPrintItemDescriptionAndShowItemIcon(s32 item, bool8 onInit, s
CreateItemMenuIcon(ITEM_N_A, gShopData.itemSlot);
gShopData.itemSlot ^= 1;
BuyMenuPrint(5, 2, description, 0, 3, 2, 1, 0, 0);
BuyMenuPrint(5, FONT_2, description, 0, 3, 2, 1, 0, 0);
}
else //TM Mart
{
FillWindowPixelBuffer(6, PIXEL_FILL(0));
LoadTmHmNameInMart(item);
BuyMenuPrint(5, 2, description, 2, 3, 1, 0, 0, 0);
BuyMenuPrint(5, FONT_2, description, 2, 3, 1, 0, 0, 0);
}
}
@@ -620,7 +620,7 @@ static void BuyMenuPrintPriceInList(u8 windowId, u32 item, u8 y)
while (x-- != 0)
*loc++ = 0;
StringExpandPlaceholders(loc, gText_PokedollarVar1);
BuyMenuPrint(windowId, 0, gStringVar4, 0x69, y, 0, 0, TEXT_SKIP_DRAW, 1);
BuyMenuPrint(windowId, FONT_0, gStringVar4, 0x69, y, 0, 0, TEXT_SKIP_DRAW, 1);
}
}
@@ -631,20 +631,20 @@ static void LoadTmHmNameInMart(s32 item)
ConvertIntToDecimalStringN(gStringVar1, item - ITEM_DEVON_SCOPE, 2, 2);
StringCopy(gStringVar4, gOtherText_UnkF9_08_Clear_01);
StringAppend(gStringVar4, gStringVar1);
BuyMenuPrint(6, 0, gStringVar4, 0, 0, 0, 0, TEXT_SKIP_DRAW, 1);
BuyMenuPrint(6, FONT_0, gStringVar4, 0, 0, 0, 0, TEXT_SKIP_DRAW, 1);
StringCopy(gStringVar4, gMoveNames[ItemIdToBattleMoveId(item)]);
BuyMenuPrint(6, 2, gStringVar4, 0, 0x10, 0, 0, 0, 1);
BuyMenuPrint(6, FONT_2, gStringVar4, 0, 0x10, 0, 0, 0, 1);
}
else
{
BuyMenuPrint(6, 0, gText_ThreeHyphens, 0, 0, 0, 0, TEXT_SKIP_DRAW, 1);
BuyMenuPrint(6, 2, gText_SevenHyphens, 0, 0x10, 0, 0, 0, 1);
BuyMenuPrint(6, FONT_0, gText_ThreeHyphens, 0, 0, 0, 0, TEXT_SKIP_DRAW, 1);
BuyMenuPrint(6, FONT_2, gText_SevenHyphens, 0, 0x10, 0, 0, 0, 1);
}
}
u8 GetMartUnk16_4(void)
u8 GetMartFontId(void)
{
return gShopData.unk16_4;
return gShopData.fontId;
}
static void BuyMenuPrintCursor(u8 listTaskId, u8 a1)
@@ -656,12 +656,12 @@ static void BuyMenuPrintCursorAtYPosition(u8 y, u8 a1)
{
if (a1 == 0xFF)
{
FillWindowPixelRect(4, 0, 1, y, GetFontAttribute(2, FONTATTR_MAX_LETTER_WIDTH), GetFontAttribute(2, FONTATTR_MAX_LETTER_HEIGHT));
FillWindowPixelRect(4, 0, 1, y, GetFontAttribute(FONT_2, FONTATTR_MAX_LETTER_WIDTH), GetFontAttribute(FONT_2, FONTATTR_MAX_LETTER_HEIGHT));
CopyWindowToVram(4, COPYWIN_GFX);
}
else
{
BuyMenuPrint(4, 2, gText_SelectorArrow2, 1, y, 0, 0, 0, a1);
BuyMenuPrint(4, FONT_2, gText_SelectorArrow2, 1, y, 0, 0, 0, a1);
}
}
@@ -880,7 +880,7 @@ static void BuyMenuPrintItemQuantityAndPrice(u8 taskId)
PrintMoneyAmount(3, 0x36, 0xA, gShopData.itemPrice, TEXT_SKIP_DRAW);
ConvertIntToDecimalStringN(gStringVar1, tItemCount, STR_CONV_MODE_LEADING_ZEROS, 2);
StringExpandPlaceholders(gStringVar4, gText_TimesStrVar1);
BuyMenuPrint(3, 0, gStringVar4, 2, 0xA, 0, 0, 0, 1);
BuyMenuPrint(3, FONT_0, gStringVar4, 2, 0xA, 0, 0, 0, 1);
}
static void Task_BuyMenu(u8 taskId)
@@ -930,7 +930,7 @@ static void Task_BuyHowManyDialogueInit(u8 taskId)
BuyMenuQuantityBoxThinBorder(1, 0);
ConvertIntToDecimalStringN(gStringVar1, quantityInBag, STR_CONV_MODE_RIGHT_ALIGN, 3);
StringExpandPlaceholders(gStringVar4, gText_InBagVar1);
BuyMenuPrint(1, 2, gStringVar4, 0, 2, 0, 0, 0, 1);
BuyMenuPrint(1, FONT_2, gStringVar4, 0, 2, 0, 0, 0, 1);
tItemCount = 1;
BuyMenuQuantityBoxNormalBorder(3, 0);
BuyMenuPrintItemQuantityAndPrice(taskId);