Set names for remaining menu.c functions

This commit is contained in:
Ryan Dwyer 2025-02-04 20:54:53 +10:00
parent 11a00f6cef
commit 2ce085f27c
15 changed files with 321 additions and 297 deletions

View File

@ -563,9 +563,9 @@ void filemgr_handle_success(void)
bossfile_save();
if (IS4MB()) {
func0f0f820c(&g_MainMenu4MbMenuDialog, MENUROOT_4MBMAINMENU);
menu_save_and_push_root_dialog(&g_MainMenu4MbMenuDialog, MENUROOT_4MBMAINMENU);
} else {
func0f0f820c(&g_CiMenuViaPcMenuDialog, MENUROOT_MAINMENU);
menu_save_and_push_root_dialog(&g_CiMenuViaPcMenuDialog, MENUROOT_MAINMENU);
}
break;
case FILEOP_READ_GAME:
@ -709,7 +709,7 @@ MenuItemHandlerResult filemgr_reinserted_cancel_menu_handler(s32 operation, stru
{
if (operation == MENUOP_SET) {
if (FILEOP_IS_SAVE(g_Menus[g_MpPlayerNum].fm.fileop) && g_Menus[g_MpPlayerNum].fm.fileop != FILEOP_SAVE_GAME_001) {
func0f0f3704(&g_FilemgrSaveElsewhereMenuDialog);
menu_replace_current_dialog(&g_FilemgrSaveElsewhereMenuDialog);
} else {
menu_pop_dialog();
}
@ -763,7 +763,7 @@ void filemgr_retry_save(s32 context)
}
if (context == 2) {
func0f0f3704(&g_PakNotOriginalMenuDialog);
menu_replace_current_dialog(&g_PakNotOriginalMenuDialog);
}
} else if (filemgr_attempt_operation(device, true)) {
if (context == 2) {
@ -778,12 +778,12 @@ void filemgr_retry_save(s32 context)
filemgr_set_device1_by_serial(g_Menus[g_MpPlayerNum].fm.deviceserial);
if (FILEOP_IS_SAVE(g_Menus[g_MpPlayerNum].fm.fileop)) {
func0f0f3704(&g_FilemgrSaveErrorMenuDialog);
menu_replace_current_dialog(&g_FilemgrSaveErrorMenuDialog);
} else {
#if VERSION >= VERSION_NTSC_1_0
filemgr_erase_corrupt_file();
#else
func0f0f3704(&g_FilemgrFileLostMenuDialog);
menu_replace_current_dialog(&g_FilemgrFileLostMenuDialog);
#endif
}
}

View File

@ -19,7 +19,7 @@ MenuItemHandlerResult fmb_handle_drop_out(s32 operation, struct menuitem *item,
menu_pop_dialog();
if (mp_get_num_chrs() == 1) {
func0f0f820c(&g_MainMenu4MbMenuDialog, MENUROOT_4MBMAINMENU);
menu_save_and_push_root_dialog(&g_MainMenu4MbMenuDialog, MENUROOT_4MBMAINMENU);
}
}
@ -30,9 +30,9 @@ MenuItemHandlerResult fmd_handle_abort_game(s32 operation, struct menuitem *item
{
if (operation == MENUOP_SET) {
if (g_Vars.stagenum == STAGE_4MBMENU) {
func0f0f820c(&g_MainMenu4MbMenuDialog, MENUROOT_4MBMAINMENU);
menu_save_and_push_root_dialog(&g_MainMenu4MbMenuDialog, MENUROOT_4MBMAINMENU);
} else {
func0f0f820c(&g_SoloMissionPauseMenuDialog, MENUROOT_MAINMENU);
menu_save_and_push_root_dialog(&g_SoloMissionPauseMenuDialog, MENUROOT_MAINMENU);
}
}
@ -42,7 +42,7 @@ MenuItemHandlerResult fmd_handle_abort_game(s32 operation, struct menuitem *item
MenuItemHandlerResult fmb_handle_advanced_setup(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_SET) {
func0f0f820c(&g_AdvancedSetup4MbMenuDialog, MENUROOT_4MBMAINMENU);
menu_save_and_push_root_dialog(&g_AdvancedSetup4MbMenuDialog, MENUROOT_4MBMAINMENU);
}
return 0;
@ -52,7 +52,7 @@ MenuItemHandlerResult fmb_handle_accept_challenge(s32 operation, struct menuitem
{
if (operation == MENUOP_SET) {
challenge_set_current_by_slot(g_Menus[g_MpPlayerNum].main4mb.slotindex);
func0f0f820c(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU);
menu_save_and_push_root_dialog(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU);
}
return 0;

View File

@ -327,9 +327,9 @@ MenuItemHandlerResult menuhandler_screen_split(s32 operation, struct menuitem *i
if (PLAYERCOUNT() > 1) {
u32 prevplayernum = g_MpPlayerNum;
g_MpPlayerNum = 0;
func0f0f8120();
menu_save_and_close_all();
g_MpPlayerNum = 1;
func0f0f8120();
menu_save_and_close_all();
g_MpPlayerNum = prevplayernum;
}
}
@ -2232,7 +2232,7 @@ MenuItemHandlerResult menuhandler001057ec(s32 operation, struct menuitem *item,
MenuItemHandlerResult menuhandler_change_agent(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_SET) {
func0f0f820c(NULL, -7);
menu_save_and_push_root_dialog(NULL, MENUROOT_CHANGE_AGENT);
}
return 0;
@ -4151,10 +4151,10 @@ MenuItemHandlerResult menuhandler_fr_inventory_list(s32 operation, struct menuit
g_FrFocusedSlotIndex = data->list.value;
// These items are labels
func0f0f139c(&g_SoloMissionInventoryMenuItems[1], -1.0f); // manufacturer
func0f0f139c(&g_SoloMissionInventoryMenuItems[2], -1.0f); // weapon name
func0f0f139c(&g_SoloMissionInventoryMenuItems[4], -1.0f); // primary function
func0f0f139c(&g_SoloMissionInventoryMenuItems[5], -1.0f); // secondary function
menu_set_item_redraw_timer(&g_SoloMissionInventoryMenuItems[1], -1.0f); // manufacturer
menu_set_item_redraw_timer(&g_SoloMissionInventoryMenuItems[2], -1.0f); // weapon name
menu_set_item_redraw_timer(&g_SoloMissionInventoryMenuItems[4], -1.0f); // primary function
menu_set_item_redraw_timer(&g_SoloMissionInventoryMenuItems[5], -1.0f); // secondary function
break;
}
@ -4225,10 +4225,10 @@ MenuItemHandlerResult menuhandler_inventory_list(s32 operation, struct menuitem
g_InventoryWeapon = inv_get_weapon_num_by_index(data->list.value);
g_Menus[g_MpPlayerNum].training.weaponnum = g_InventoryWeapon;
func0f0f139c(&g_SoloMissionInventoryMenuItems[1], -1);
func0f0f139c(&g_SoloMissionInventoryMenuItems[2], -1);
func0f0f139c(&g_SoloMissionInventoryMenuItems[4], -1);
func0f0f139c(&g_SoloMissionInventoryMenuItems[5], -1);
menu_set_item_redraw_timer(&g_SoloMissionInventoryMenuItems[1], -1);
menu_set_item_redraw_timer(&g_SoloMissionInventoryMenuItems[2], -1);
menu_set_item_redraw_timer(&g_SoloMissionInventoryMenuItems[4], -1);
menu_set_item_redraw_timer(&g_SoloMissionInventoryMenuItems[5], -1);
break;
}
@ -4702,8 +4702,8 @@ MenuItemHandlerResult menuhandler_main_menu_combat_simulator(s32 operation, stru
g_Vars.antiplayernum = -1;
challenge_determine_unlocked_features();
g_Vars.mpsetupmenu = MPSETUPMENU_GENERAL;
func0f0f820c(&g_CombatSimulatorMenuDialog, MENUROOT_MPSETUP);
func0f0f8300();
menu_save_and_push_root_dialog(&g_CombatSimulatorMenuDialog, MENUROOT_MPSETUP);
menu_hide_pressstart_labels();
}
return 0;

View File

@ -242,7 +242,7 @@ bool current_player_is_menu_open_in_solo_or_mp(void)
return false;
}
bool func0f0f0c68(void)
bool menu_has_no_background(void)
{
if (g_MenuData.bg || g_MenuData.nextbg != 255) {
return false;
@ -393,66 +393,66 @@ Gfx *menu_render_banner(Gfx *gdl, s32 x1, s32 y1, s32 x2, s32 y2, bool big, s32
u32 var80071464 = 0;
struct menudfc *func0f0f1338(struct menuitem *item)
struct menuitemredrawinfo *menu_find_item_redraw_info(struct menuitem *item)
{
s32 i;
for (i = 0; i < ARRAYCOUNT(g_Menus[0].unkdfc); i++) {
if (g_Menus[g_MpPlayerNum].unkdfc[i].item == item) {
return &g_Menus[g_MpPlayerNum].unkdfc[i];
for (i = 0; i < ARRAYCOUNT(g_Menus[0].itemredrawinfo); i++) {
if (g_Menus[g_MpPlayerNum].itemredrawinfo[i].item == item) {
return &g_Menus[g_MpPlayerNum].itemredrawinfo[i];
}
}
return NULL;
}
void func0f0f139c(struct menuitem *item, f32 arg1)
void menu_set_item_redraw_timer(struct menuitem *item, f32 timer60)
{
struct menudfc *thing = func0f0f1338(item);
struct menuitemredrawinfo *thing = menu_find_item_redraw_info(item);
if (thing) {
thing->unk04 = arg1;
thing->timer60 = timer60;
return;
}
thing = func0f0f1338(NULL);
thing = menu_find_item_redraw_info(NULL);
if (thing) {
thing->item = item;
thing->unk04 = arg1;
thing->timer60 = timer60;
}
}
void func0f0f13ec(struct menuitem *item)
void menu_remove_item_redraw_info(struct menuitem *item)
{
struct menudfc *thing = func0f0f1338(item);
struct menuitemredrawinfo *thing = menu_find_item_redraw_info(item);
if (thing) {
thing->item = NULL;
}
}
void func0f0f1418(void)
void menu_increment_item_redraw_timers(void)
{
s32 i;
for (i = 0; i < ARRAYCOUNT(g_Menus[0].unkdfc); i++) {
if (g_Menus[g_MpPlayerNum].unkdfc[i].item) {
for (i = 0; i < ARRAYCOUNT(g_Menus[0].itemredrawinfo); i++) {
if (g_Menus[g_MpPlayerNum].itemredrawinfo[i].item) {
#if VERSION >= VERSION_PAL_BETA
g_Menus[g_MpPlayerNum].unkdfc[i].unk04 += g_Vars.diffframe60freal / 60.0f;
g_Menus[g_MpPlayerNum].itemredrawinfo[i].timer60 += g_Vars.diffframe60freal / 60.0f;
#else
g_Menus[g_MpPlayerNum].unkdfc[i].unk04 += g_Vars.diffframe60f / 60.0f;
g_Menus[g_MpPlayerNum].itemredrawinfo[i].timer60 += g_Vars.diffframe60f / 60.0f;
#endif
}
}
}
void func0f0f1494(void)
void menu_remove_all_item_redraw_info(void)
{
s32 i;
for (i = 0; i < ARRAYCOUNT(g_Menus[0].unkdfc); i++) {
g_Menus[g_MpPlayerNum].unkdfc[i].item = NULL;
for (i = 0; i < ARRAYCOUNT(g_Menus[0].itemredrawinfo); i++) {
g_Menus[g_MpPlayerNum].itemredrawinfo[i].item = NULL;
}
}
@ -857,7 +857,7 @@ const char var7f1b25a8[] = "IG:) style %d gbHead:%d\n";
const char var7f1b25c4[] = "GRABBED GUN MEM!\n";
const char var7f1b25d8[] = "Freeing challenge mem\n";
void func0f0f1d6c(struct menudialogdef *dialogdef, struct menudialog *dialog, struct menu *menu)
void dialog_init_blocks(struct menudialogdef *dialogdef, struct menudialog *dialog, struct menu *menu)
{
s32 colindex = menu->colend - 1;
s32 rowindex = menu->rowend;
@ -914,7 +914,7 @@ void func0f0f1d6c(struct menudialogdef *dialogdef, struct menudialog *dialog, st
menu->blockend = blockindex;
}
void dialog0f0f1ef4(struct menudialog *dialog)
void dialog_tick_height(struct menudialog *dialog)
{
s32 bodyheight = dialog->height - LINEHEIGHT - 1;
s32 itemheight;
@ -1371,7 +1371,7 @@ void menu_open_dialog(struct menudialogdef *dialogdef, struct menudialog *dialog
break;
}
func0f0f1d6c(dialogdef, dialog, menu);
dialog_init_blocks(dialogdef, dialog, menu);
dialog_init_items(dialog);
dialog->type = dialogdef->type;
@ -1493,12 +1493,12 @@ void menu_push_dialog(struct menudialogdef *dialogdef)
}
#if VERSION >= VERSION_NTSC_1_0
bool func0f0f3220(s32 arg0)
bool menu_save_file(s32 arg0)
{
bool save = true;
s32 i;
if (g_MenuData.unk669[arg0] == 4) {
if (g_MenuData.pendingsaves[arg0] == 4) {
s32 prevplayernum = g_MpPlayerNum;
for (i = ARRAYCOUNT(g_Menus) - 1; i >= 0; i--) {
@ -1526,26 +1526,26 @@ bool func0f0f3220(s32 arg0)
}
g_MpPlayerNum = prevplayernum;
} else if (g_MenuData.unk669[arg0] < 4) {
} else if (g_MenuData.pendingsaves[arg0] < 4) {
s32 prevplayernum = g_MpPlayerNum;
g_MpPlayerNum = g_MenuData.unk669[arg0];
g_MpPlayerNum = g_MenuData.pendingsaves[arg0];
filemgr_save_or_load(&g_PlayerConfigsArray[g_MpPlayerNum].fileguid, FILEOP_SAVE_MPPLAYER, g_MpPlayerNum);
save = true;
g_MpPlayerNum = prevplayernum;
}
if (save) {
g_MenuData.unk66e--;
g_MenuData.numpendingsaves--;
}
return save;
}
#else
void func0f0f3220(s32 arg0)
void menu_save_file(s32 arg0)
{
s32 i;
if (g_MenuData.unk669[arg0] == 4) {
if (g_MenuData.pendingsaves[arg0] == 4) {
s32 prevplayernum = g_MpPlayerNum;
for (i = ARRAYCOUNT(g_Menus) - 1; i >= 0; i--) {
@ -1557,14 +1557,14 @@ void func0f0f3220(s32 arg0)
filemgr_save_or_load(&g_GameFileGuid, FILEOP_SAVE_GAME_000, 0);
g_MpPlayerNum = prevplayernum;
} else if (g_MenuData.unk669[arg0] < 4) {
} else if (g_MenuData.pendingsaves[arg0] < 4) {
s32 prevplayernum = g_MpPlayerNum;
g_MpPlayerNum = g_MenuData.unk669[arg0];
g_MpPlayerNum = g_MenuData.pendingsaves[arg0];
filemgr_save_or_load(&g_PlayerConfigsArray[g_MpPlayerNum].fileguid, FILEOP_SAVE_MPPLAYER, g_MpPlayerNum);
g_MpPlayerNum = prevplayernum;
}
g_MenuData.unk66e--;
g_MenuData.numpendingsaves--;
}
#endif
@ -1601,15 +1601,15 @@ void menu_close_dialog(void)
}
#if VERSION >= VERSION_NTSC_1_0
if (g_MenuData.unk66e > 0 && g_Menus[g_MpPlayerNum].depth == 0)
if (g_MenuData.numpendingsaves > 0 && g_Menus[g_MpPlayerNum].depth == 0)
#else
if (g_MenuData.unk66e > 0)
if (g_MenuData.numpendingsaves > 0)
#endif
{
s32 value = g_MenuData.unk66e;
s32 value = g_MenuData.numpendingsaves;
while (value >= 0) {
func0f0f3220(value);
menu_save_file(value);
value--;
}
}
@ -1644,7 +1644,7 @@ void menu_pop_dialog(void)
menu_update_cur_frame();
}
void func0f0f3704(struct menudialogdef *dialogdef)
void menu_replace_current_dialog(struct menudialogdef *dialogdef)
{
menu_close_dialog();
menu_push_dialog(dialogdef);
@ -1734,7 +1734,7 @@ Gfx *menu_render_model(Gfx *gdl, struct menumodel *menumodel, s32 modeltype)
s32 headnum;
if (g_Vars.stagenum != STAGE_CITRAINING && g_Vars.stagenum != STAGE_CREDITS) {
if (g_MenuData.unk5d5_01 && modeltype != MENUMODELTYPE_HUDPIECE && modeltype < MENUMODELTYPE_3) {
if (g_MenuData.ininventorymenu && modeltype != MENUMODELTYPE_HUDPIECE && modeltype < MENUMODELTYPE_3) {
return gdl;
}
@ -2510,7 +2510,7 @@ Gfx *dialog_render(Gfx *gdl, struct menudialog *dialog, struct menu *menu, bool
}
#endif
sp170 = 1.0f - g_MenuData.unk010;
sp170 = 1.0f - g_MenuData.bgopacityfrac;
#if VERSION >= VERSION_NTSC_1_0
if ((g_Vars.coopplayernum >= 0 || g_Vars.antiplayernum >= 0) && menu_get_root() == MENUROOT_MPENDSCREEN) {
@ -3086,7 +3086,7 @@ u32 g_MpNumJoined = 1;
* Choose which direction a new dialog should swipe from in the combat simulator
* menus.
*/
void func0f0f7594(s32 arg0, s32 *vdir, s32 *hdir)
void menu_calculate_swipe_direction(s32 arg0, s32 *vdir, s32 *hdir)
{
if (g_MenuData.root == MENUROOT_MPSETUP) {
s32 playernum = g_Menus[g_MpPlayerNum].playernum;
@ -3357,7 +3357,7 @@ void dialog_calculate_position(struct menudialog *dialog)
dialog->dstheight = height;
if (dialog->swipedir != 0) {
func0f0f7594(dialog->swipedir, &vdir, &hdir);
menu_calculate_swipe_direction(dialog->swipedir, &vdir, &hdir);
if (hdir < 0) {
dialog->dstx = -4 - dialog->dstwidth;
@ -3402,17 +3402,19 @@ void menu_close(void)
}
}
void func0f0f8120(void)
void menu_save_and_close_all(void)
{
struct menudialog *prev = g_Menus[g_MpPlayerNum].curdialog;
s32 i;
if (g_MenuData.unk66e > 0) {
for (i = g_MenuData.unk66e; i >= 0; i--) {
func0f0f3220(i);
if (g_MenuData.numpendingsaves > 0) {
for (i = g_MenuData.numpendingsaves; i >= 0; i--) {
menu_save_file(i);
}
}
// menu_save_file will set an error dialog if any save fails.
// If the dialog was unchanged then the save worked and the dialogs can be closed.
if (g_Menus[g_MpPlayerNum].curdialog == prev) {
while (g_Menus[g_MpPlayerNum].depth > 0) {
menu_pop_dialog();
@ -3420,7 +3422,15 @@ void func0f0f8120(void)
}
}
void func0f0f820c(struct menudialogdef *dialogdef, s32 root)
/**
* If there are any pending saves to mplayer files or the game file then go ahead
* and save them, then replace the current player's menu hierarchy with the given
* dialog.
*
* If a save fails then pak error dialogs are shown instead, and the next root
* is stored so it can be pushed once the pak dialogs are closed.
*/
void menu_save_and_push_root_dialog(struct menudialogdef *dialogdef, s32 root)
{
s32 i;
s32 prevplayernum = g_MpPlayerNum;
@ -3428,14 +3438,14 @@ void func0f0f820c(struct menudialogdef *dialogdef, s32 root)
for (i = 0; i < ARRAYCOUNT(g_Menus); i++) {
if (g_Menus[i].curdialog) {
g_MpPlayerNum = i;
func0f0f8120();
menu_save_and_close_all();
}
}
g_MpPlayerNum = prevplayernum;
g_MenuData.unk008 = root;
g_MenuData.unk00c = dialogdef;
g_MenuData.nextroot = root;
g_MenuData.nextdialog = dialogdef;
}
void menu_set_background(s32 bg)
@ -3459,7 +3469,7 @@ void menu_set_background(s32 bg)
}
}
void func0f0f8300(void)
void menu_hide_pressstart_labels(void)
{
s32 i;
@ -3475,12 +3485,12 @@ void menu_push_root_dialog(struct menudialogdef *dialogdef, s32 root)
g_Menus[g_MpPlayerNum].numdialogs = 0;
g_Menus[g_MpPlayerNum].depth = 0;
g_MenuData.unk5d5_01 = false;
g_MenuData.unk5d5_04 = false;
g_MenuData.ininventorymenu = false;
g_MenuData.openedfrompc = false;
g_PlayersWithControl[g_Menus[g_MpPlayerNum].playernum] = false;
func0f0f1494();
menu_remove_all_item_redraw_info();
g_MenuData.count++;
@ -3505,16 +3515,16 @@ void menu_push_root_dialog(struct menudialogdef *dialogdef, s32 root)
g_Menus[g_MpPlayerNum].unk820 = 1;
g_MenuData.root = root;
g_MenuData.unk008 = -1;
g_MenuData.unk5d5_02 = false;
g_MenuData.nextroot = -1;
g_MenuData.unk5d5_unused = false;
if (root == MENUROOT_MAINMENU
|| root == MENUROOT_MPSETUP
|| root == MENUROOT_TRAINING
|| root == MENUROOT_FILEMGR) {
if (IS8MB() && (g_MenuData.unk5d4 == 0 || g_MenuData.hudpiece.reverseanim)) {
if (!g_MenuData.unk5d5_04) {
g_MenuData.unk5d5_05 = true;
if (IS8MB() && (g_MenuData.hudpieceactive == false || g_MenuData.hudpiece.reverseanim)) {
if (!g_MenuData.openedfrompc) {
g_MenuData.triggerhudpiece = true;
}
}
}
@ -3534,7 +3544,7 @@ void menu_push_root_dialog(struct menudialogdef *dialogdef, s32 root)
break;
case MENUROOT_ENDSCREEN:
if (dialogdef->type == MENUDIALOGTYPE_DANGER) {
g_MenuData.unk5d4 = 0;
g_MenuData.hudpieceactive = false;
g_MenuData.nextbg = MENUBG_FAILURE;
break;
}
@ -3557,7 +3567,7 @@ void menu_push_root_dialog(struct menudialogdef *dialogdef, s32 root)
}
}
void func0f0f85e0(struct menudialogdef *dialogdef, s32 root)
void menu_push_root_dialog_and_pause(struct menudialogdef *dialogdef, s32 root)
{
if (dialogdef == &g_CiMenuViaPcMenuDialog) {
music_start_menu();
@ -3733,7 +3743,7 @@ void menu_reset(void)
g_BlurBuffer = memp_alloc(0x4b00, MEMPOOL_STAGE);
}
g_MenuData.unk5d5_01 = false;
g_MenuData.ininventorymenu = false;
tex_load_from_config(&g_TexGeneralConfigs[TEX_GENERAL_1PXWHITE]);
tex_load_from_config(&g_TexGeneralConfigs[TEX_GENERAL_MENURAY0]);
@ -3801,8 +3811,8 @@ void menu_reset(void)
g_MenuData.hudpiece.removingpiece = false;
}
g_MenuData.unk5d4 = 0;
g_MenuData.unk5d5_05 = false;
g_MenuData.hudpieceactive = false;
g_MenuData.triggerhudpiece = false;
for (i = 0; i < ARRAYCOUNT(g_Menus); i++) {
g_Menus[i].curdialog = NULL;
@ -3818,23 +3828,23 @@ void menu_reset(void)
g_Menus[i].fm.headtextures = NULL;
}
g_MenuData.unk668 = -1;
g_MenuData.unk00c = 0;
g_MenuData.unk008 = -1;
g_MenuData.lastperfectheadfile = -1;
g_MenuData.nextdialog = NULL;
g_MenuData.nextroot = -1;
g_MenuData.count = 0;
g_MenuData.root = 0;
g_MenuData.unk010 = 0;
g_MenuData.bgopacityfrac = 0;
g_MenuData.bg = 0;
g_MenuData.unk5d5_06 = false;
g_MenuData.checkroots = false;
g_MenuData.nextbg = 255;
g_MenuData.bannernum = -1;
for (i = 0; i < ARRAYCOUNT(g_MenuData.unk669); i++) {
g_MenuData.unk669[i] = 0xff;
for (i = 0; i < ARRAYCOUNT(g_MenuData.pendingsaves); i++) {
g_MenuData.pendingsaves[i] = 0xff;
}
g_MenuData.unk66e = 0;
g_MenuData.unk66f = 0;
g_MenuData.numpendingsaves = 0;
g_MenuData.savetimer = 0;
}
void menu_swipe(s32 direction)
@ -4156,7 +4166,7 @@ void dialog_tick(struct menudialog *dialog, struct menuinputs *inputs, u32 tickf
}
dialog_calculate_position(dialog);
dialog0f0f1ef4(dialog);
dialog_tick_height(dialog);
// Update slide
if (g_MenuData.root == MENUROOT_MPPAUSE
@ -4478,7 +4488,7 @@ void dialog_init_items(struct menudialog *dialog)
}
}
void func0f0fa6ac(void)
void menu_consider_unpause(void)
{
switch (g_MenuData.root) {
case MENUROOT_MAINMENU:
@ -4531,7 +4541,7 @@ void menu_process_input(void)
g_AmIndex = g_Vars.currentplayernum;
}
func0f0f1418();
menu_increment_item_redraw_timers();
inputs.select = 0;
inputs.back = 0;
@ -5010,7 +5020,7 @@ void menu_process_input(void)
break;
case MENUROOT_MPPAUSE:
if (g_InCutscene) {
func0f0f8120();
menu_save_and_close_all();
}
g_Menus[g_MpPlayerNum].openinhibit = 10;
// fall-through
@ -5020,7 +5030,7 @@ void menu_process_input(void)
case MENUROOT_TRAINING:
if (inputs.start && !starttoselect && g_Menus[g_MpPlayerNum].curdialog
&& (dialog->definition->flags & MENUDIALOGFLAG_IGNOREBACK) == 0) {
func0f0f8120();
menu_save_and_close_all();
}
break;
}
@ -5174,26 +5184,26 @@ Gfx *menu_render(Gfx *gdl)
// Render the background
if (g_MenuData.nextbg != 255) {
if (g_MenuData.nextbg == 0) {
gdl = menu_render_background_layer1(gdl, g_MenuData.bg, 1.0f - g_MenuData.unk010);
gdl = menu_render_background_layer1(gdl, g_MenuData.bg, 1.0f - g_MenuData.bgopacityfrac);
} else {
gdl = menu_render_background_layer1(gdl, g_MenuData.bg, 1.0f);
gdl = menu_render_background_layer1(gdl, g_MenuData.nextbg, g_MenuData.unk010);
gdl = menu_render_background_layer1(gdl, g_MenuData.nextbg, g_MenuData.bgopacityfrac);
}
} else {
gdl = menu_render_background_layer1(gdl, g_MenuData.bg, 1.0f);
}
// Calculate hudpiece things then render it
if (g_MenuData.unk5d5_05) {
if (g_MenuData.triggerhudpiece) {
g_MenuData.hudpiece.curanimnum = 0;
g_MenuData.hudpiece.newanimnum = ANIM_040D;
g_MenuData.hudpiece.removingpiece = false;
g_MenuData.hudpiece.reverseanim = false;
g_MenuData.unk5d4 = 1;
g_MenuData.unk5d5_05 = false;
g_MenuData.hudpieceactive = true;
g_MenuData.triggerhudpiece = false;
}
if (IS8MB() && g_MenuData.unk5d4) {
if (IS8MB() && g_MenuData.hudpieceactive) {
bool removepiece = false;
gSPSetGeometryMode(gdl++, G_ZBUFFER);
@ -5240,7 +5250,7 @@ Gfx *menu_render(Gfx *gdl)
g_MenuData.hudpiece.removingpiece = true;
} else if (g_MenuData.hudpiece.curanimnum == 0) {
g_MenuData.hudpiece.removingpiece = false;
g_MenuData.unk5d4 = 0;
g_MenuData.hudpieceactive = false;
}
}
@ -5258,19 +5268,19 @@ Gfx *menu_render(Gfx *gdl)
g_HolorayProjectFromX = g_HolorayProjectFromY = 0;
}
if (g_MenuData.unk5d5_04) {
g_HolorayProjectFromX = g_MenuData.unk670;
g_HolorayProjectFromY = g_MenuData.unk674;
if (g_MenuData.openedfrompc) {
g_HolorayProjectFromX = g_MenuData.projectfromx;
g_HolorayProjectFromY = g_MenuData.projectfromy;
}
// Render the second layer of the background (for the combat simulator cone,
// which draws over the top of the hud piece)
if (g_MenuData.nextbg != 255) {
if (g_MenuData.nextbg == 0) {
gdl = menu_render_background_layer2(gdl, g_MenuData.bg, 1.0f - g_MenuData.unk010);
gdl = menu_render_background_layer2(gdl, g_MenuData.bg, 1.0f - g_MenuData.bgopacityfrac);
} else {
gdl = menu_render_background_layer2(gdl, g_MenuData.bg, 1.0f);
gdl = menu_render_background_layer2(gdl, g_MenuData.nextbg, g_MenuData.unk010);
gdl = menu_render_background_layer2(gdl, g_MenuData.nextbg, g_MenuData.bgopacityfrac);
}
} else {
gdl = menu_render_background_layer2(gdl, g_MenuData.bg, 1.0f);
@ -5565,7 +5575,7 @@ u32 menu_choose_music(void)
return MUSIC_PAUSEMENU;
}
bool func0f0fcbcc(void)
bool menu_is_file_not_yet_selected(void)
{
if (g_FileState == FILESTATE_UNSELECTED && g_Vars.stagenum == STAGE_CITRAINING) {
return true;
@ -5574,7 +5584,10 @@ bool func0f0fcbcc(void)
return false;
}
bool func0f0fcc04(void)
/**
* Unused.
*/
bool menu_0f0fcc04(void)
{
return false;
}
@ -5591,11 +5604,12 @@ u32 menu_get_root(void)
#if VERSION >= VERSION_NTSC_1_0
struct menudialogdef g_PakAttemptRepairMenuDialog;
MenuItemHandlerResult menuhandler000fcc34(s32 operation, struct menuitem *item, union handlerdata *data)
MenuItemHandlerResult menuhandler_pak_acknowledge(s32 operation, struct menuitem *item, union handlerdata *data)
{
bool done = false;
if (operation == MENUOP_SET) {
// Close all pak success/error dialogs
while (!done) {
done = true;
@ -5617,13 +5631,17 @@ MenuItemHandlerResult menuhandler000fcc34(s32 operation, struct menuitem *item,
}
#endif
MenuDialogHandlerResult menudialog000fcd48(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data)
/**
* While the dialog is open, check if the pak has been removed
* and replace the dialog if so.
*/
MenuDialogHandlerResult menudialog_pak(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data)
{
if (operation == MENUOP_TICK) {
if (g_Menus[g_MpPlayerNum].curdialog
&& g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef
&& joy_get_pak_state(g_Menus[g_MpPlayerNum].fm.device3) == PAKSTATE_NOPAK) {
func0f0f3704(&g_PakRemovedMenuDialog);
menu_replace_current_dialog(&g_PakRemovedMenuDialog);
}
}
@ -5631,10 +5649,16 @@ MenuDialogHandlerResult menudialog000fcd48(s32 operation, struct menudialogdef *
}
#if VERSION >= VERSION_NTSC_1_0
MenuItemHandlerResult func0f0fcdd0(s32 operation, struct menuitem *item, union handlerdata *data)
/**
* Not used.
*
* When some menu item is selected, replaces the dialog with the pak damaged one.
* Maybe used for testing, to test the repair process?
*/
MenuItemHandlerResult menuhandler_pak_setdamaged(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_SET) {
func0f0f3704(&g_PakDamagedMenuDialog);
menu_replace_current_dialog(&g_PakDamagedMenuDialog);
}
return 0;
@ -5645,9 +5669,9 @@ MenuItemHandlerResult menuhandler_repair_pak(s32 operation, struct menuitem *ite
{
if (operation == MENUOP_SET) {
if (pak_repair(g_Menus[g_MpPlayerNum].fm.device3)) {
func0f0f3704(&g_PakRepairSuccessMenuDialog);
menu_replace_current_dialog(&g_PakRepairSuccessMenuDialog);
} else {
func0f0f3704(&g_PakRepairFailedMenuDialog);
menu_replace_current_dialog(&g_PakRepairFailedMenuDialog);
}
}
@ -5700,7 +5724,7 @@ struct menuitem g_PakRemovedMenuItems[] = {
MENUITEMFLAG_SELECTABLE_CENTRE,
L_MPWEAPONS_073, // "OK"
0,
menuhandler000fcc34,
menuhandler_pak_acknowledge,
#else
MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_SELECTABLE_CENTRE,
L_MPWEAPONS_073, // "OK"
@ -5744,7 +5768,7 @@ struct menuitem g_PakRepairSuccessMenuItems[] = {
MENUITEMFLAG_SELECTABLE_CENTRE,
L_MPWEAPONS_073, // "OK"
0,
menuhandler000fcc34,
menuhandler_pak_acknowledge,
#else
MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_SELECTABLE_CENTRE,
L_MPWEAPONS_073, // "OK"
@ -5759,7 +5783,7 @@ struct menudialogdef g_PakRepairSuccessMenuDialog = {
MENUDIALOGTYPE_SUCCESS,
L_MPWEAPONS_180, // "Repair Successful"
g_PakRepairSuccessMenuItems,
menudialog000fcd48,
menudialog_pak,
0,
NULL,
};
@ -5796,7 +5820,7 @@ struct menudialogdef g_PakRepairFailedMenuDialog = {
MENUDIALOGTYPE_DANGER,
L_MPWEAPONS_182, // "Repair Failed"
g_PakRepairFailedMenuItems,
menudialog000fcd48,
menudialog_pak,
0,
NULL,
};
@ -5849,7 +5873,7 @@ struct menudialogdef g_PakAttemptRepairMenuDialog = {
MENUDIALOGTYPE_DANGER,
L_MPWEAPONS_175, // "Attempt Repair"
g_PakAttemptRepairMenuItems,
menudialog000fcd48,
menudialog_pak,
0,
NULL,
};
@ -5896,7 +5920,7 @@ MenuItemHandlerResult menuhandler_warn_repair_pak(s32 operation, struct menuitem
#if VERSION >= VERSION_NTSC_1_0
menu_push_dialog(&g_PakAttemptRepairMenuDialog);
#else
func0f0f3704(&g_PakAttemptRepairMenuDialog);
menu_replace_current_dialog(&g_PakAttemptRepairMenuDialog);
#endif
}
@ -5952,7 +5976,7 @@ bool menu_is_ready_for_pak_error(s32 paknum, s32 pakerrordialog)
|| g_Menus[playernum].curdialog->definition == &g_PakRepairFailedMenuDialog) {
result = false;
}
} else if (g_MenuData.nextbg != 255 || g_MenuData.bg || g_MenuData.unk5d4) {
} else if (g_MenuData.nextbg != 255 || g_MenuData.bg || g_MenuData.hudpieceactive) {
result = false;
}
@ -6000,29 +6024,29 @@ void menu_push_pak_error_dialog(s32 paknum, s32 pakerrordialog)
g_MpPlayerNum = prevplayernum;
}
void func0f0fd494(struct coord *pos)
void menu_set_source_pos(struct coord *pos)
{
f32 xy[2];
struct coord coord;
Mtxf *matrix;
g_MenuData.unk5d5_04 = true;
g_MenuData.openedfrompc = true;
matrix = cam_get_world_to_screen_mtxf();
mtx4_transform_vec(matrix, pos, &coord);
cam0f0b4d04(&coord, xy);
g_MenuData.unk670 = (s32)xy[0] - vi_get_width() / 2;
g_MenuData.unk674 = (s32)xy[1] - vi_get_height() / 2;
g_MenuData.projectfromx = (s32)xy[0] - vi_get_width() / 2;
g_MenuData.projectfromy = (s32)xy[1] - vi_get_height() / 2;
g_MenuData.unk5d5_05 = false;
g_MenuData.triggerhudpiece = false;
}
void func0f0fd548(s32 arg0)
void menu_queue_save(s32 playernum)
{
g_MenuData.unk669[g_MenuData.unk66e++] = arg0;
g_MenuData.unk66f = 0;
g_MenuData.pendingsaves[g_MenuData.numpendingsaves++] = playernum;
g_MenuData.savetimer = 0;
}
struct menudialog *menu_is_dialog_open(struct menudialogdef *dialogdef)
@ -6108,9 +6132,9 @@ struct menudialogdef g_PakDamagedMenuDialog = {
MENUDIALOGTYPE_DANGER,
L_MPWEAPONS_064, // "Damaged Controller Pak"
g_PakDamagedMenuItems,
menudialog000fcd48,
menudialog_pak,
#if VERSION >= VERSION_NTSC_1_0
0x00000020,
MENUDIALOGFLAG_IGNOREBACK,
#else
0,
#endif
@ -6175,9 +6199,9 @@ struct menudialogdef g_PakFullMenuDialog = {
MENUDIALOGTYPE_DANGER,
L_MPWEAPONS_070, // "Full Controller Pak"
g_PakFullMenuItems,
menudialog000fcd48,
menudialog_pak,
#if VERSION >= VERSION_NTSC_1_0
0x00000020,
MENUDIALOGFLAG_IGNOREBACK,
#else
0,
#endif

View File

@ -1866,7 +1866,7 @@ Gfx *menuitem_label_render(Gfx *gdl, struct menurendercontext *context)
char *text;
s32 x;
s32 y;
struct menudfc *menudfc;
struct menuitemredrawinfo *redrawinfo;
u8 savedvalue = g_TextHoloRayEnabled;
struct fontchar *font1 = g_CharsHandelGothicSm;
struct font *font2 = g_FontHandelGothicSm;
@ -1955,15 +1955,15 @@ Gfx *menuitem_label_render(Gfx *gdl, struct menurendercontext *context)
g_MenuWave1Colours[context->dialog->type].item_disabled);
}
menudfc = func0f0f1338(context->item);
redrawinfo = menu_find_item_redraw_info(context->item);
if (menudfc) {
if (menudfc->unk04 < 0) {
if (redrawinfo) {
if (redrawinfo->timer60 < 0) {
return gdl;
}
text_backup_diagonal_blend_settings();
text_set_diagonal_blend(x, y, menudfc->unk04 * 300, 0);
text_set_diagonal_blend(x, y, redrawinfo->timer60 * 300, 0);
g_TextHoloRayEnabled = true;
}
@ -2020,9 +2020,9 @@ Gfx *menuitem_label_render(Gfx *gdl, struct menurendercontext *context)
gdl = text_end(gdl);
if (menudfc) {
if (context->width + 200 < menudfc->unk04 * 300 && context->dialog->redrawtimer < 0) {
func0f0f13ec(context->item);
if (redrawinfo) {
if (context->width + 200 < redrawinfo->timer60 * 300 && context->dialog->redrawtimer < 0) {
menu_remove_item_redraw_info(context->item);
}
g_TextHoloRayEnabled = savedvalue;

View File

@ -59,8 +59,8 @@ void menu_tick(void)
s32 i;
s32 j;
s32 k;
s32 sp344;
s32 sp340 = true;
s32 anyopen2;
s32 allready = true;
s32 anyopen = false;
#if PAL
@ -93,28 +93,30 @@ void menu_tick(void)
g_MenuData.nextbg = 0;
}
if (anyopen && g_MenuData.unk66e > 0 && var8009dfc0) {
s32 bVar12 = 50;
s32 bVar11 = false;
// If there are any pending file saves, wait up to 40 or 50 frames or until all
// dialogs are settled, then save one.
if (anyopen && g_MenuData.numpendingsaves > 0 && var8009dfc0) {
s32 maxwait = 50;
s32 busy = false;
for (j = 0; j < ARRAYCOUNT(g_Menus); j++) {
if (g_Menus[j].curdialog) {
if (g_Menus[j].curdialog->state == MENUDIALOGSTATE_OPENING
|| g_Menus[j].curdialog->state == MENUDIALOGSTATE_POPULATING
|| g_Menus[j].curdialog->state == MENUDIALOGSTATE_PREOPEN) {
bVar11 = true;
busy = true;
}
}
}
if (g_Vars.normmplayerisrunning) {
bVar12 = 40;
maxwait = 40;
}
if (g_MenuData.unk66f > bVar12 || !bVar11) {
func0f0f3220(g_MenuData.unk66e - 1);
if (g_MenuData.savetimer > maxwait || !busy) {
menu_save_file(g_MenuData.numpendingsaves - 1);
} else {
g_MenuData.unk66f++;
g_MenuData.savetimer++;
}
}
@ -163,15 +165,15 @@ void menu_tick(void)
diffframe = 4;
}
g_MenuData.unk010 += mult * diffframe;
g_MenuData.bgopacityfrac += mult * diffframe;
}
if (g_MenuData.unk010 > 1) {
if (g_MenuData.bgopacityfrac > 1) {
if (g_MenuData.nextbg) {
var8009dfc0 = true;
}
g_MenuData.unk010 = 0;
g_MenuData.bgopacityfrac = 0;
g_MenuData.bg = g_MenuData.nextbg;
g_MenuData.nextbg = 255;
@ -192,7 +194,7 @@ void menu_tick(void)
}
if (g_MenuData.bg == 0) {
func0f0fa6ac();
menu_consider_unpause();
}
}
@ -207,7 +209,7 @@ void menu_tick(void)
}
}
} else {
g_MenuData.unk010 = 0;
g_MenuData.bgopacityfrac = 0;
var8009dfc0 = g_MenuData.bg == 0 ? false : true;
}
@ -285,7 +287,7 @@ void menu_tick(void)
var8006294c = 1;
if (g_MenuData.root == MENUROOT_MPSETUP || g_MenuData.root == MENUROOT_4MBMAINMENU) {
if (g_MenuData.unk008 == -1) {
if (g_MenuData.nextroot == -1) {
g_MpSetup.chrslots &= 0xfff0;
}
@ -295,7 +297,7 @@ void menu_tick(void)
if (g_Menus[i].curdialog) {
g_Menus[i].playernum = g_MpNumJoined++;
if (g_MenuData.unk008 == -1) {
if (g_MenuData.nextroot == -1) {
g_MpSetup.chrslots |= (1 << i);
}
}
@ -312,7 +314,7 @@ void menu_tick(void)
if (g_Menus[g_MpPlayerNum].curdialog->definition == &g_MpReadyMenuDialog) {
g_Vars.unk000498 = 1;
} else {
sp340 = false;
allready = false;
}
}
}
@ -460,9 +462,8 @@ void menu_tick(void)
}
}
if (sp340 &&
(g_MenuData.root == MENUROOT_MPSETUP || g_MenuData.root == MENUROOT_4MBMAINMENU)) {
func0f0f820c(NULL, -5);
if (allready && (g_MenuData.root == MENUROOT_MPSETUP || g_MenuData.root == MENUROOT_4MBMAINMENU)) {
menu_save_and_push_root_dialog(NULL, MENUROOT_START_MP_MATCH);
}
} else {
var8006294c = 0;
@ -486,31 +487,31 @@ void menu_tick(void)
}
g_MpPlayerNum = 0;
sp344 = false;
anyopen2 = false;
for (i = 0; i < ARRAYCOUNT(g_Menus); i++) {
if (g_Menus[i].curdialog) {
sp344 = true;
anyopen2 = true;
}
}
if ((g_MenuData.unk5d5_06 || g_MenuData.unk008 != -1) && sp344 == false) {
if ((g_MenuData.checkroots || g_MenuData.nextroot != -1) && anyopen2 == false) {
if ((g_MenuData.root == MENUROOT_MPSETUP || g_MenuData.root == MENUROOT_4MBMAINMENU)
&& g_MenuData.unk008 == -1) {
&& g_MenuData.nextroot == -1) {
if (g_Vars.mpsetupmenu == MPSETUPMENU_GENERAL) {
g_MenuData.unk008 = MENUROOT_MAINMENU;
g_MenuData.unk00c = IS4MB() ? &g_CiMenuViaPauseMenuDialog : &g_CiMenuViaPcMenuDialog;
g_MenuData.nextroot = MENUROOT_MAINMENU;
g_MenuData.nextdialog = IS4MB() ? &g_CiMenuViaPauseMenuDialog : &g_CiMenuViaPcMenuDialog;
} else if (IS4MB()) {
g_MenuData.unk008 = MENUROOT_4MBMAINMENU;
g_MenuData.unk00c = &g_MainMenu4MbMenuDialog;
g_MenuData.nextroot = MENUROOT_4MBMAINMENU;
g_MenuData.nextdialog = &g_MainMenu4MbMenuDialog;
} else {
g_MenuData.unk008 = MENUROOT_MPSETUP;
g_MenuData.unk00c = &g_CombatSimulatorMenuDialog;
g_MenuData.nextroot = MENUROOT_MPSETUP;
g_MenuData.nextdialog = &g_CombatSimulatorMenuDialog;
}
}
if (g_MenuData.unk008 != -1) {
if (g_MenuData.unk008 == -5) {
if (g_MenuData.nextroot != -1) {
if (g_MenuData.nextroot == MENUROOT_START_MP_MATCH) {
// Match is beginning
mp_start_match();
menu_stop();
@ -519,12 +520,12 @@ void menu_tick(void)
bossfile_save();
g_Vars.modifiedfiles &= ~MODFILE_MPSETUP;
}
} else if (g_MenuData.unk008 == -6) {
} else if (g_MenuData.nextroot == MENUROOT_END_MP_MATCH) {
// Match is ending
s32 playernum = 0;
if (g_Vars.normmplayerisrunning) {
func0f0fd548(4);
menu_queue_save(4);
}
for (i = 0; i < MAX_PLAYERS; i++) {
@ -542,27 +543,27 @@ void menu_tick(void)
set_current_player_num(playernum);
endscreen_push_coop();
set_current_player_num(prevplayernum);
sp344 = true;
anyopen2 = true;
}
} else if (g_Vars.antiplayernum >= 0) {
s32 prevplayernum = g_Vars.currentplayernum;
set_current_player_num(playernum);
endscreen_push_anti();
set_current_player_num(prevplayernum);
sp344 = true;
anyopen2 = true;
} else {
mp_push_endscreen_dialog(playernum, i);
sp344 = true;
anyopen2 = true;
if (g_PlayerConfigsArray[i].fileguid.fileid && g_PlayerConfigsArray[i].fileguid.deviceserial) {
func0f0fd548(i);
menu_queue_save(i);
}
}
playernum++;
}
}
} else if (g_MenuData.unk008 == -7) {
} else if (g_MenuData.nextroot == MENUROOT_CHANGE_AGENT) {
menu_stop();
g_FileState = FILESTATE_CHANGINGAGENT;
gamefile_load_defaults(&g_GameFile);
@ -571,8 +572,8 @@ void menu_tick(void)
music_queue_stop_all_event();
} else {
bool startmusic = false;
menu_push_root_dialog(g_MenuData.unk00c, g_MenuData.unk008);
sp344 = true;
menu_push_root_dialog(g_MenuData.nextdialog, g_MenuData.nextroot);
anyopen2 = true;
if (g_MenuData.root == MENUROOT_MPSETUP || g_MenuData.root == MENUROOT_4MBMAINMENU) {
startmusic = true;
@ -598,8 +599,8 @@ void menu_tick(void)
}
}
g_MenuData.unk00c = NULL;
g_MenuData.unk008 = -1;
g_MenuData.nextdialog = NULL;
g_MenuData.nextroot = -1;
} else {
switch (g_MenuData.root) {
case MENUROOT_ENDSCREEN:
@ -679,7 +680,7 @@ void menu_tick(void)
if (g_MenuData.nextbg != 0) {
g_MenuData.bg = g_MenuData.nextbg;
g_MenuData.nextbg = 0;
g_MenuData.unk010 = 1.0f - g_MenuData.unk010;
g_MenuData.bgopacityfrac = 1.0f - g_MenuData.bgopacityfrac;
}
} else {
if (g_MenuData.bg != 0) {
@ -688,7 +689,7 @@ void menu_tick(void)
}
if (g_Vars.currentplayer->gunctrl.gunmemowner == GUNMEMOWNER_INVMENU && g_Vars.stagenum != STAGE_CITRAINING) {
g_MenuData.unk5d5_01 = true;
g_MenuData.ininventorymenu = true;
if (g_Menus[0].menumodel.allocstart) {
bgun_free_gun_mem();
@ -711,8 +712,8 @@ void menu_tick(void)
if (mpindex >= 0 && g_Vars.players[i]) {
if (g_MenuData.nextbg != 255U
|| g_MenuData.bg
|| g_MenuData.unk5d5_05
|| g_MenuData.unk5d4
|| g_MenuData.triggerhudpiece
|| g_MenuData.hudpieceactive
|| g_Menus[mpindex].curdialog
|| g_MenuData.bannernum != -1) {
g_Vars.players[i]->menuisactive = true;
@ -751,5 +752,5 @@ void menu_tick(void)
}
g_UiScaleX = 1;
g_MenuData.unk5d5_06 = sp344 ? true : false;
g_MenuData.checkroots = anyopen2 ? true : false;
}

View File

@ -2397,7 +2397,7 @@ void mp_end_match(void)
challenge_consider_marking_complete();
}
func0f0f820c(NULL, -6);
menu_save_and_push_root_dialog(NULL, MENUROOT_END_MP_MATCH);
}
s32 mp_get_num_heads2(void)
@ -3311,12 +3311,12 @@ void mpplayerfile_load_wad(s32 playernum, struct savebuffer *buffer, s32 arg2)
if (g_PlayerConfigsArray[playernum].base.mpheadnum >= mp_get_num_heads2()) {
if (guid.fileid != 0 && guid.deviceserial != 0) {
if (g_MenuData.unk668 < 11) {
g_MenuData.unk668++;
g_MenuData.unk5d8[g_MenuData.unk668].fileguid.fileid = guid.fileid;
g_MenuData.unk5d8[g_MenuData.unk668].fileguid.deviceserial = guid.deviceserial;
g_MenuData.unk5d8[g_MenuData.unk668].unk08 = g_MpPlayerNum;
g_MenuData.unk5d8[g_MenuData.unk668].unk09 = g_MpPlayerNum;
if (g_MenuData.lastperfectheadfile < 11) {
g_MenuData.lastperfectheadfile++;
g_MenuData.perfectheadfiles[g_MenuData.lastperfectheadfile].fileguid.fileid = guid.fileid;
g_MenuData.perfectheadfiles[g_MenuData.lastperfectheadfile].fileguid.deviceserial = guid.deviceserial;
g_MenuData.perfectheadfiles[g_MenuData.lastperfectheadfile].playernum1 = g_MpPlayerNum;
g_MenuData.perfectheadfiles[g_MenuData.lastperfectheadfile].playernum2 = g_MpPlayerNum;
}
} else {
g_PlayerConfigsArray[playernum].base.mpheadnum = MPHEAD_DARK_COMBAT;

View File

@ -1966,7 +1966,7 @@ char *mp_menu_text_body_name(struct menuitem *item)
void func0f17b8f0(void)
{
func0f0f139c(g_MpCharacterMenuItems, -0.4f);
menu_set_item_redraw_timer(g_MpCharacterMenuItems, -0.4f);
}
MenuItemHandlerResult mp_player_name_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data)
@ -2047,9 +2047,9 @@ MenuItemHandlerResult mp_load_settings_menu_handler(s32 operation, struct menuit
if (item->param == 1) {
if (IS4MB()) {
func0f0f820c(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU);
menu_save_and_push_root_dialog(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU);
} else {
func0f0f820c(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
menu_save_and_push_root_dialog(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
}
}
break;
@ -4662,7 +4662,7 @@ MenuItemHandlerResult menuhandler0017ec64(s32 operation, struct menuitem *item,
{
if (operation == MENUOP_SET) {
challenge_set_current_by_slot(g_Menus[g_MpPlayerNum].mpsetup.slotindex);
func0f0f820c(&g_MpQuickGoMenuDialog, 3);
menu_save_and_push_root_dialog(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
}
return 0;
@ -4754,12 +4754,12 @@ MenuItemHandlerResult menuhandler0017ef30(s32 operation, struct menuitem *item,
if (operation == MENUOP_SET) {
if (g_Vars.stagenum == STAGE_CITRAINING) {
if (IS4MB()) {
func0f0f820c(&g_CiMenuViaPauseMenuDialog, 2);
menu_save_and_push_root_dialog(&g_CiMenuViaPauseMenuDialog, MENUROOT_MAINMENU);
} else {
func0f0f820c(&g_CiMenuViaPcMenuDialog, 2);
menu_save_and_push_root_dialog(&g_CiMenuViaPcMenuDialog, MENUROOT_MAINMENU);
}
} else {
func0f0f820c(&g_SoloMissionPauseMenuDialog, 2);
menu_save_and_push_root_dialog(&g_SoloMissionPauseMenuDialog, MENUROOT_MAINMENU);
}
}
@ -4929,9 +4929,9 @@ void func0f17f428(void)
mp_configure_quick_team_players();
if (IS4MB()) {
func0f0f820c(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU);
menu_save_and_push_root_dialog(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU);
} else {
func0f0f820c(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
menu_save_and_push_root_dialog(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP);
}
}
@ -5136,7 +5136,7 @@ MenuDialogHandlerResult menudialog_combat_simulator(s32 operation, struct menudi
MenuItemHandlerResult menuhandler_mp_advanced_setup(s32 operation, struct menuitem *item, union handlerdata *data)
{
if (operation == MENUOP_SET) {
func0f0f820c(&g_MpAdvancedSetupMenuDialog, 3);
menu_save_and_push_root_dialog(&g_MpAdvancedSetupMenuDialog, MENUROOT_MPSETUP);
}
return 0;
@ -5853,7 +5853,7 @@ void func0f17fcb0(s32 silent)
if (IS4MB()) {
menu_push_root_dialog(&g_AdvancedSetup4MbMenuDialog, MENUROOT_4MBMAINMENU);
func0f0f8300();
menu_hide_pressstart_labels();
} else {
if (g_BossFile.locktype == MPLOCKTYPE_CHALLENGE) {
menu_push_root_dialog(&g_MpChallengeListOrDetailsViaAdvChallengeMenuDialog, MENUROOT_MPSETUP);
@ -5861,7 +5861,7 @@ void func0f17fcb0(s32 silent)
menu_push_root_dialog(&g_MpAdvancedSetupMenuDialog, MENUROOT_MPSETUP);
}
func0f0f8300();
menu_hide_pressstart_labels();
}
if (!silent) {

View File

@ -4535,7 +4535,7 @@ Gfx *player_render_hud(Gfx *gdl)
if (g_Vars.currentplayer->cameramode != CAMERAMODE_EYESPY
&& player_is_health_visible()
&& func0f0f0c68()) {
&& menu_has_no_background()) {
gdl = player_render_health_bar(gdl);
}
@ -4814,7 +4814,7 @@ void player_die_by_shooter(u32 shooter, bool force)
{
u32 prevplayernum = g_MpPlayerNum;
g_MpPlayerNum = g_Vars.currentplayerstats->mpindex;
func0f0f8120();
menu_save_and_close_all();
g_MpPlayerNum = prevplayernum;
hudmsgs_remove_for_dead_player(g_Vars.currentplayernum);

View File

@ -15114,26 +15114,26 @@ bool propobj_interact(struct prop *prop)
handled = true;
if (data->intraining) {
func0f0f85e0(&g_DtDetailsMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_DtDetailsMenuDialog, MENUROOT_TRAINING);
} else {
func0f0f85e0(&g_DtListMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_DtListMenuDialog, MENUROOT_TRAINING);
}
} else if (tag_id == 0x45) {
struct trainingdata *data = get_holo_training_data();
handled = true;
if (data->intraining) {
func0f0f85e0(&g_HtDetailsMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_HtDetailsMenuDialog, MENUROOT_TRAINING);
} else {
func0f0f85e0(&g_HtListMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_HtListMenuDialog, MENUROOT_TRAINING);
}
} else if (tag_id == 0x7f) {
handled = true;
if (fr_is_in_training()) {
func0f0f85e0(&g_FrTrainingInfoInGameMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_FrTrainingInfoInGameMenuDialog, MENUROOT_TRAINING);
} else {
func0f0f85e0(&g_FrWeaponListMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_FrWeaponListMenuDialog, MENUROOT_TRAINING);
}
}
}
@ -15141,19 +15141,19 @@ bool propobj_interact(struct prop *prop)
if (!handled) {
if (tag_id == 0x0e) {
handled = true;
func0f0f85e0(&g_BioListMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_BioListMenuDialog, MENUROOT_TRAINING);
} else if (tag_id == 0x0f) {
handled = true;
func0f0f85e0(&g_CheatsMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_CheatsMenuDialog, MENUROOT_TRAINING);
} else if (tag_id == 0x1b) {
handled = true;
func0f0f85e0(&g_FrWeaponsAvailableMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_FrWeaponsAvailableMenuDialog, MENUROOT_TRAINING);
} else if (tag_id == 0x47) {
handled = true;
func0f0f85e0(&g_CiMenuViaPcMenuDialog, MENUROOT_MAINMENU);
menu_push_root_dialog_and_pause(&g_CiMenuViaPcMenuDialog, MENUROOT_MAINMENU);
} else if (tag_id == 0x46) {
handled = true;
func0f0f85e0(&g_HangarListMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_HangarListMenuDialog, MENUROOT_TRAINING);
}
}
@ -15162,7 +15162,7 @@ bool propobj_interact(struct prop *prop)
snd_start(var80095200, SFX_TYPING_8118, NULL, -1, -1, -1, -1, -1);
}
func0f0fd494(&prop->pos);
menu_set_source_pos(&prop->pos);
} else if (obj->type == OBJTYPE_ALARM) {
// Button press sound
snd_start(var80095200, SFX_PRESS_SWITCH, NULL, -1, -1, -1, -1, -1);

View File

@ -1726,18 +1726,18 @@ void fr_tick(void)
switch (g_FrData.menutype) {
case FRMENUTYPE_WEAPONLIST:
func0f0f85e0(ci_get_fr_weapon_list_menu_dialog(), MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(ci_get_fr_weapon_list_menu_dialog(), MENUROOT_TRAINING);
break;
case FRMENUTYPE_DETAILS:
func0f0f85e0(&g_FrTrainingInfoPreGameMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_FrTrainingInfoPreGameMenuDialog, MENUROOT_TRAINING);
break;
case FRMENUTYPE_FAILED:
snd_start(var80095200, SFX_TRAINING_FAIL, NULL, -1, -1, -1, -1, -1);
func0f0f85e0(&g_FrFailedMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_FrFailedMenuDialog, MENUROOT_TRAINING);
break;
case FRMENUTYPE_COMPLETED:
snd_start(var80095200, SFX_TRAINING_COMPLETE, NULL, -1, -1, -1, -1, -1);
func0f0f85e0(&g_FrCompletedMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_FrCompletedMenuDialog, MENUROOT_TRAINING);
filemgr_save_or_load(&g_GameFileGuid, FILEOP_SAVE_GAME_000, 0);
break;
}
@ -2778,9 +2778,9 @@ void dt_restore_player(void)
void dt_push_endscreen(void)
{
if (g_DtData.completed) {
func0f0f85e0(&g_DtCompletedMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_DtCompletedMenuDialog, MENUROOT_TRAINING);
} else if (g_DtData.failed) {
func0f0f85e0(&g_DtFailedMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_DtFailedMenuDialog, MENUROOT_TRAINING);
}
g_DtData.timeleft = 0;
@ -3063,9 +3063,9 @@ struct trainingdata *get_holo_training_data(void)
void ht_push_endscreen(void)
{
if (g_HtData.completed) {
func0f0f85e0(&g_HtCompletedMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_HtCompletedMenuDialog, MENUROOT_TRAINING);
} else if (g_HtData.failed) {
func0f0f85e0(&g_HtFailedMenuDialog, MENUROOT_TRAINING);
menu_push_root_dialog_and_pause(&g_HtFailedMenuDialog, MENUROOT_TRAINING);
}
g_HtData.timeleft = 0;

View File

@ -65,7 +65,7 @@ MenuItemHandlerResult fr_details_ok_menu_handler(s32 operation, struct menuitem
fr_begin_session(weapon);
}
func0f0f8120();
menu_save_and_close_all();
break;
}
@ -884,7 +884,7 @@ MenuItemHandlerResult menuhandler_fr_failed_continue(s32 operation, struct menui
{
if (operation == MENUOP_SET) {
if (g_Vars.currentplayer->prop->rooms[0] == 0xa) {
func0f0f3704(&g_FrWeaponListMenuDialog);
menu_replace_current_dialog(&g_FrWeaponListMenuDialog);
} else {
menu_pop_dialog();
}
@ -1720,7 +1720,7 @@ MenuItemHandlerResult menuhandler_dt_ok_or_resume(s32 operation, struct menuitem
// @bug: dt_begin() should not be called if training is already in
// progress. Doing this resets the training timer.
dt_begin();
func0f0f8120();
menu_save_and_close_all();
}
return 0;
@ -2029,7 +2029,7 @@ MenuItemHandlerResult menuhandler001a6a34(s32 operation, struct menuitem *item,
{
if (operation == MENUOP_SET) {
ht_begin();
func0f0f8120();
menu_save_and_close_all();
}
return 0;

View File

@ -1771,19 +1771,22 @@
#define MENUREPEATMODE_SLOW 0
#define MENUREPEATMODE_FAST 1
#define MENUROOT_ENDSCREEN 1
#define MENUROOT_MAINMENU 2
#define MENUROOT_MPSETUP 3
#define MENUROOT_MPPAUSE 4
#define MENUROOT_MPENDSCREEN 5
#define MENUROOT_FILEMGR 6
#define MENUROOT_BOOTPAKMGR 7
#define MENUROOT_PICKTARGET 8
#define MENUROOT_COOPCONTINUE 9
#define MENUROOT_4MBFILEMGR 10
#define MENUROOT_4MBMAINMENU 11
#define MENUROOT_12 12
#define MENUROOT_TRAINING 13
#define MENUROOT_ENDSCREEN 1
#define MENUROOT_MAINMENU 2
#define MENUROOT_MPSETUP 3
#define MENUROOT_MPPAUSE 4
#define MENUROOT_MPENDSCREEN 5
#define MENUROOT_FILEMGR 6
#define MENUROOT_BOOTPAKMGR 7
#define MENUROOT_PICKTARGET 8
#define MENUROOT_COOPCONTINUE 9
#define MENUROOT_4MBFILEMGR 10
#define MENUROOT_4MBMAINMENU 11
#define MENUROOT_12 12
#define MENUROOT_TRAINING 13
#define MENUROOT_START_MP_MATCH -5
#define MENUROOT_END_MP_MATCH -6
#define MENUROOT_CHANGE_AGENT -7
#define MENUSOUND_SWIPE 0x00 // Navigating to left/right dialog
#define MENUSOUND_OPENDIALOG 0x01

View File

@ -14,16 +14,16 @@ void menu_stop(void);
void menu_play_sound(s32 menusound);
bool current_player_is_menu_open_in_solo_or_mp(void);
bool func0f0f0c68(void);
bool menu_has_no_background(void);
void menu_set_banner(s32 bannernum, bool allplayers);
#if VERSION >= VERSION_NTSC_1_0
#else
#endif
struct menudfc *func0f0f1338(struct menuitem *item);
void func0f0f139c(struct menuitem *item, f32 arg1);
void func0f0f13ec(struct menuitem *item);
struct menuitemredrawinfo *menu_find_item_redraw_info(struct menuitem *item);
void menu_set_item_redraw_timer(struct menuitem *item, f32 timer60);
void menu_remove_item_redraw_info(struct menuitem *item);
char *menu_resolve_text(uintptr_t thing, void *dialogoritem);
char *menu_resolve_param2_text(struct menuitem *item);
s32 dialog_find_item(struct menudialog *dialog, struct menuitem *item, s32 *rowindex, s32 *colindex);
@ -32,15 +32,15 @@ bool menu_is_item_disabled(struct menuitem *item, struct menudialog *dialog);
void menu_push_dialog(struct menudialogdef *dialogdef);
#if VERSION >= VERSION_NTSC_1_0
bool func0f0f3220(s32 arg0);
bool menu_save_file(s32 arg0);
#else
void func0f0f3220(s32 arg0);
void menu_save_file(s32 arg0);
#endif
void menu_close_dialog(void);
void menu_update_cur_frame(void);
void menu_pop_dialog(void);
void func0f0f3704(struct menudialogdef *dialogdef);
void menu_replace_current_dialog(struct menudialogdef *dialogdef);
void menu_configure_model(struct menumodel *menumodel, f32 x, f32 y, f32 z, f32 rotx, f32 roty, f32 rotz, f32 scale, u8 flags);
void menu_unset_model(struct menumodel *menumodel);
Gfx *menu_render_model(Gfx *gdl, struct menumodel *menumodel, s32 modeltype);
@ -50,22 +50,22 @@ Gfx *menu_apply_scissor(Gfx *gdl);
#else
#endif
void func0f0f8120(void);
void func0f0f820c(struct menudialogdef *dialogdef, s32 root);
void func0f0f8300(void);
void menu_save_and_close_all(void);
void menu_save_and_push_root_dialog(struct menudialogdef *dialogdef, s32 root);
void menu_hide_pressstart_labels(void);
void menu_push_root_dialog(struct menudialogdef *dialogdef, s32 arg1);
void func0f0f85e0(struct menudialogdef *dialogdef, s32 root);
void menu_push_root_dialog_and_pause(struct menudialogdef *dialogdef, s32 root);
void menu_reset_model(struct menumodel *menumodel, u32 allocationlen, bool allocate);
void menu_reset(void);
void func0f0fa6ac(void);
void menu_consider_unpause(void);
void menu_process_input(void);
Gfx *menu_render(Gfx *gdl);
u32 menu_choose_music(void);
u32 menu_get_root(void);
bool menu_is_ready_for_pak_error(s32 device, s32 arg1);
void menu_push_pak_error_dialog(s32 arg0, s32 arg1);
void func0f0fd494(struct coord *pos);
void func0f0fd548(s32 arg0);
void menu_set_source_pos(struct coord *pos);
void menu_queue_save(s32 playernum);
struct menudialog *menu_is_dialog_open(struct menudialogdef *dialogdef);
struct chrdata *current_player_get_commanding_aibot(void);

View File

@ -3689,9 +3689,9 @@ struct menudialog {
/*0x6e*/ u8 unk6e;
};
struct menudfc {
struct menuitemredrawinfo {
struct menuitem *item;
f32 unk04;
f32 timer60;
};
struct menudata_endscreen {
@ -3921,7 +3921,7 @@ struct menu {
/*0x83f*/ u8 unk83f;
/*0x840*/ struct menumodel menumodel;
/*0xdf8*/ s8 bannernum;
/*0xdfc*/ struct menudfc unkdfc[4];
/*0xdfc*/ struct menuitemredrawinfo itemredrawinfo[4];
union {
struct menudata_endscreen endscreen;
@ -4700,42 +4700,38 @@ struct frdata {
/*0x47c*/ u32 unk47c;
};
struct menudata_5d8 {
struct perfectheadfile {
struct fileguid fileguid;
u8 unk08;
u8 unk09;
u8 unk0a;
u8 unk0b;
u8 playernum1;
u8 playernum2;
};
struct menudata {
/*0x000*/ s32 count;
/*0x004*/ s32 root;
/*0x008*/ s32 unk008; // also a menuroot constant
/*0x00c*/ struct menudialogdef *unk00c;
/*0x010*/ f32 unk010;
/*0x008*/ s32 nextroot;
/*0x00c*/ struct menudialogdef *nextdialog;
/*0x010*/ f32 bgopacityfrac;
/*0x014*/ u8 bg;
/*0x015*/ u8 nextbg;
/*0x016*/ u8 screenshottimer;
/*0x017*/ u8 playerjoinalpha[MAX_PLAYERS];
/*0x01b*/ s8 bannernum;
/*0x01c*/ struct menumodel hudpiece;
/*0x5d4*/ u8 unk5d4;
/*0x5d5*/ u8 unk5d5_01 : 1;
/*0x5d5*/ u8 unk5d5_02 : 1;
/*0x5d4*/ u8 hudpieceactive;
/*0x5d5*/ u8 ininventorymenu : 1;
/*0x5d5*/ u8 unk5d5_unused : 1;
/*0x5d5*/ u8 usezbuf : 1;
/*0x5d5*/ u8 unk5d5_04 : 1;
/*0x5d5*/ u8 unk5d5_05 : 1;
/*0x5d5*/ u8 unk5d5_06 : 1;
/*0x5d5*/ u8 unk5d5_07 : 1;
/*0x5d5*/ u8 unk5d5_08 : 1;
/*0x5d8*/ struct menudata_5d8 unk5d8[12];
/*0x668*/ s8 unk668;
/*0x669*/ u8 unk669[5];
/*0x66e*/ s8 unk66e; // index into 669
/*0x66f*/ u8 unk66f;
/*0x670*/ s32 unk670;
/*0x674*/ s32 unk674;
/*0x5d5*/ u8 openedfrompc : 1;
/*0x5d5*/ u8 triggerhudpiece : 1;
/*0x5d5*/ u8 checkroots : 1;
/*0x5d8*/ struct perfectheadfile perfectheadfiles[12];
/*0x668*/ s8 lastperfectheadfile;
/*0x669*/ u8 pendingsaves[5];
/*0x66e*/ s8 numpendingsaves;
/*0x66f*/ u8 savetimer;
/*0x670*/ s32 projectfromx;
/*0x674*/ s32 projectfromy;
};
struct ammotype {