Switch to button macros
This commit is contained in:
@@ -1167,7 +1167,7 @@ void Task_BagMenu_HandleInput(u8 taskId)
|
||||
SwitchBagPocket(taskId, MENU_CURSOR_DELTA_RIGHT, 0);
|
||||
return;
|
||||
default:
|
||||
if (gMain.newKeys & SELECT_BUTTON)
|
||||
if (JOY_NEW(SELECT_BUTTON))
|
||||
{
|
||||
if (CanSwapItems() == TRUE)
|
||||
{
|
||||
@@ -1229,12 +1229,12 @@ static u8 GetSwitchBagPocketDirection(void)
|
||||
if (gBagMenu->pocketSwitchDisabled)
|
||||
return SWITCH_POCKET_NONE;
|
||||
LRKeys = GetLRKeysPressed();
|
||||
if ((gMain.newKeys & DPAD_LEFT) || LRKeys == MENU_L_PRESSED)
|
||||
if ((JOY_NEW(DPAD_LEFT)) || LRKeys == MENU_L_PRESSED)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
return SWITCH_POCKET_LEFT;
|
||||
}
|
||||
if ((gMain.newKeys & DPAD_RIGHT) || LRKeys == MENU_R_PRESSED)
|
||||
if ((JOY_NEW(DPAD_RIGHT)) || LRKeys == MENU_R_PRESSED)
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
return SWITCH_POCKET_RIGHT;
|
||||
@@ -1388,7 +1388,7 @@ static void Task_HandleSwappingItemsInput(u8 taskId)
|
||||
|
||||
if (MenuHelpers_CallLinkSomething() != TRUE)
|
||||
{
|
||||
if (gMain.newKeys & SELECT_BUTTON)
|
||||
if (JOY_NEW(SELECT_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
ListMenuGetScrollAndRow(data[0], &gBagPositionStruct.scrollPosition[gBagPositionStruct.pocket], &gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket]);
|
||||
@@ -1406,7 +1406,7 @@ static void Task_HandleSwappingItemsInput(u8 taskId)
|
||||
break;
|
||||
case LIST_CANCEL:
|
||||
PlaySE(SE_SELECT);
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
sub_81AC498(taskId);
|
||||
else
|
||||
sub_81AC590(taskId);
|
||||
@@ -1645,7 +1645,7 @@ void Task_HandleOutOfBattleItemMenuInput(u8 taskId)
|
||||
if (MenuHelpers_CallLinkSomething() != TRUE)
|
||||
{
|
||||
s8 cursorPos = Menu_GetCursorPos();
|
||||
if (gMain.newKeys & DPAD_UP)
|
||||
if (JOY_NEW(DPAD_UP))
|
||||
{
|
||||
if (cursorPos > 0 && sub_81ACDFC(cursorPos - 2))
|
||||
{
|
||||
@@ -1653,7 +1653,7 @@ void Task_HandleOutOfBattleItemMenuInput(u8 taskId)
|
||||
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_UP);
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & DPAD_DOWN)
|
||||
else if (JOY_NEW(DPAD_DOWN))
|
||||
{
|
||||
if (cursorPos < (gBagMenu->contextMenuNumItems - 2) && sub_81ACDFC(cursorPos + 2))
|
||||
{
|
||||
@@ -1661,7 +1661,7 @@ void Task_HandleOutOfBattleItemMenuInput(u8 taskId)
|
||||
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_NONE, MENU_CURSOR_DELTA_DOWN);
|
||||
}
|
||||
}
|
||||
else if ((gMain.newKeys & DPAD_LEFT) || GetLRKeysPressed() == MENU_L_PRESSED)
|
||||
else if ((JOY_NEW(DPAD_LEFT)) || GetLRKeysPressed() == MENU_L_PRESSED)
|
||||
{
|
||||
if ((cursorPos & 1) && sub_81ACDFC(cursorPos - 1))
|
||||
{
|
||||
@@ -1669,7 +1669,7 @@ void Task_HandleOutOfBattleItemMenuInput(u8 taskId)
|
||||
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_LEFT, MENU_CURSOR_DELTA_NONE);
|
||||
}
|
||||
}
|
||||
else if ((gMain.newKeys & DPAD_RIGHT) || GetLRKeysPressed() == MENU_R_PRESSED)
|
||||
else if ((JOY_NEW(DPAD_RIGHT)) || GetLRKeysPressed() == MENU_R_PRESSED)
|
||||
{
|
||||
if (!(cursorPos & 1) && sub_81ACDFC(cursorPos + 1))
|
||||
{
|
||||
@@ -1677,12 +1677,12 @@ void Task_HandleOutOfBattleItemMenuInput(u8 taskId)
|
||||
ChangeListMenuCursorPosition(MENU_CURSOR_DELTA_RIGHT, MENU_CURSOR_DELTA_NONE);
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & A_BUTTON)
|
||||
else if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sItemMenuActions[gBagMenu->contextMenuItemsPtr[cursorPos]].func.void_u8(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sItemMenuActions[ITEMMENUACTION_CANCEL].func.void_u8(taskId);
|
||||
@@ -1786,13 +1786,13 @@ void Task_ChooseHowManyToToss(u8 taskId)
|
||||
{
|
||||
PrintItemDepositAmount(gBagMenu->windowPointers[7], tItemCount);
|
||||
}
|
||||
else if (gMain.newKeys & A_BUTTON)
|
||||
else if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
BagMenu_RemoveWindow(7);
|
||||
BagMenu_TossItems(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
BagMenu_RemoveWindow(7);
|
||||
@@ -1818,7 +1818,7 @@ void Task_ActuallyToss(u8 taskId)
|
||||
u16* scrollPos = &gBagPositionStruct.scrollPosition[gBagPositionStruct.pocket];
|
||||
u16* cursorPos = &gBagPositionStruct.cursorPosition[gBagPositionStruct.pocket];
|
||||
|
||||
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
RemoveBagItem(gSpecialVar_ItemId, tItemCount);
|
||||
@@ -1886,7 +1886,7 @@ static void BagMenu_PrintItemCantBeHeld(u8 taskId)
|
||||
|
||||
void sub_81AD350(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
BagMenu_InitListsMenu(taskId);
|
||||
@@ -2060,13 +2060,13 @@ static void Task_SellHowManyDialogueHandleInput(u8 taskId)
|
||||
{
|
||||
PrintItemSoldAmount(gBagMenu->windowPointers[8], tItemCount, (ItemId_GetPrice(gSpecialVar_ItemId) / 2) * tItemCount);
|
||||
}
|
||||
else if (gMain.newKeys & A_BUTTON)
|
||||
else if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
BagMenu_RemoveWindow(8);
|
||||
DisplaySellItemPriceAndConfirm(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
BagMenu_PrintCursor_(data[0], 0);
|
||||
@@ -2108,7 +2108,7 @@ static void BagMenu_Sell_UpdateItemListAndMoney(u8 taskId)
|
||||
|
||||
static void BagMenu_Sell_WaitForABPress(u8 taskId)
|
||||
{
|
||||
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
RemoveMoneyWindow();
|
||||
@@ -2144,13 +2144,13 @@ static void Task_ChooseHowManyToDeposit(u8 taskId)
|
||||
{
|
||||
PrintItemDepositAmount(gBagMenu->windowPointers[7], tItemCount);
|
||||
}
|
||||
else if (gMain.newKeys & A_BUTTON)
|
||||
else if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
BagMenu_RemoveWindow(7);
|
||||
BagMenu_TryDepositItem(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
BagMenu_PrintDescription(data[1]);
|
||||
@@ -2189,7 +2189,7 @@ static void BagMenu_Deposit_WaitForABPress(u8 taskId)
|
||||
{
|
||||
s16* data = gTasks[taskId].data;
|
||||
|
||||
if (gMain.newKeys & (A_BUTTON | B_BUTTON))
|
||||
if (JOY_NEW(A_BUTTON | B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
BagMenu_PrintDescription(data[1]);
|
||||
|
||||
Reference in New Issue
Block a user