diff options
author | GriffinR <griffin.g.richards@gmail.com> | 2021-08-21 11:04:28 -0400 |
---|---|---|
committer | GriffinR <griffin.g.richards@gmail.com> | 2021-08-21 11:04:28 -0400 |
commit | 8f5e2bbebaae3857cbe95b40b0d889f73f7d80f0 (patch) | |
tree | fac5bee8a4ce4757816dbbe42265523478b78781 /src/menu_helpers.c | |
parent | ee5eee6ccc3c792203838baec7a1273010414027 (diff) |
Label swap line margin flag
Diffstat (limited to 'src/menu_helpers.c')
-rw-r--r-- | src/menu_helpers.c | 10 |
1 files changed, 7 insertions, 3 deletions
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; |