summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/battle_pyramid_bag.c2
-rw-r--r--src/item_menu_icons.c2
-rw-r--r--src/menu_helpers.c10
3 files changed, 9 insertions, 5 deletions
diff --git a/src/battle_pyramid_bag.c b/src/battle_pyramid_bag.c
index 83bf35090..9cc65e14d 100644
--- a/src/battle_pyramid_bag.c
+++ b/src/battle_pyramid_bag.c
@@ -1608,5 +1608,5 @@ static void SetSwapLineInvisibility(bool8 invisible)
static void UpdateSwapLinePos(u8 y)
{
- UpdateSwapLineSpritesPos(&gPyramidBagMenu->spriteIds[PBAG_SPRITE_SWAP_LINE_START], NUM_SWAP_LINE_SPRITES | 0x80, 120, (y + 1) * 16);
+ UpdateSwapLineSpritesPos(&gPyramidBagMenu->spriteIds[PBAG_SPRITE_SWAP_LINE_START], NUM_SWAP_LINE_SPRITES | SWAP_LINE_HAS_MARGIN, 120, (y + 1) * 16);
}
diff --git a/src/item_menu_icons.c b/src/item_menu_icons.c
index c8d1cd8d0..8bcf506fb 100644
--- a/src/item_menu_icons.c
+++ b/src/item_menu_icons.c
@@ -559,7 +559,7 @@ void SetItemMenuSwapLineInvisibility(bool8 invisible)
void UpdateItemMenuSwapLinePos(u8 y)
{
- UpdateSwapLineSpritesPos(&gBagMenu->spriteIds[ITEMMENUSPRITE_SWAP_LINE], ITEMMENU_SWAP_LINE_LENGTH | 0x80, 120, (y + 1) * 16);
+ UpdateSwapLineSpritesPos(&gBagMenu->spriteIds[ITEMMENUSPRITE_SWAP_LINE], ITEMMENU_SWAP_LINE_LENGTH | SWAP_LINE_HAS_MARGIN, 120, (y + 1) * 16);
}
static void sub_80D5018(void *mem0, void *mem1)
diff --git a/src/menu_helpers.c b/src/menu_helpers.c
index 3e8148a42..95b67f78c 100644
--- a/src/menu_helpers.c
+++ b/src/menu_helpers.c
@@ -440,12 +440,16 @@ void SetSwapLineSpritesInvisibility(u8 *spriteIds, u8 count, bool8 invisible)
void UpdateSwapLineSpritesPos(u8 *spriteIds, u8 count, s16 x, u16 y)
{
u8 i;
- bool8 unknownBit = count & 0x80;
- count &= ~(0x80);
+ bool8 hasMargin = count & SWAP_LINE_HAS_MARGIN;
+ count &= ~SWAP_LINE_HAS_MARGIN;
for (i = 0; i < count; i++)
{
- if (i == count - 1 && unknownBit)
+ // If the list menu has a right margin, the swap line
+ // shouldn't extend all the way to the edge of the screen.
+ // If this is the last sprite in the line, move it a bit
+ // to the left to keep it out of the margin.
+ if (i == count - 1 && hasMargin)
gSprites[spriteIds[i]].x2 = x - 8;
else
gSprites[spriteIds[i]].x2 = x;