diff options
-rw-r--r-- | asm/party_menu.s | 27 | ||||
-rw-r--r-- | include/party_menu.h | 2 | ||||
-rw-r--r-- | src/party_menu.c | 14 |
3 files changed, 13 insertions, 30 deletions
diff --git a/asm/party_menu.s b/asm/party_menu.s index 0ac05c847..9c121ea3d 100644 --- a/asm/party_menu.s +++ b/asm/party_menu.s @@ -7301,31 +7301,4 @@ sub_806E6F0: @ 806E6F0 bx r0 thumb_func_end sub_806E6F0 - thumb_func_start sub_806E720 -sub_806E720: @ 806E720 - push {r4,lr} - lsls r0, 24 - lsrs r0, 21 - adds r0, r3 - ldrb r4, [r0] - lsls r4, 25 - movs r3, 0x80 - lsls r3, 18 - adds r4, r3 - lsrs r4, 24 - ldrb r0, [r0, 0x1] - adds r0, 0x1 - lsls r0, 24 - lsrs r0, 24 - movs r3, 0x1E - subs r3, r0 - strb r3, [r1] - movs r0, 0x14 - subs r0, r4 - strb r0, [r2] - pop {r4} - pop {r0} - bx r0 - thumb_func_end sub_806E720 - .align 2, 0 @ Don't pad with nop. diff --git a/include/party_menu.h b/include/party_menu.h index 5eee17fd2..bc4d938ef 100644 --- a/include/party_menu.h +++ b/include/party_menu.h @@ -114,6 +114,7 @@ void PartyMenuTryPrintMonsHP(void); void nullsub_13(void); void PartyMenuDrawHPBars(void); void sub_806E6F0(); +void SetPartyPopupMenuOffsets(u8 menuIndex, u8 *left, u8 *top, const struct PartyPopupMenu *menu); void ShowPartyPopupMenu(u8 menuIndex, const struct PartyPopupMenu *menu, const struct MenuAction2 *menuActions, u8 cursorPos); void ClosePartyPopupMenu(u8 index, const struct PartyPopupMenu *menu); TaskFunc PartyMenuGetPopupMenuFunc(u8 menuIndex, const struct PartyPopupMenu *menus, const struct MenuAction2 *menuActions, u8 itemIndex); @@ -171,6 +172,5 @@ void PartyMenuTryGiveMonMail(u8 taskId, TaskFunc func); void sub_806D668(u8 partyID); void TaughtMove(u8 taskId); void StopTryingToTeachMove_806F588(u8 taskId); -void sub_806E720(u8, u8 *, u8 *, const struct PartyPopupMenu *); #endif // GUARD_PARTY_MENU_H diff --git a/src/party_menu.c b/src/party_menu.c index 7e515462a..e98af59ee 100644 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -111,12 +111,22 @@ void sub_806AEDC(void) #define WINDOW_RIGHT (29) #endif + +void SetPartyPopupMenuOffsets(u8 menuIndex, u8 *left, u8 *top, const struct PartyPopupMenu *menu) +{ + u8 bottomOffset = (2 * menu[menuIndex].numChoices) + 2; + u8 rightOffset = menu[menuIndex].width + 1; + + *left = 30 - rightOffset; + *top = 20 - bottomOffset; +} + void ShowPartyPopupMenu(u8 menuIndex, const struct PartyPopupMenu *menu, const struct MenuAction2 *menuActions, u8 cursorPos) { u8 left; u8 top; - sub_806E720(menuIndex, &left, &top, menu); + SetPartyPopupMenuOffsets(menuIndex, &left, &top, menu); sub_8089C50(left, top, menu[menuIndex].width, menu[menuIndex].numChoices, menuActions, menu[menuIndex].items); InitMenu(0, left + 1, top + 1, menu[menuIndex].numChoices, cursorPos, menu[menuIndex].width - 1); @@ -127,7 +137,7 @@ void ClosePartyPopupMenu(u8 index, const struct PartyPopupMenu *menu) u8 left; u8 top; - sub_806E720(index, &left, &top, menu); + SetPartyPopupMenuOffsets(index, &left, &top, menu); MenuZeroFillWindowRect(left, top, left + menu[index].width, menu[index].numChoices * 2 + top + 1); HandleDestroyMenuCursors(); |