-
Notifications
You must be signed in to change notification settings - Fork 158
Document StartMenu_ExitPartyMenu #846
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Rename PARTY_MENU_RESULTS -> PARTY_MENU_EXIT_CODE Finish up enums StartMenu Actions sub_0202D79C -> SaveData_GetRibbons Documenting Startmenu sub_0203B674 -> StartMenu_Run sub_0203B78C -> StartMenu_OpenPartyMenu sub_0203B7C0-> StartMenu_ExitPartyMenu sub_0203BC5C -> StartMenu_ExitBag PartyMenuApplication *param0 -> application
lhearachel
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your contribution! I've got some feedback below; I worked a bit on the party menu, so feel free to ask questions back at me. 🙂
| enum PartyMenuExitCodes { | ||
| PARTY_MENU_EXIT_CODE_DONE = 0, | ||
| PARTY_MENU_EXIT_CODE_SUMMARY = 1, | ||
| PARTY_MENU_EXIT_CODE_2 = 2, // unused | ||
| PARTY_MENU_EXIT_CODE_GIVE_ITEM = 3, | ||
| PARTY_MENU_EXIT_CODE_LEARNED_MOVE = 4, | ||
| PARTY_MENU_EXIT_CODE_FORGET_MOVE = 5, | ||
| PARTY_MENU_EXIT_CODE_MAIL = 6, | ||
| PARTY_MENU_EXIT_CODE_READ_MAIL = 7, | ||
| PARTY_MENU_EXIT_CODE_EVOLVE_BY_ITEM = 8, | ||
| PARTY_MENU_EXIT_CODE_EVOLVE_BY_LEVEL = 9, | ||
| PARTY_MENU_EXIT_CODE_RETURN_TO_BAG = 10, // after use of item | ||
| PARTY_MENU_EXIT_CODE_CUT = 11 + FIELD_MOVE_CUT, | ||
| PARTY_MENU_EXIT_CODE_FLY = 11 + FIELD_MOVE_FLY, | ||
| PARTY_MENU_EXIT_CODE_SURF = 11 + FIELD_MOVE_SURF, | ||
| PARTY_MENU_EXIT_CODE_STRENGTH = 11 + FIELD_MOVE_STRENGTH, | ||
| PARTY_MENU_EXIT_CODE_DEFOG = 11 + FIELD_MOVE_DEFOG, | ||
| PARTY_MENU_EXIT_CODE_ROCK_SMASH = 11 + FIELD_MOVE_ROCK_SMASH, | ||
| PARTY_MENU_EXIT_CODE_WATERFALL = 11 + FIELD_MOVE_WATERFALL, | ||
| PARTY_MENU_EXIT_CODE_ROCK_CLIMB = 11 + FIELD_MOVE_ROCK_CLIMB, | ||
| PARTY_MENU_EXIT_CODE_FLASH = 11 + FIELD_MOVE_FLASH, | ||
| PARTY_MENU_EXIT_CODE_TELEPORT = 11 + FIELD_MOVE_FLASH + 1, | ||
| PARTY_MENU_EXIT_CODE_DIG = 11 + FIELD_MOVE_FLASH + 2, | ||
| PARTY_MENU_EXIT_CODE_SWEET_SCENT = 11 + FIELD_MOVE_FLASH + 3, | ||
| PARTY_MENU_EXIT_CODE_CHATTER = 11 + FIELD_MOVE_FLASH + 4, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish: Let the natural behavior of enum handle these increments for you. We tend to keep the first assignment for clarity, but others are unnecessary.
This does, though, create a dependency on the FIELD_MOVE constants. We'll want to think about how to make that alignment a bit cleaner.
| case 21: | ||
| case 22: | ||
| case 23: | ||
| case PARTY_MENU_EXIT_CODE_ROCK_SMASH: // fieldMoveTaskOrError: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: What is the comment here for?
| StartMenu_SetCallback(menu, StartMenu_ExitBag); | ||
| break; | ||
| default: | ||
| default: // PARTY_MENU_EXIT_CODE_0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish: No need for this comment.
| static void sub_020833BC(PartyMenuApplication *param0, int *param1) | ||
| static void PartyMenu_SelectItem(PartyMenuApplication *application, int *param1) | ||
| { | ||
| MenuTemplate v0; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish: Name undocumented parameters, if it's obvious what they do.
| StringList_AddFromStrbuf(application->contextMenuChoices, application->menuStrings[3], PartyMenu_GetAction(3)); | ||
| StringList_AddFromStrbuf(application->contextMenuChoices, application->menuStrings[4], PartyMenu_GetAction(4)); | ||
| StringList_AddFromStrbuf(application->contextMenuChoices, application->menuStrings[9], PartyMenu_GetAction(9)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish: Use constants from enum PartyMenuString when accessing the menuStrings array.
| v0.choices = param0->contextMenuChoices; | ||
| v0.window = ¶m0->windows[35]; | ||
| v0.choices = application->contextMenuChoices; | ||
| v0.window = &application->windows[35]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
polish: Use constants from enum PartyMenuWindow when accessing this windows array.
|
Hi @SevenSpiders, any plans to finish this one up sometime? Thanks! |
First PR here. Sorry it got rather large
When player selects an action in the party menu that causes them to exit the menu the StartMenu_ExitPartyMenu callback function is called.
StartMenu_ExitPartyMenu relies on partyMenu->menuSelectionResult to act upon.
unrelated: