summaryrefslogtreecommitdiff
path: root/engine/menus/text_box.asm
diff options
context:
space:
mode:
authorYoann Fievez <yoann.fievez@gmail.com>2021-11-05 20:40:15 +0100
committerGitHub <noreply@github.com>2021-11-05 15:40:15 -0400
commit8349bfd8e646002105dfd6a7f997c26cf0e0624b (patch)
tree8586363ba32075ec9c7ddf07e384507679658b11 /engine/menus/text_box.asm
parentb44a10a43a1fa4a558b4c593d0a610571ecb3a50 (diff)
Refactorize check button pressed (#340)
Diffstat (limited to 'engine/menus/text_box.asm')
-rw-r--r--engine/menus/text_box.asm10
1 files changed, 5 insertions, 5 deletions
diff --git a/engine/menus/text_box.asm b/engine/menus/text_box.asm
index 5253ec48..cdb8841d 100644
--- a/engine/menus/text_box.asm
+++ b/engine/menus/text_box.asm
@@ -174,9 +174,9 @@ DoBuySellQuitMenu:
ld [wd730], a
call HandleMenuInput
call PlaceUnfilledArrowMenuCursor
- bit 0, a ; was A pressed?
+ bit BIT_A_BUTTON, a
jr nz, .pressedA
- bit 1, a ; was B pressed? (always true since only A/B are watched)
+ bit BIT_B_BUTTON, a ; always true since only A/B are watched
jr z, .pressedA
ld a, CANCELLED_MENU
ld [wMenuExitMethod], a
@@ -296,8 +296,8 @@ DisplayTwoOptionMenu:
pop hl
.noYesMenuInputLoop
call HandleMenuInput
- bit 1, a ; A button pressed?
- jr nz, .noYesMenuInputLoop ; try again if A was not pressed
+ bit BIT_B_BUTTON, a
+ jr nz, .noYesMenuInputLoop ; try again if B was not pressed
pop af
pop hl
ld [wFlags_0xcd60], a
@@ -309,7 +309,7 @@ DisplayTwoOptionMenu:
ld [wTwoOptionMenuID], a
call HandleMenuInput
pop hl
- bit 1, a ; A button pressed?
+ bit BIT_B_BUTTON, a
jr nz, .choseSecondMenuItem ; automatically choose the second option if B is pressed
.pressedAButton
ld a, [wCurrentMenuItem]