Switch to button macros
This commit is contained in:
@@ -1478,7 +1478,7 @@ static void Task_HandleSelectionScreenYesNo(u8 taskId)
|
||||
gTasks[taskId].data[0] = 5;
|
||||
break;
|
||||
case 5:
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if (sFactorySelectScreen->yesNoCursorPos == 0)
|
||||
@@ -1496,7 +1496,7 @@ static void Task_HandleSelectionScreenYesNo(u8 taskId)
|
||||
gTasks[taskId].func = Task_HandleSelectionScreenChooseMons;
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sub_819B958(4);
|
||||
@@ -1505,12 +1505,12 @@ static void Task_HandleSelectionScreenYesNo(u8 taskId)
|
||||
gTasks[taskId].data[0] = 1;
|
||||
gTasks[taskId].func = Task_HandleSelectionScreenChooseMons;
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_UP)
|
||||
else if (JOY_REPEAT(DPAD_UP))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Select_UpdateYesNoCursorPosition(-1);
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
|
||||
else if (JOY_REPEAT(DPAD_DOWN))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Select_UpdateYesNoCursorPosition(1);
|
||||
@@ -1538,7 +1538,7 @@ static void Task_HandleSelectionScreenMenu(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
u8 retVal;
|
||||
PlaySE(SE_SELECT);
|
||||
@@ -1565,7 +1565,7 @@ static void Task_HandleSelectionScreenMenu(u8 taskId)
|
||||
gTasks[taskId].func = Task_FromSelectScreenToSummaryScreen;
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sub_819F3F8(sFactorySelectScreen->unk294[1], &sFactorySelectScreen->unk2A0, FALSE);
|
||||
@@ -1574,12 +1574,12 @@ static void Task_HandleSelectionScreenMenu(u8 taskId)
|
||||
gTasks[taskId].data[0] = 1;
|
||||
gTasks[taskId].func = Task_HandleSelectionScreenChooseMons;
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_UP)
|
||||
else if (JOY_REPEAT(DPAD_UP))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Select_UpdateMenuCursorPosition(-1);
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
|
||||
else if (JOY_REPEAT(DPAD_DOWN))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Select_UpdateMenuCursorPosition(1);
|
||||
@@ -1618,21 +1618,21 @@ static void Task_HandleSelectionScreenChooseMons(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sFactorySelectScreen->unk2A2 = FALSE;
|
||||
gTasks[taskId].data[0] = 2;
|
||||
gTasks[taskId].func = Task_HandleSelectionScreenMenu;
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_LEFT)
|
||||
else if (JOY_REPEAT(DPAD_LEFT))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Select_UpdateBallCursorPosition(-1);
|
||||
Select_PrintMonCategory();
|
||||
Select_PrintMonSpecies();
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_RIGHT)
|
||||
else if (JOY_REPEAT(DPAD_RIGHT))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Select_UpdateBallCursorPosition(1);
|
||||
@@ -1641,7 +1641,7 @@ static void Task_HandleSelectionScreenChooseMons(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 11:
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sub_819F3F8(sFactorySelectScreen->unk294[1], &sFactorySelectScreen->unk2A0, FALSE);
|
||||
@@ -2361,7 +2361,7 @@ static void Task_HandleSwapScreenYesNo(u8 taskId)
|
||||
gTasks[taskId].data[0] = 5;
|
||||
break;
|
||||
case 5:
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
if (sFactorySwapScreen->yesNoCursorPos == 0)
|
||||
@@ -2380,7 +2380,7 @@ static void Task_HandleSwapScreenYesNo(u8 taskId)
|
||||
gTasks[taskId].func = (void*)((hiPtr << 16) | loPtr);
|
||||
}
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
gTasks[taskId].data[1] = 0;
|
||||
@@ -2389,12 +2389,12 @@ static void Task_HandleSwapScreenYesNo(u8 taskId)
|
||||
loPtr = gTasks[taskId].data[7];
|
||||
gTasks[taskId].func = (void*)((hiPtr << 16) | loPtr);
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_UP)
|
||||
else if (JOY_REPEAT(DPAD_UP))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Swap_UpdateYesNoCursorPosition(-1);
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
|
||||
else if (JOY_REPEAT(DPAD_DOWN))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Swap_UpdateYesNoCursorPosition(1);
|
||||
@@ -2485,12 +2485,12 @@ static void Task_HandleSwapScreenMenu(u8 taskId)
|
||||
case 3:
|
||||
if (sFactorySwapScreen->unk30 != TRUE)
|
||||
{
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
Swap_RunMenuOptionFunc(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sub_819F3F8(sFactorySwapScreen->unk2C, &sFactorySwapScreen->unk30, TRUE);
|
||||
@@ -2501,11 +2501,11 @@ static void Task_HandleSwapScreenMenu(u8 taskId)
|
||||
gTasks[taskId].data[5] = 1;
|
||||
gTasks[taskId].func = sub_819D770;
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_UP)
|
||||
else if (JOY_REPEAT(DPAD_UP))
|
||||
{
|
||||
Swap_UpdateMenuCursorPosition(-1);
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
|
||||
else if (JOY_REPEAT(DPAD_DOWN))
|
||||
{
|
||||
Swap_UpdateMenuCursorPosition(1);
|
||||
}
|
||||
@@ -2526,7 +2526,7 @@ static void Task_HandleSwapScreenChooseMons(u8 taskId)
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (gMain.newKeys & A_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sFactorySwapScreen->unk22 = FALSE;
|
||||
@@ -2534,7 +2534,7 @@ static void Task_HandleSwapScreenChooseMons(u8 taskId)
|
||||
sub_819EAC0();
|
||||
Swap_RunActionFunc(taskId);
|
||||
}
|
||||
else if (gMain.newKeys & B_BUTTON)
|
||||
else if (JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sFactorySwapScreen->unk22 = FALSE;
|
||||
@@ -2546,25 +2546,25 @@ static void Task_HandleSwapScreenChooseMons(u8 taskId)
|
||||
gTasks[taskId].data[5] = 0;
|
||||
gTasks[taskId].func = sub_819D588;
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_LEFT)
|
||||
else if (JOY_REPEAT(DPAD_LEFT))
|
||||
{
|
||||
Swap_UpdateBallCursorPosition(-1);
|
||||
Swap_PrintMonCategory();
|
||||
Swap_PrintMonSpecies();
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_RIGHT)
|
||||
else if (JOY_REPEAT(DPAD_RIGHT))
|
||||
{
|
||||
Swap_UpdateBallCursorPosition(1);
|
||||
Swap_PrintMonCategory();
|
||||
Swap_PrintMonSpecies();
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_DOWN)
|
||||
else if (JOY_REPEAT(DPAD_DOWN))
|
||||
{
|
||||
Swap_UpdateActionCursorPosition(1);
|
||||
Swap_PrintMonCategory();
|
||||
Swap_PrintMonSpecies();
|
||||
}
|
||||
else if (gMain.newAndRepeatedKeys & DPAD_UP)
|
||||
else if (JOY_REPEAT(DPAD_UP))
|
||||
{
|
||||
Swap_UpdateActionCursorPosition(-1);
|
||||
Swap_PrintMonCategory();
|
||||
@@ -3929,7 +3929,7 @@ static void Task_SwapCantHaveSameMons(u8 taskId)
|
||||
gTasks[taskId].data[0]++;
|
||||
break;
|
||||
case 1:
|
||||
if (gMain.newKeys & A_BUTTON || gMain.newKeys & B_BUTTON)
|
||||
if (JOY_NEW(A_BUTTON) || JOY_NEW(B_BUTTON))
|
||||
{
|
||||
PlaySE(SE_SELECT);
|
||||
sub_819F3F8(sFactorySwapScreen->unk2C, &sFactorySwapScreen->unk30, TRUE);
|
||||
|
||||
Reference in New Issue
Block a user