Skip to content

Document StartMenu_ExitPartyMenu#846

Open
SevenSpiders wants to merge 3 commits intopret:mainfrom
SevenSpiders:main
Open

Document StartMenu_ExitPartyMenu#846
SevenSpiders wants to merge 3 commits intopret:mainfrom
SevenSpiders:main

Conversation

@SevenSpiders
Copy link

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.

  • documented StartMenu callbacks
  • added PARTY_MENU_EXIT_CODE enum
  • documented PartyMenu selection actions in unk_02083370.c

unrelated:

  • documented sub_0202D79C -> SaveData_GetRibbons

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
Copy link
Collaborator

@lhearachel lhearachel left a 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. 🙂

Comment on lines +73 to +98
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,
};
Copy link
Collaborator

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:
Copy link
Collaborator

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
Copy link
Collaborator

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;
Copy link
Collaborator

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.

Comment on lines +134 to +136
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));
Copy link
Collaborator

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 = &param0->windows[35];
v0.choices = application->contextMenuChoices;
v0.window = &application->windows[35];
Copy link
Collaborator

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.

@ravepossum
Copy link
Collaborator

Hi @SevenSpiders, any plans to finish this one up sometime? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants