diff options
author | PokeCodec <67983839+PokeCodec@users.noreply.github.com> | 2020-09-04 21:11:55 -0400 |
---|---|---|
committer | PokeCodec <67983839+PokeCodec@users.noreply.github.com> | 2020-09-04 21:11:55 -0400 |
commit | 28ef2fb774bf596a3e7f81055453304e0d2ce066 (patch) | |
tree | 4a67ad17888cac15c7cb33fa8aced60a2e3bf6dc /src/battle_dome.c | |
parent | da582d5258703eb52d8cadb4cbaef4ee7031b833 (diff) |
Switch to button macros
Diffstat (limited to 'src/battle_dome.c')
-rw-r--r-- | src/battle_dome.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/battle_dome.c b/src/battle_dome.c index 7b0311661..2f6df5dca 100644 --- a/src/battle_dome.c +++ b/src/battle_dome.c @@ -4111,7 +4111,7 @@ static u8 Task_GetInfoCardInput(u8 taskId) u8 tourneyId = sTourneyTreeTrainerIds[position]; u16 roundId = gSaveBlock2Ptr->frontier.curChallengeBattleNum; - if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + if (JOY_NEW(A_BUTTON | B_BUTTON)) input = INFOCARD_INPUT_AB; // Next opponent card cant scroll @@ -4122,7 +4122,7 @@ static u8 Task_GetInfoCardInput(u8 taskId) { // For trainer info cards, pos is 0 when on a trainer info card (not viewing that trainer's match progression) // Scrolling up/down from a trainer info card goes to other trainer info cards - if (gMain.newKeys & DPAD_UP && sInfoCard->pos == 0) + if (JOY_NEW(DPAD_UP) && sInfoCard->pos == 0) { if (position == 0) position = DOME_TOURNAMENT_TRAINERS_COUNT - 1; @@ -4130,7 +4130,7 @@ static u8 Task_GetInfoCardInput(u8 taskId) position--; input = TRAINERCARD_INPUT_UP; } - else if (gMain.newKeys & DPAD_DOWN && sInfoCard->pos == 0) + else if (JOY_NEW(DPAD_DOWN) && sInfoCard->pos == 0) { if (position == DOME_TOURNAMENT_TRAINERS_COUNT - 1) position = 0; @@ -4139,13 +4139,13 @@ static u8 Task_GetInfoCardInput(u8 taskId) input = TRAINERCARD_INPUT_DOWN; } // Scrolling left can only be done after scrolling right - else if (gMain.newKeys & DPAD_LEFT && sInfoCard->pos != 0) + else if (JOY_NEW(DPAD_LEFT) && sInfoCard->pos != 0) { sInfoCard->pos--; input = TRAINERCARD_INPUT_LEFT; } // Scrolling right from a trainer info card shows their match progression - else if (gMain.newKeys & DPAD_RIGHT) + else if (JOY_NEW(DPAD_RIGHT)) { // Can only scroll right from a trainer card until the round they were eliminated if (DOME_TRAINERS[tourneyId].isEliminated && sInfoCard->pos - 1 < DOME_TRAINERS[tourneyId].eliminatedAt) @@ -4173,7 +4173,7 @@ static u8 Task_GetInfoCardInput(u8 taskId) { // For match info cards, pos is 1 when on the match card, 0 when on the left trainer, and 1 when on the right trainer // Scrolling up/down from a match info card goes to the next/previous match - if (gMain.newKeys & DPAD_UP && sInfoCard->pos == 1) + if (JOY_NEW(DPAD_UP) && sInfoCard->pos == 1) { if (position == DOME_TOURNAMENT_TRAINERS_COUNT) position = sLastMatchCardNum[roundId]; @@ -4181,7 +4181,7 @@ static u8 Task_GetInfoCardInput(u8 taskId) position--; input = MATCHCARD_INPUT_UP; } - else if (gMain.newKeys & DPAD_DOWN && sInfoCard->pos == 1) + else if (JOY_NEW(DPAD_DOWN) && sInfoCard->pos == 1) { if (position == sLastMatchCardNum[roundId]) position = DOME_TOURNAMENT_TRAINERS_COUNT; @@ -4190,12 +4190,12 @@ static u8 Task_GetInfoCardInput(u8 taskId) input = MATCHCARD_INPUT_DOWN; } // Scrolling left/right from a match info card shows the trainer info card of the competitors for that match - else if (gMain.newKeys & DPAD_LEFT && sInfoCard->pos != 0) + else if (JOY_NEW(DPAD_LEFT) && sInfoCard->pos != 0) { input = MATCHCARD_INPUT_LEFT; sInfoCard->pos--; } - else if (gMain.newKeys & DPAD_RIGHT && (sInfoCard->pos == 0 || sInfoCard->pos == 1)) + else if (JOY_NEW(DPAD_RIGHT) && (sInfoCard->pos == 0 || sInfoCard->pos == 1)) { input = MATCHCARD_INPUT_RIGHT; sInfoCard->pos++; @@ -5043,12 +5043,12 @@ static u8 UpdateTourneyTreeCursor(u8 taskId) int tourneyTreeCursorSpriteId = gTasks[taskId].data[1]; int roundId = gSaveBlock2Ptr->frontier.curChallengeBattleNum; - if (gMain.newKeys == B_BUTTON || (gMain.newKeys & A_BUTTON && tourneyTreeCursorSpriteId == TOURNEY_TREE_CLOSE_BUTTON)) + if (gMain.newKeys == B_BUTTON || (JOY_NEW(A_BUTTON) && tourneyTreeCursorSpriteId == TOURNEY_TREE_CLOSE_BUTTON)) { PlaySE(SE_SELECT); selection = TOURNEY_TREE_SELECTED_CLOSE; } - else if (gMain.newKeys & A_BUTTON) + else if (JOY_NEW(A_BUTTON)) { if (tourneyTreeCursorSpriteId < DOME_TOURNAMENT_TRAINERS_COUNT) { @@ -5552,7 +5552,7 @@ static void Task_HandleStaticTourneyTreeInput(u8 taskId) gTasks[taskId].tState = STATE_WAIT_FOR_INPUT; break; case STATE_WAIT_FOR_INPUT: - if (gMain.newKeys & (A_BUTTON | B_BUTTON)) + if (JOY_NEW(A_BUTTON | B_BUTTON)) { BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); gTasks[taskId].tState = STATE_CLOSE_TOURNEY_TREE; |