From f52d3b6ce4a92dea43b33e23e5e0f9820886649d Mon Sep 17 00:00:00 2001 From: GriffinR Date: Thu, 1 Jun 2023 14:09:45 -0400 Subject: [PATCH] Correct item_menu/bg.pg colors, combine list tilemaps --- graphics/item_menu/bag_pal1.pal | 51 -------------- graphics/item_menu/bagmap_0.bin | Bin 36 -> 0 bytes graphics/item_menu/bagmap_1.bin | Bin 36 -> 0 bytes graphics/item_menu/bagmap_2.bin | Bin 36 -> 0 bytes graphics/item_menu/bagmap_3.bin | Bin 36 -> 0 bytes graphics/item_menu/bagmap_4.bin | Bin 36 -> 0 bytes graphics/item_menu/bagmap_5.bin | Bin 36 -> 0 bytes graphics/item_menu/bagmap_6.bin | Bin 36 -> 0 bytes graphics/item_menu/bagmap_7.bin | Bin 36 -> 0 bytes graphics/item_menu/bagmap_8.bin | Bin 36 -> 0 bytes graphics/item_menu/bagmap_9.bin | Bin 36 -> 0 bytes graphics/item_menu/bagmap_A.bin | Bin 36 -> 0 bytes graphics/item_menu/bagmap_B.bin | Bin 36 -> 0 bytes graphics/item_menu/bg.png | Bin 539 -> 661 bytes .../item_menu/{bag_pal2.pal => bg_female.pal} | 0 graphics/item_menu/list.bin | Bin 0 -> 432 bytes src/graphics.c | 4 +- src/item_menu.c | 64 ++++++++---------- 18 files changed, 32 insertions(+), 87 deletions(-) delete mode 100644 graphics/item_menu/bag_pal1.pal delete mode 100644 graphics/item_menu/bagmap_0.bin delete mode 100644 graphics/item_menu/bagmap_1.bin delete mode 100644 graphics/item_menu/bagmap_2.bin delete mode 100644 graphics/item_menu/bagmap_3.bin delete mode 100644 graphics/item_menu/bagmap_4.bin delete mode 100644 graphics/item_menu/bagmap_5.bin delete mode 100644 graphics/item_menu/bagmap_6.bin delete mode 100644 graphics/item_menu/bagmap_7.bin delete mode 100644 graphics/item_menu/bagmap_8.bin delete mode 100644 graphics/item_menu/bagmap_9.bin delete mode 100644 graphics/item_menu/bagmap_A.bin delete mode 100644 graphics/item_menu/bagmap_B.bin rename graphics/item_menu/{bag_pal2.pal => bg_female.pal} (100%) create mode 100644 graphics/item_menu/list.bin diff --git a/graphics/item_menu/bag_pal1.pal b/graphics/item_menu/bag_pal1.pal deleted file mode 100644 index e94c83852..000000000 --- a/graphics/item_menu/bag_pal1.pal +++ /dev/null @@ -1,51 +0,0 @@ -JASC-PAL -0100 -48 -0 65 90 -255 0 255 -41 57 82 -65 180 164 -255 0 255 -255 0 255 -106 205 197 -246 205 115 -238 230 172 -255 255 205 -222 139 74 -148 148 148 -238 230 172 -106 106 106 -213 180 82 -205 65 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -189 213 213 -238 255 255 -222 246 255 -255 255 255 -164 222 255 -16 172 222 -0 82 115 -0 115 139 -0 123 197 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -189 213 213 -238 255 255 -222 246 255 -255 255 255 -164 222 255 -24 82 180 -0 90 131 -24 82 180 -24 82 180 diff --git a/graphics/item_menu/bagmap_0.bin b/graphics/item_menu/bagmap_0.bin deleted file mode 100644 index 94c0af766f249188308f328dfd95d76523012fc7..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmd;J;3NP!SO5$N0Hpu` diff --git a/graphics/item_menu/bagmap_1.bin b/graphics/item_menu/bagmap_1.bin deleted file mode 100644 index ff1b44740858ce61a11b5a2ec4ad6eab857ff386..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmd;N;2{7x82}Hu0Mh^f diff --git a/graphics/item_menu/bagmap_2.bin b/graphics/item_menu/bagmap_2.bin deleted file mode 100644 index 167c246f8967e8860e985f6278c4d5aea1f89ecc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmd;N5Fh|K82}V|0TTcK diff --git a/graphics/item_menu/bagmap_3.bin b/graphics/item_menu/bagmap_3.bin deleted file mode 100644 index ff1b44740858ce61a11b5a2ec4ad6eab857ff386..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmd;N;2{7x82}Hu0Mh^f diff --git a/graphics/item_menu/bagmap_4.bin b/graphics/item_menu/bagmap_4.bin deleted file mode 100644 index 167c246f8967e8860e985f6278c4d5aea1f89ecc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmd;N5Fh|K82}V|0TTcK diff --git a/graphics/item_menu/bagmap_5.bin b/graphics/item_menu/bagmap_5.bin deleted file mode 100644 index ff1b44740858ce61a11b5a2ec4ad6eab857ff386..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmd;N;2{7x82}Hu0Mh^f diff --git a/graphics/item_menu/bagmap_6.bin b/graphics/item_menu/bagmap_6.bin deleted file mode 100644 index 167c246f8967e8860e985f6278c4d5aea1f89ecc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmd;N5Fh|K82}V|0TTcK diff --git a/graphics/item_menu/bagmap_7.bin b/graphics/item_menu/bagmap_7.bin deleted file mode 100644 index ff1b44740858ce61a11b5a2ec4ad6eab857ff386..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmd;N;2{7x82}Hu0Mh^f diff --git a/graphics/item_menu/bagmap_8.bin b/graphics/item_menu/bagmap_8.bin deleted file mode 100644 index 167c246f8967e8860e985f6278c4d5aea1f89ecc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmd;N5Fh|K82}V|0TTcK diff --git a/graphics/item_menu/bagmap_9.bin b/graphics/item_menu/bagmap_9.bin deleted file mode 100644 index ff1b44740858ce61a11b5a2ec4ad6eab857ff386..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmd;N;2{7x82}Hu0Mh^f diff --git a/graphics/item_menu/bagmap_A.bin b/graphics/item_menu/bagmap_A.bin deleted file mode 100644 index 167c246f8967e8860e985f6278c4d5aea1f89ecc..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmd;N5Fh|K82}V|0TTcK diff --git a/graphics/item_menu/bagmap_B.bin b/graphics/item_menu/bagmap_B.bin deleted file mode 100644 index 4da8f8ff5162390833dbf2715235a150a9fd79c2..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 36 Ncmb1TkRt$%82~6g0xI`4 zV9CAz0&DIu1QjzBcQaHU#Z(LwK~pagw1pw68At+A$hjBifc9?oba4#v=-fK};-qE; z9@m*SC9mvCm7iN!|K`{K`kf-ehT=*aZ{M5V=Tuy*(0I-AQh4idmOFW5Ba9Q-)9 z{?$6|-Y_1v)r?P9cqto5=SaRX627yfk7X)DWLVSew1D#lr@a_c`Vn%S>0i*4+9)<==_VbGMagvi#muymuaqn)JrZM*_l-LS* ztYnMOmvUryxFf3}wN?1p%};gpvHa%qFFfbTP`$fljp*Ow4Rx-(_JJ1@=H1J?Pe2Cl&ZVT>3ZZi|VelfDV4k(#iH|2U4R-ayrz*Q=araeg5|K%NTF(2Wy1d z!(QDGIn>;E{`oVr_omIlP04>+@}~X>7AVdZ%=sCwARz7@mF+0-BQhaQ#X^dK(fDn4 zjorJ;+AK02LQi&SzH9GhYn*=QxqsmFqkj{6|FcJzZP@rfiH{!??VhfFF6*2UngDI} B|KR`t delta 477 zcmV<30V4jD1)Btr7!3pi0002N5bEoALCjGRu+k2lm?BlINO=W6K`S<-lqGXEuU#socfNCSHWx(xB?-OnKF5cP zF_0q9%dO=2*NPH9zov58nYFWXI3T5(i?>@YPL?zQ z48g%AFFgkc+Zu0txx3+OY2i!wI+NI&9$t;5{2)J3CrEMXUb@&itemOriginalLocation = 0xFF; sBagMenuDisplay->itemMenuIcon = 0; sBagMenuDisplay->inhibitItemDescriptionPrint = FALSE; - sBagMenuDisplay->pocketScrollArrowsTask = 0xFF; - sBagMenuDisplay->pocketSwitchArrowsTask = 0xFF; + sBagMenuDisplay->pocketScrollArrowsTask = TASK_NONE; + sBagMenuDisplay->pocketSwitchArrowsTask = TASK_NONE; if (location == ITEMMENULOCATION_ITEMPC) sBagMenuDisplay->pocketSwitchMode = 1; else if (location == ITEMMENULOCATION_OLD_MAN) @@ -1152,9 +1146,9 @@ static u8 ProcessPocketSwitchInput(u8 taskId, u8 pocketId) static void SwitchPockets(u8 taskId, s16 direction, bool16 a2) { s16 *data = gTasks[taskId].data; - data[13] = 0; - data[12] = 0; - data[11] = direction; + tSwitchState = 0; + tSwitchCounter = 0; + tSwitchDir = direction; if (!a2) { ClearWindowTilemap(0); @@ -1176,35 +1170,36 @@ static void Task_AnimateSwitchPockets(u8 taskId) s16 *data = gTasks[taskId].data; if (!MenuHelpers_IsLinkActive() && !BagIsTutorial()) { - switch (ProcessPocketSwitchInput(taskId, gBagMenuState.pocket + data[11])) + switch (ProcessPocketSwitchInput(taskId, gBagMenuState.pocket + tSwitchDir)) { case 1: - gBagMenuState.pocket += data[11]; + gBagMenuState.pocket += tSwitchDir; SwitchTaskToFollowupFunc(taskId); SwitchPockets(taskId, -1, TRUE); return; case 2: - gBagMenuState.pocket += data[11]; + gBagMenuState.pocket += tSwitchDir; SwitchTaskToFollowupFunc(taskId); SwitchPockets(taskId, 1, TRUE); return; } } - switch (data[13]) + switch (tSwitchState) { case 0: - if (data[12] != 0x7FFF) + // Animate the item list being revealed from the bottom row up + if (tSwitchCounter != SHRT_MAX) { - data[12]++; - CopyBagListBgTileRowToTilemapBuffer(data[12]); - if (data[12] == 12) - data[12] = 0x7FFF; + tSwitchCounter++; + DrawItemListRow(tSwitchCounter); + if (tSwitchCounter == LIST_TILES_HEIGHT) + tSwitchCounter = SHRT_MAX; } - if (data[12] == 0x7FFF) - data[13]++; + if (tSwitchCounter == SHRT_MAX) + tSwitchState++; break; case 1: - gBagMenuState.pocket += data[11]; + gBagMenuState.pocket += tSwitchDir; PrintBagPocketName(); Bag_BuildListMenuTemplate(gBagMenuState.pocket); data[0] = ListMenuInit(&gMultiuseListMenuTemplate, gBagMenuState.cursorPos[gBagMenuState.pocket], gBagMenuState.itemsAbove[gBagMenuState.pocket]); @@ -1332,9 +1327,10 @@ static void UpdateQuantityToTossOrDeposit(s16 value, u8 ndigits) BagPrintTextOnWindow(r6, FONT_SMALL, gStringVar4, 4, 10, 1, 0, 0, 1); } -static void CopyBagListBgTileRowToTilemapBuffer(u8 frame) +// row of 0 is the bottom row in the list, up to LIST_TILES_HEIGHT at the top +static void DrawItemListRow(u8 row) { - CopyToBgTilemapBufferRect(1, sBagListBgTiles[12 - frame], 11, 13 - frame, 18, 1); + CopyToBgTilemapBufferRect(1, &sItemListTilemap[(LIST_TILES_HEIGHT - row) * LIST_TILES_WIDTH], 11, 1 + LIST_TILES_HEIGHT - row, LIST_TILES_WIDTH, 1); ScheduleBgCopyTilemapToVram(1); }