diff options
author | aaaaaa123456789 <aaaaaa123456789@acidch.at> | 2020-09-13 04:22:50 -0300 |
---|---|---|
committer | aaaaaa123456789 <aaaaaa123456789@acidch.at> | 2020-09-13 06:30:55 -0300 |
commit | 7dc95a0103af08c95c9093b6efa6c77af77a2538 (patch) | |
tree | 663537916626ab264bbdef4ea3606415457c36a3 /src/item_menu.c | |
parent | 58a2b62bae1406d2c768698ed13efcd6a5ffbeec (diff) |
Undo PokeCodec's PRs
This commit undoes most of PokeCodec's PRs after the debate in chat. Some
harmless or completely superseded PRs have been left alone, as there is not
much benefit in attempting to undo them.
Reverts #1104, #1108, #1115, #1118, #1119, #1124, #1126, #1127, #1132, #1136,
#1137, #1139, #1140, #1144, #1148, #1149, #1150, #1153, #1155, #1177, #1179,
#1180, #1181, #1182 and #1183.
Diffstat (limited to 'src/item_menu.c')
-rwxr-xr-x | src/item_menu.c | 43 |
1 files changed, 22 insertions, 21 deletions
diff --git a/src/item_menu.c b/src/item_menu.c index d40c3a12c..ace2fd11e 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -628,6 +628,7 @@ void CB2_Bag(void) bool8 SetupBagMenu(void) { + u32 index; u8 taskId; switch (gMain.state) @@ -1166,7 +1167,7 @@ void Task_BagMenu_HandleInput(u8 taskId) SwitchBagPocket(taskId, MENU_CURSOR_DELTA_RIGHT, 0); return; default: - if (JOY_NEW(SELECT_BUTTON)) + if (gMain.newKeys & SELECT_BUTTON) { if (CanSwapItems() == TRUE) { @@ -1228,12 +1229,12 @@ static u8 GetSwitchBagPocketDirection(void) if (gBagMenu->pocketSwitchDisabled) return SWITCH_POCKET_NONE; LRKeys = GetLRKeysPressed(); - if (JOY_NEW(DPAD_LEFT) || LRKeys == MENU_L_PRESSED) + if ((gMain.newKeys & DPAD_LEFT) || LRKeys == MENU_L_PRESSED) { PlaySE(SE_SELECT); return SWITCH_POCKET_LEFT; } - if (JOY_NEW(DPAD_RIGHT) || LRKeys == MENU_R_PRESSED) + if ((gMain.newKeys & DPAD_RIGHT) || LRKeys == MENU_R_PRESSED) { PlaySE(SE_SELECT); return SWITCH_POCKET_RIGHT; @@ -1387,7 +1388,7 @@ static void Task_HandleSwappingItemsInput(u8 taskId) if (MenuHelpers_CallLinkSomething() != TRUE) { - if (JOY_NEW(SELECT_BUTTON)) + if (gMain.newKeys & SELECT_BUTTON) { PlaySE(SE_SELECT); ListMenuGetScrollAndRow(data[0], &gBagPositionStruct.scrollPosition[gBagPositionStruct.pocket], &gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]); @@ -1405,7 +1406,7 @@ static void Task_HandleSwappingItemsInput(u8 taskId) break; case LIST_CANCEL: PlaySE(SE_SELECT); - if (JOY_NEW(A_BUTTON)) + if (gMain.newKeys & A_BUTTON) sub_81AC498(taskId); else sub_81AC590(taskId); @@ -1644,7 +1645,7 @@ void Task_HandleOutOfBattleItemMenuInput(u8 taskId) if (MenuHelpers_CallLinkSomething() != TRUE) { s8 cursorPos = Menu_GetCursorPos(); - if (JOY_NEW(DPAD_UP)) + if (gMain.newKeys & DPAD_UP) { if (cursorPos > 0 && sub_81ACDFC(cursorPos - 2)) { @@ -1652,7 +1653,7 @@ void Task_HandleOutOfBattleItemMenuInput(u8 taskId) ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP); } } - else if (JOY_NEW(DPAD_DOWN)) + else if (gMain.newKeys & DPAD_DOWN) { if (cursorPos < (gBagMenu->contextMenuNumItems - 2) && sub_81ACDFC(cursorPos + 2)) { @@ -1660,7 +1661,7 @@ void Task_HandleOutOfBattleItemMenuInput(u8 taskId) ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN); } } - else if ((JOY_NEW(DPAD_LEFT)) || GetLRKeysPressed() == MENU_L_PRESSED) + else if ((gMain.newKeys & DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED) { if ((cursorPos & 1) && sub_81ACDFC(cursorPos - 1)) { @@ -1668,7 +1669,7 @@ void Task_HandleOutOfBattleItemMenuInput(u8 taskId) ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE); } } - else if (JOY_NEW(DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED) + else if ((gMain.newKeys & DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED) { if (!(cursorPos & 1) && sub_81ACDFC(cursorPos + 1)) { @@ -1676,12 +1677,12 @@ void Task_HandleOutOfBattleItemMenuInput(u8 taskId) ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE); } } - else if (JOY_NEW(A_BUTTON)) + else if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); sItemMenuActions[gBagMenu->contextMenuItemsPtr[cursorPos]].func.void_u8(taskId); } - else if (JOY_NEW(B_BUTTON)) + else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); sItemMenuActions[ITEMMENUACTION_CANCEL].func.void_u8(taskId); @@ -1785,13 +1786,13 @@ void Task_ChooseHowManyToToss(u8 taskId) { PrintItemDepositAmount(gBagMenu->windowPointers[7], tItemCount); } - else if (JOY_NEW(A_BUTTON)) + else if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); BagMenu_RemoveWindow(7); BagMenu_TossItems(taskId); } - else if (JOY_NEW(B_BUTTON)) + else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); BagMenu_RemoveWindow(7); @@ -1817,7 +1818,7 @@ void Task_ActuallyToss(u8 taskId) u16* scrollPos = &gBagPositionStruct.scrollPosition[gBagPositionStruct.pocket]; u16* cursorPos = &gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]; - if (JOY_NEW(A_BUTTON | B_BUTTON)) + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { PlaySE(SE_SELECT); RemoveBagItem(gSpecialVar_ItemId, tItemCount); @@ -1885,7 +1886,7 @@ static void BagMenu_PrintItemCantBeHeld(u8 taskId) void sub_81AD350(u8 taskId) { - if (JOY_NEW(A_BUTTON)) + if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); BagMenu_InitListsMenu(taskId); @@ -2059,13 +2060,13 @@ static void Task_SellHowManyDialogueHandleInput(u8 taskId) { PrintItemSoldAmount(gBagMenu->windowPointers[8], tItemCount, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount); } - else if (JOY_NEW(A_BUTTON)) + else if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); BagMenu_RemoveWindow(8); DisplaySellItemPriceAndConfirm(taskId); } - else if (JOY_NEW(B_BUTTON)) + else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); BagMenu_PrintCursor_(data[0], 0); @@ -2107,7 +2108,7 @@ static void BagMenu_Sell_UpdateItemListAndMoney(u8 taskId) static void BagMenu_Sell_WaitForABPress(u8 taskId) { - if (JOY_NEW(A_BUTTON | B_BUTTON)) + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { PlaySE(SE_SELECT); RemoveMoneyWindow(); @@ -2143,13 +2144,13 @@ static void Task_ChooseHowManyToDeposit(u8 taskId) { PrintItemDepositAmount(gBagMenu->windowPointers[7], tItemCount); } - else if (JOY_NEW(A_BUTTON)) + else if (gMain.newKeys & A_BUTTON) { PlaySE(SE_SELECT); BagMenu_RemoveWindow(7); BagMenu_TryDepositItem(taskId); } - else if (JOY_NEW(B_BUTTON)) + else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); BagMenu_PrintDescription(data[1]); @@ -2188,7 +2189,7 @@ static void BagMenu_Deposit_WaitForABPress(u8 taskId) { s16* data = gTasks[taskId].data; - if (JOY_NEW(A_BUTTON | B_BUTTON)) + if (gMain.newKeys & (A_BUTTON | B_BUTTON)) { PlaySE(SE_SELECT); BagMenu_PrintDescription(data[1]); |