summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authormid-kid <esteve.varela@gmail.com>2019-06-09 02:31:24 +0200
committermid-kid <esteve.varela@gmail.com>2019-06-09 02:31:24 +0200
commitc048b24d255f5f5ac71f5e9d2f4d4864a06edeaf (patch)
tree5078ac0d0b7c74c82bf1b18d7e33c92882e6f572 /engine
parent6b3735340604670d5fe1bfe4a31e59ad5c7bfb02 (diff)
Create constants for ScrollingMenu item formats
...I should've done this quite a while ago.
Diffstat (limited to 'engine')
-rw-r--r--engine/events/buena.asm2
-rw-r--r--engine/events/elevator.asm2
-rw-r--r--engine/events/kurt.asm4
-rw-r--r--engine/events/pokecenter_pc.asm4
-rw-r--r--engine/items/mart.asm2
-rw-r--r--engine/items/pack.asm12
-rw-r--r--engine/items/switch_items.asm28
-rw-r--r--engine/menus/scrolling_menu.asm6
-rw-r--r--engine/overworld/decorations.asm2
-rw-r--r--engine/pokemon/bills_pc.asm6
-rw-r--r--engine/pokemon/mail.asm4
11 files changed, 37 insertions, 35 deletions
diff --git a/engine/events/buena.asm b/engine/events/buena.asm
index 97a28549b..3e78dfa91 100644
--- a/engine/events/buena.asm
+++ b/engine/events/buena.asm
@@ -263,7 +263,7 @@ Buena_PrizeMenu:
.MenuData:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 13 ; rows, columns
- db 1 ; spacing
+ db SCROLLINGMENU_ITEMS_NORMAL ; item format
dba .indices
dba .prizeitem
dba .prizepoints
diff --git a/engine/events/elevator.asm b/engine/events/elevator.asm
index 37de3f1b6..8394cf442 100644
--- a/engine/events/elevator.asm
+++ b/engine/events/elevator.asm
@@ -184,7 +184,7 @@ Elevator_MenuHeader:
Elevator_MenuData:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 4, 0 ; rows, columns
- db 1 ; horizontal spacing
+ db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wCurElevator
dba GetElevatorFloorStrings
dba NULL
diff --git a/engine/events/kurt.asm b/engine/events/kurt.asm
index 234e5f424..3dd700dbb 100644
--- a/engine/events/kurt.asm
+++ b/engine/events/kurt.asm
@@ -87,8 +87,8 @@ Kurt_SelectApricorn:
.MenuData:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
- db 4, 7
- db 1
+ db 4, 7 ; rows, columns
+ db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wBuffer1
dba .Name
dba .Quantity
diff --git a/engine/events/pokecenter_pc.asm b/engine/events/pokecenter_pc.asm
index 452d28306..fa06d971e 100644
--- a/engine/events/pokecenter_pc.asm
+++ b/engine/events/pokecenter_pc.asm
@@ -625,8 +625,8 @@ PCItemsJoypad:
.MenuData:
db SCROLLINGMENU_ENABLE_SELECT | SCROLLINGMENU_ENABLE_FUNCTION3 | SCROLLINGMENU_DISPLAY_ARROWS ; flags
- db 4, 8 ; rows/cols?
- db 2 ; horizontal spacing?
+ db 4, 8 ; rows, columns
+ db SCROLLINGMENU_ITEMS_QUANTITY ; item format
dbw 0, wNumPCItems
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
diff --git a/engine/items/mart.asm b/engine/items/mart.asm
index 6341e9e6e..0209aac23 100644
--- a/engine/items/mart.asm
+++ b/engine/items/mart.asm
@@ -600,7 +600,7 @@ MenuHeader_Buy:
.MenuData
db SCROLLINGMENU_DISPLAY_ARROWS | SCROLLINGMENU_ENABLE_FUNCTION3 ; flags
db 4, 8 ; rows, columns
- db 1 ; horizontal spacing
+ db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wCurMart
dba PlaceMenuItemName
dba .PrintBCDPrices
diff --git a/engine/items/pack.asm b/engine/items/pack.asm
index 268a013bc..d5d331720 100644
--- a/engine/items/pack.asm
+++ b/engine/items/pack.asm
@@ -1465,7 +1465,7 @@ ItemsPocketMenuHeader:
.MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
- db 2 ; horizontal spacing
+ db SCROLLINGMENU_ITEMS_QUANTITY ; item format
dbw 0, wNumItems
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
@@ -1480,7 +1480,7 @@ PC_Mart_ItemsPocketMenuHeader:
.MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns
- db 2 ; horizontal spacing
+ db SCROLLINGMENU_ITEMS_QUANTITY ; item format
dbw 0, wNumItems
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
@@ -1495,7 +1495,7 @@ KeyItemsPocketMenuHeader:
.MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
- db 1 ; horizontal spacing
+ db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wNumKeyItems
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
@@ -1510,7 +1510,7 @@ PC_Mart_KeyItemsPocketMenuHeader:
.MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns
- db 1 ; horizontal spacing
+ db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wNumKeyItems
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
@@ -1525,7 +1525,7 @@ BallsPocketMenuHeader:
.MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP | STATICMENU_CURSOR ; flags
db 5, 8 ; rows, columns
- db 2 ; horizontal spacing
+ db SCROLLINGMENU_ITEMS_QUANTITY ; item format
dbw 0, wNumBalls
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
@@ -1540,7 +1540,7 @@ PC_Mart_BallsPocketMenuHeader:
.MenuData:
db STATICMENU_ENABLE_SELECT | STATICMENU_ENABLE_LEFT_RIGHT | STATICMENU_ENABLE_START | STATICMENU_WRAP ; flags
db 5, 8 ; rows, columns
- db 2 ; horizontal spacing
+ db SCROLLINGMENU_ITEMS_QUANTITY ; item format
dbw 0, wNumBalls
dba PlaceMenuItemName
dba PlaceMenuItemQuantity
diff --git a/engine/items/switch_items.asm b/engine/items/switch_items.asm
index 81b5ac6a5..10fe535b3 100644
--- a/engine/items/switch_items.asm
+++ b/engine/items/switch_items.asm
@@ -48,7 +48,7 @@ SwitchItemsInBag:
call ItemSwitch_GetNthItem
dec hl
push hl
- call ItemSwitch_ConvertSpacingToDW
+ call ItemSwitch_ConvertItemFormatToDW
add hl, bc
ld d, h
ld e, l
@@ -74,7 +74,7 @@ SwitchItemsInBag:
call ItemSwitch_GetNthItem
ld d, h
ld e, l
- call ItemSwitch_ConvertSpacingToDW
+ call ItemSwitch_ConvertItemFormatToDW
add hl, bc
pop bc
call CopyBytes
@@ -162,7 +162,7 @@ Function249d1:
.asm_24a25
dec [hl]
- call ItemSwitch_ConvertSpacingToDW
+ call ItemSwitch_ConvertItemFormatToDW
push bc
ld a, [wSwitchItem]
call ItemSwitch_GetNthItem
@@ -183,7 +183,7 @@ Function249d1:
Function24a40:
call ItemSwitch_GetNthItem
ld de, wd002
- call ItemSwitch_ConvertSpacingToDW
+ call ItemSwitch_ConvertItemFormatToDW
call CopyBytes
ret
@@ -192,13 +192,13 @@ Function24a4d:
ld d, h
ld e, l
ld hl, wd002
- call ItemSwitch_ConvertSpacingToDW
+ call ItemSwitch_ConvertItemFormatToDW
call CopyBytes
ret
ItemSwitch_GetNthItem:
push af
- call ItemSwitch_ConvertSpacingToDW
+ call ItemSwitch_ConvertItemFormatToDW
ld hl, wMenuData_ItemsPointerAddr
ld a, [hli]
ld h, [hl]
@@ -210,7 +210,7 @@ ItemSwitch_GetNthItem:
Function24a6c:
push hl
- call ItemSwitch_ConvertSpacingToDW
+ call ItemSwitch_ConvertItemFormatToDW
ld a, d
sub e
jr nc, .dont_negate
@@ -224,13 +224,13 @@ Function24a6c:
pop hl
ret
-ItemSwitch_ConvertSpacingToDW:
+ItemSwitch_ConvertItemFormatToDW:
; This function is absolutely idiotic.
push hl
- ld a, [wMenuData_ScrollingMenuSpacing]
+ ld a, [wMenuData_ScrollingMenuItemFormat]
ld c, a
ld b, 0
- ld hl, .spacing_dws
+ ld hl, .format_dws
add hl, bc
add hl, bc
ld c, [hl]
@@ -239,12 +239,14 @@ ItemSwitch_ConvertSpacingToDW:
pop hl
ret
-.spacing_dws
- dw 0, 1, 2
+.format_dws
+ dw 0
+ dw 1
+ dw 2
Function24a97:
push af
- call ItemSwitch_ConvertSpacingToDW
+ call ItemSwitch_ConvertItemFormatToDW
ld a, c
cp 2
jr nz, .not_2
diff --git a/engine/menus/scrolling_menu.asm b/engine/menus/scrolling_menu.asm
index e47d656bc..b26442dc7 100644
--- a/engine/menus/scrolling_menu.asm
+++ b/engine/menus/scrolling_menu.asm
@@ -497,10 +497,10 @@ ScrollingMenu_GetListItemCoordAndFunctionArgs:
ld h, [hl]
ld l, a
inc hl ; items
- ld a, [wMenuData_ScrollingMenuSpacing]
- cp 1
+ ld a, [wMenuData_ScrollingMenuItemFormat]
+ cp SCROLLINGMENU_ITEMS_NORMAL
jr z, .got_spacing
- cp 2
+ cp SCROLLINGMENU_ITEMS_QUANTITY
jr z, .pointless_jump
.pointless_jump
add hl, de
diff --git a/engine/overworld/decorations.asm b/engine/overworld/decorations.asm
index c601b65c3..3b40641f3 100644
--- a/engine/overworld/decorations.asm
+++ b/engine/overworld/decorations.asm
@@ -409,7 +409,7 @@ PopulateDecoCategoryMenu:
.ScrollingMenuData:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
db 8, 0 ; rows, columns
- db 1 ; horizontal spacing
+ db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wd002 ; text pointer
dba DecorationMenuFunction
dbw 0, 0
diff --git a/engine/pokemon/bills_pc.asm b/engine/pokemon/bills_pc.asm
index 8dcde72fc..162c94887 100644
--- a/engine/pokemon/bills_pc.asm
+++ b/engine/pokemon/bills_pc.asm
@@ -2269,9 +2269,9 @@ _ChangeBox_MenuHeader:
db 1 ; default option
.MenuData
- db MENU_UNUSED_1 | MENU_UNUSED_3 ; flags
- db 4, 0
- db 1
+ db SCROLLINGMENU_CALL_FUNCTION3_NO_SWITCH | SCROLLINGMENU_ENABLE_FUNCTION3 ; flags
+ db 4, 0 ; rows, columns
+ db SCROLLINGMENU_ITEMS_NORMAL ; item format
dba .boxes
dba .boxnames
dba NULL
diff --git a/engine/pokemon/mail.asm b/engine/pokemon/mail.asm
index 04c9a98e2..f89a51944 100644
--- a/engine/pokemon/mail.asm
+++ b/engine/pokemon/mail.asm
@@ -543,8 +543,8 @@ MailboxPC:
.TopMenuData:
db SCROLLINGMENU_DISPLAY_ARROWS ; flags
- db 4, 0 ; rows/columns?
- db 1 ; horizontal spacing?
+ db 4, 0 ; rows, columns
+ db SCROLLINGMENU_ITEMS_NORMAL ; item format
dbw 0, wMailboxCount ; text pointer
dba MailboxPC_PrintMailAuthor
dba NULL