Refactorize check button pressed (#340)

This commit is contained in:
Yoann Fievez 2021-11-05 20:40:15 +01:00 committed by GitHub
parent b44a10a43a
commit 8349bfd8e6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
23 changed files with 71 additions and 71 deletions

View file

@ -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]

View file

@ -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

View file

@ -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

View file

@ -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

View file

@ -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?