diff options
| author | Yoann Fievez <yoann.fievez@gmail.com> | 2021-11-05 20:40:15 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-11-05 15:40:15 -0400 |
| commit | 8349bfd8e646002105dfd6a7f997c26cf0e0624b (patch) | |
| tree | 8586363ba32075ec9c7ddf07e384507679658b11 /engine/events | |
| parent | b44a10a43a1fa4a558b4c593d0a610571ecb3a50 (diff) | |
Refactorize check button pressed (#340)
Diffstat (limited to 'engine/events')
| -rw-r--r-- | engine/events/cinnabar_lab.asm | 2 | ||||
| -rw-r--r-- | engine/events/hidden_objects/bills_house_pc.asm | 2 | ||||
| -rw-r--r-- | engine/events/hidden_objects/school_blackboard.asm | 8 | ||||
| -rw-r--r-- | engine/events/prize_menu.asm | 2 | ||||
| -rw-r--r-- | engine/events/vending_machine.asm | 2 |
5 files changed, 8 insertions, 8 deletions
diff --git a/engine/events/cinnabar_lab.asm b/engine/events/cinnabar_lab.asm index 7cbb2cd5..547f782e 100644 --- a/engine/events/cinnabar_lab.asm +++ b/engine/events/cinnabar_lab.asm @@ -27,7 +27,7 @@ GiveFossilToCinnabarLab:: ld hl, wd730 res 6, [hl] call HandleMenuInput - bit 1, a ; pressed B? + bit BIT_B_BUTTON, a jr nz, .cancelledGivingFossil ld hl, wFilteredBagItems ld a, [wCurrentMenuItem] diff --git a/engine/events/hidden_objects/bills_house_pc.asm b/engine/events/hidden_objects/bills_house_pc.asm index a73596b4..6147387a 100644 --- a/engine/events/hidden_objects/bills_house_pc.asm +++ b/engine/events/hidden_objects/bills_house_pc.asm @@ -95,7 +95,7 @@ BillsHousePokemonList:: call PrintText call SaveScreenTilesToBuffer2 call HandleMenuInput - bit 1, a ; pressed b + bit BIT_B_BUTTON, a jr nz, .cancel ld a, [wCurrentMenuItem] add EEVEE diff --git a/engine/events/hidden_objects/school_blackboard.asm b/engine/events/hidden_objects/school_blackboard.asm index de4700d4..fd3c0b8f 100644 --- a/engine/events/hidden_objects/school_blackboard.asm +++ b/engine/events/hidden_objects/school_blackboard.asm @@ -36,7 +36,7 @@ LinkCableHelp:: ld hl, LinkCableHelpText2 call PrintText call HandleMenuInput - bit 1, a ; pressed b + bit BIT_B_BUTTON, a jr nz, .exit ld a, [wCurrentMenuItem] cp 3 ; pressed a on "STOP READING" @@ -122,9 +122,9 @@ ViridianSchoolBlackboard:: ld hl, ViridianSchoolBlackboardText2 call PrintText call HandleMenuInput ; pressing up and down is handled in here - bit 1, a ; pressed b + bit BIT_B_BUTTON, a ; pressed b jr nz, .exitBlackboard - bit 4, a ; pressed right + bit BIT_D_RIGHT, a jr z, .didNotPressRight ; move cursor to right column ld a, 2 @@ -137,7 +137,7 @@ ViridianSchoolBlackboard:: ld [wMenuItemOffset], a jr .blackboardLoop .didNotPressRight - bit 5, a ; pressed left + bit BIT_D_LEFT, a jr z, .didNotPressLeftOrRight ; move cursor to left column ld a, 2 diff --git a/engine/events/prize_menu.asm b/engine/events/prize_menu.asm index d9320fe7..bc3aab9a 100644 --- a/engine/events/prize_menu.asm +++ b/engine/events/prize_menu.asm @@ -31,7 +31,7 @@ CeladonPrizeMenu:: ld hl, WhichPrizeTextPtr call PrintText call HandleMenuInput ; menu choice handler - bit 1, a ; keypress = B (Cancel) + bit BIT_B_BUTTON, a jr nz, .noChoice ld a, [wCurrentMenuItem] cp 3 ; "NO,THANKS" choice diff --git a/engine/events/vending_machine.asm b/engine/events/vending_machine.asm index a67f1c07..980a45c5 100644 --- a/engine/events/vending_machine.asm +++ b/engine/events/vending_machine.asm @@ -31,7 +31,7 @@ VendingMachineMenu:: ld hl, wd730 res 6, [hl] call HandleMenuInput - bit 1, a ; pressed B? + bit BIT_B_BUTTON, a jr nz, .notThirsty ld a, [wCurrentMenuItem] cp 3 ; chose Cancel? |
