summaryrefslogtreecommitdiff
path: root/src/player_pc.c
diff options
context:
space:
mode:
authorgarak <garakmon@gmail.com>2018-09-24 08:40:33 -0400
committergarak <garakmon@gmail.com>2018-09-24 08:40:33 -0400
commit72f9afcbf4a81909019f21acad0484b72ed217f6 (patch)
treebc7e9a48b8056e28403e251dab7ac64f649ad9e4 /src/player_pc.c
parent3964dbd4822f1b22bbc696add7e56ff0c5b2caea (diff)
parent7ceabffc842dfdf127fd594055f895a0803f54f6 (diff)
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'src/player_pc.c')
-rw-r--r--src/player_pc.c136
1 files changed, 109 insertions, 27 deletions
diff --git a/src/player_pc.c b/src/player_pc.c
index ba18b45ab..bdbef1b43 100644
--- a/src/player_pc.c
+++ b/src/player_pc.c
@@ -184,9 +184,33 @@ const struct MenuAction gMailboxMailOptions[] =
static const struct WindowTemplate gUnknown_085DFF24[3] =
{
- {0x00, 0x01, 0x01, 0x09, 0x06, 0x0F, 0x0001},
- {0x00, 0x01, 0x01, 0x09, 0x08, 0x0F, 0x0001},
- {0x00, 0x01, 0x01, 0x0A, 0x08, 0x0F, 0x0001}
+ {
+ .priority = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 1,
+ .width = 9,
+ .height = 6,
+ .paletteNum = 15,
+ .baseBlock = 1
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 1,
+ .width = 9,
+ .height = 8,
+ .paletteNum = 15,
+ .baseBlock = 1
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 1,
+ .width = 10,
+ .height = 8,
+ .paletteNum = 15,
+ .baseBlock = 1
+ }
};
static const struct YesNoFuncTable ResumeFromWithdrawYesNoFuncList = // ResumeFromWithdrawYesNoFuncList
@@ -195,27 +219,85 @@ static const struct YesNoFuncTable ResumeFromWithdrawYesNoFuncList = // ResumeFr
ItemStorage_ResumeInputFromNoToss
};
-static const struct ListMenuTemplate gUnknown_085DFF44 = {
- NULL,
- ItemStorage_MoveCursor,
- fish4_goto_x5_or_x6,
- 0, 0,
- 0, 0, 8, 0,
- 9, 2, 1, 3, FALSE, 0, FALSE, 7
+static const struct ListMenuTemplate gUnknown_085DFF44 =
+{
+ .items = NULL,
+ .moveCursorFunc = ItemStorage_MoveCursor,
+ .itemPrintFunc = fish4_goto_x5_or_x6,
+ .totalItems = 0,
+ .maxShowed = 0,
+ .windowId = 0,
+ .header_X = 0,
+ .item_X = 8,
+ .cursor_X = 0,
+ .upText_Y = 9,
+ .cursorPal = 2,
+ .fillValue = 1,
+ .cursorShadowPal = 3,
+ .lettersSpacing = FALSE,
+ .itemVerticalPadding = 0,
+ .scrollMultiple = FALSE,
+ .fontId = 7
};
static const struct WindowTemplate gUnknown_085DFF5C[5] =
{
- {0x00, 0x10, 0x01, 0x0D, 0x12, 0x0F, 0x0001},
- {0x00, 0x01, 0x0D, 0x0D, 0x06, 0x0F, 0x00EB},
- {0x00, 0x01, 0x08, 0x03, 0x03, 0x0F, 0x0153},
- {0x00, 0x01, 0x01, 0x0D, 0x02, 0x0F, 0x0139},
- {0x00, 0x08, 0x09, 0x06, 0x02, 0x0F, 0x015C}
+ {
+ .priority = 0,
+ .tilemapLeft = 16,
+ .tilemapTop = 1,
+ .width = 13,
+ .height = 18,
+ .paletteNum = 15,
+ .baseBlock = 0x0001
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 13,
+ .width = 13,
+ .height = 6,
+ .paletteNum = 15,
+ .baseBlock = 0x00EB
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 8,
+ .width = 3,
+ .height = 3,
+ .paletteNum = 15,
+ .baseBlock = 0x0153
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 1,
+ .tilemapTop = 1,
+ .width = 13,
+ .height = 2,
+ .paletteNum = 15,
+ .baseBlock = 0x0139
+ },
+ {
+ .priority = 0,
+ .tilemapLeft = 8,
+ .tilemapTop = 9,
+ .width = 6,
+ .height = 2,
+ .paletteNum = 15,
+ .baseBlock = 0x015C
+ }
};
static const struct WindowTemplate gUnknown_085DFF84 =
{
- 0x00, 0x09, 0x07, 0x05, 0x04, 0x0F, 0x0168
+ .priority = 0,
+ .tilemapLeft = 9,
+ .tilemapTop = 7,
+ .width = 5,
+ .height = 4,
+ .paletteNum = 15,
+ .baseBlock = 0x0168
};
static const u8 gUnknown_085DFF8C[] = {0x01, 0x03, 0x02, 0x00};
@@ -272,7 +354,7 @@ static void PlayerPCProcessMenuInput(u8 taskId)
if(gPcItemMenuOptionsNum > 3)
inputOptionId = ProcessMenuInput();
else
- inputOptionId = ProcessMenuInputNoWrapAround();
+ inputOptionId = Menu_ProcessInputNoWrapAround();
switch(inputOptionId)
{
@@ -371,7 +453,7 @@ static void InitItemStorageMenu(u8 taskId, u8 var)
static void ItemStorageMenuPrint(const u8 *textPtr)
{
NewMenuHelpers_DrawDialogueFrame(0, 0);
- PrintTextOnWindow(0, 1, textPtr, 0, 1, 0, 0);
+ AddTextPrinterParameterized(0, 1, textPtr, 0, 1, 0, 0);
}
static void ItemStorageMenuProcessInput(u8 taskId)
@@ -476,7 +558,7 @@ static void ItemStorage_WithdrawToss_Helper(u8 taskId, bool8 toss)
playerPCItemPageInfo.scrollIndicatorId = 0xFF;
ItemStorage_SetItemAndMailCount(taskId);
sub_816BC14();
- gpu_pal_allocator_reset__manage_upper_four();
+ FreeAndReserveObjectSpritePalettes();
LoadListMenuArrowsGfx();
sub_8122344(gUnknown_0203BCC4->spriteIds, 7);
sub_8197434(0,0);
@@ -544,7 +626,7 @@ static void Mailbox_DrawMailboxMenu(u8 taskId)
windowId = sub_81D1C84(0);
sub_81D1C84(1);
- PrintTextOnWindow(windowId, 1, gText_Mailbox, GetStringCenterAlignXOffset(1, gText_Mailbox, 0x40), 1, 0, NULL);
+ AddTextPrinterParameterized(windowId, 1, gText_Mailbox, GetStringCenterAlignXOffset(1, gText_Mailbox, 0x40), 1, 0, NULL);
schedule_bg_copy_tilemap_to_vram(0);
gTasks[taskId].data[5] = sub_81D1DC0(&playerPCItemPageInfo);
sub_81D1E90(&playerPCItemPageInfo);
@@ -686,7 +768,7 @@ static void Mailbox_DrawYesNoBeforeMove(u8 taskId)
static void Mailbox_MoveToBagYesNoPrompt(u8 taskId)
{
- switch(ProcessMenuInputNoWrap_())
+ switch(Menu_ProcessInputNoWrap_())
{
case 0:
Mailbox_DoMailMoveToBag(taskId);
@@ -883,7 +965,7 @@ static void fish4_goto_x5_or_x6(u8 windowId, s32 id, u8 yOffset)
}
ConvertIntToDecimalStringN(gStringVar1, gSaveBlock1Ptr->pcItems[id].quantity, STR_CONV_MODE_RIGHT_ALIGN, 3);
StringExpandPlaceholders(gStringVar4, gText_xVar1);
- PrintTextOnWindow(windowId, 7, gStringVar4, GetStringRightAlignXOffset(7, gStringVar4, 104), yOffset, 0xFF, NULL);
+ AddTextPrinterParameterized(windowId, 7, gStringVar4, GetStringRightAlignXOffset(7, gStringVar4, 104), yOffset, 0xFF, NULL);
}
}
@@ -897,7 +979,7 @@ static void sub_816BEF0(s32 id)
else
description = ItemStorage_GetItemPcResponse(ITEMPC_GO_BACK_TO_PREV);
FillWindowPixelBuffer(windowId, 17);
- PrintTextOnWindow(windowId, 1, description, 0, 1, 0, NULL);
+ AddTextPrinterParameterized(windowId, 1, description, 0, 1, 0, NULL);
}
static void ItemStorage_StartScrollIndicator(void)
@@ -926,7 +1008,7 @@ static void sub_816BFE0(u8 y, u8 b, u8 speed)
if(b == 0xFF)
FillWindowPixelRect(windowId, 17, 0, y, GetMenuCursorDimensionByFont(1, 0), GetMenuCursorDimensionByFont(1, 1));
else
- AddTextPrinterParameterized2(windowId, 1, 0, y, 0, 0, gUnknown_085DFF8C, speed, gText_SelectorArrow2);
+ AddTextPrinterParameterized4(windowId, 1, 0, y, 0, 0, gUnknown_085DFF8C, speed, gText_SelectorArrow2);
}
static void sub_816C060(u16 itemId)
@@ -988,7 +1070,7 @@ static void ItemStorage_ProcessWithdrawTossInput(u8 taskId)
if(!toss)
text = gText_WithdrawItem;
x = GetStringCenterAlignXOffset(1, text, 104);
- PrintTextOnWindow(gUnknown_0203BCC4->windowIds[3], 1, text, x, 1, 0, NULL);
+ AddTextPrinterParameterized(gUnknown_0203BCC4->windowIds[3], 1, text, x, 1, 0, NULL);
CopyWindowToVram(gUnknown_0203BCC4->windowIds[2], 2);
sub_816C110();
sub_816C140();
@@ -1044,7 +1126,7 @@ static void ItemStorage_PrintItemPcResponse(const u8 *string)
u8 windowId = gUnknown_0203BCC4->windowIds[1];
FillWindowPixelBuffer(windowId, 0x11);
StringExpandPlaceholders(gStringVar4, string);
- PrintTextOnWindow(windowId, 1, gStringVar4, 0, 1, 0, NULL);
+ AddTextPrinterParameterized(windowId, 1, gStringVar4, 0, 1, 0, NULL);
}
static void ItemStorage_ProcessInput(u8 taskId)
@@ -1202,7 +1284,7 @@ static void sub_816C6BC(u8 windowId, u16 value, u32 mode, u8 x, u8 y, u8 n)
{
ConvertIntToDecimalStringN(gStringVar1, value, mode, n);
StringExpandPlaceholders(gStringVar4, gText_xVar1);
- PrintTextOnWindow(windowId, 1, gStringVar4, GetStringCenterAlignXOffset(1, gStringVar4, 48), y, 0, NULL);
+ AddTextPrinterParameterized(windowId, 1, gStringVar4, GetStringCenterAlignXOffset(1, gStringVar4, 48), y, 0, NULL);
}
static void ItemStorage_DoItemAction(u8 taskId)