diff --git a/src/game/activemenu.c b/src/game/activemenu.c index 9cb2d128d..9e0e41b80 100644 --- a/src/game/activemenu.c +++ b/src/game/activemenu.c @@ -88,7 +88,7 @@ MenuItemHandlerResult am_pick_target_menu_list(s32 operation, struct menuitem *i }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: if (g_AmMenus[g_AmIndex].prevallbots) { // All bots: num bot opponents + all human players s32 count = 0; @@ -108,7 +108,7 @@ MenuItemHandlerResult am_pick_target_menu_list(s32 operation, struct menuitem *i data->list.value = g_MpNumChrs - 1; } break; - case MENUOP_SET: + case MENUOP_CONFIRM: { s32 numremaining; s32 chrindex; @@ -148,7 +148,7 @@ MenuItemHandlerResult am_pick_target_menu_list(s32 operation, struct menuitem *i menu_pop_dialog(); } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = 0xfffff; break; case MENUOP_RENDER: @@ -192,7 +192,7 @@ MenuItemHandlerResult am_pick_target_menu_list(s32 operation, struct menuitem *i gdl = text_end(gdl); return (s32)gdl; } - case MENUOP_GETOPTIONHEIGHT: + case MENUOP_GET_OPTION_HEIGHT: data->list.value = LINEHEIGHT; break; } @@ -203,13 +203,13 @@ MenuItemHandlerResult am_pick_target_menu_list(s32 operation, struct menuitem *i MenuDialogHandlerResult am_pick_target_menu_dialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: g_PlayersWithControl[g_Vars.currentplayernum] = false; break; - case MENUOP_TICK: + case MENUOP_ON_TICK: g_PlayersWithControl[g_Vars.currentplayernum] = false; break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: g_PlayersWithControl[g_Vars.currentplayernum] = true; break; } diff --git a/src/game/cheats.c b/src/game/cheats.c index 85fc5418d..312777583 100644 --- a/src/game/cheats.c +++ b/src/game/cheats.c @@ -297,7 +297,7 @@ void cheats_reset(void) MenuItemHandlerResult cheat_checkbox_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: if (item->param < 32) { if (g_CheatsEnabledBank0 & (1 << item->param)) { return true; @@ -311,7 +311,7 @@ MenuItemHandlerResult cheat_checkbox_menu_handler(s32 operation, struct menuitem } return false; - case MENUOP_SET: + case MENUOP_CONFIRM: if (cheat_is_unlocked(item->param)) { if (item->param < 32) { // Bank 0 @@ -348,7 +348,7 @@ MenuItemHandlerResult cheat_checkbox_menu_handler(s32 operation, struct menuitem MenuItemHandlerResult cheat_menu_handle_buddy_checkbox(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: if (item->param == 0) { if (g_CheatsEnabledBank0 & (1 << CHEAT_PUGILIST | 1 << CHEAT_HOTSHOT | 1 << CHEAT_HITANDRUN | 1 << CHEAT_ALIEN)) { return false; @@ -362,7 +362,7 @@ MenuItemHandlerResult cheat_menu_handle_buddy_checkbox(s32 operation, struct men } return false; - case MENUOP_SET: + case MENUOP_CONFIRM: if (item->param == 0) { // Velvet g_CheatsEnabledBank0 &= ~( @@ -397,7 +397,7 @@ char *cheat_get_name_if_unlocked(struct menuitem *item) MenuDialogHandlerResult cheat_menu_handle_dialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { camdraw_start_gbpaks(); if (gbpak_is_any_perfect_dark()) { @@ -429,7 +429,7 @@ MenuDialogHandlerResult cheat_menu_handle_dialog(s32 operation, struct menudialo #endif } - if (operation == MENUOP_CLOSE) { + if (operation == MENUOP_ON_CLOSE) { if (gbpak_is_any_perfect_dark()) { gamefile_set_flag(GAMEFILEFLAG_USED_TRANSFERPAK); } @@ -804,7 +804,7 @@ char *cheat_get_marquee(struct menuitem *arg0) MenuItemHandlerResult cheat_menu_handle_turn_off_all_cheats(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_CheatsEnabledBank0 = 0; g_CheatsEnabledBank1 = 0; } diff --git a/src/game/endscreen.c b/src/game/endscreen.c index 1826cb9ca..aa874528a 100644 --- a/src/game/endscreen.c +++ b/src/game/endscreen.c @@ -49,7 +49,7 @@ char *endscreen_menu_text_completion_cheat_name(struct menuitem *item); MenuItemHandlerResult endscreen_handle_decline_mission(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_pop_dialog(); menu_pop_dialog(); } @@ -60,7 +60,7 @@ MenuItemHandlerResult endscreen_handle_decline_mission(s32 operation, struct men MenuDialogHandlerResult endscreen_handle_retry_mission(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { switch (operation) { - case MENUOP_TICK: + case MENUOP_ON_TICK: { /** * NTSC Final adds this check to make sure the given dialog is @@ -99,7 +99,7 @@ MenuDialogHandlerResult endscreen_handle_retry_mission(s32 operation, struct men if (accept) { union handlerdata data2; - menuhandler_accept_mission(MENUOP_SET, &dialogdef->items[1], &data2); + menuhandler_accept_mission(MENUOP_CONFIRM, &dialogdef->items[1], &data2); } #if VERSION >= VERSION_NTSC_FINAL } @@ -147,7 +147,7 @@ char *endscreen_menu_title_next_mission(struct menudialogdef *dialogdef) MenuItemHandlerResult endscreen_handle_replay_previous_mission(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_MissionConfig.stageindex--; g_MissionConfig.stagenum = g_SoloStages[g_MissionConfig.stageindex].stagenum; } @@ -466,7 +466,7 @@ void endscreen_reset_models(void) #if VERSION >= VERSION_NTSC_1_0 MenuItemHandlerResult endscreen_handle_replay_last_level(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_MissionConfig.stagenum = g_SoloStages[g_MissionConfig.stageindex].stagenum; return menuhandler_accept_mission(operation, NULL, data); } @@ -573,7 +573,7 @@ struct menudialogdef g_2PMissionEndscreenObjectivesCompletedVMenuDialog = { */ MenuItemHandlerResult endscreen_handle_continue_mission(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { endscreen_continue(2); } @@ -718,11 +718,11 @@ void endscreen_continue(s32 context) MenuDialogHandlerResult endscreen_handle_2p_completed(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { g_Menus[g_MpPlayerNum].endscreen.unke1c = 0; } - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_TICK) { if (g_Menus[g_MpPlayerNum].curdialog) { if (g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef || (dialogdef->nextsibling && dialogdef->nextsibling == g_Menus[g_MpPlayerNum].curdialog->definition)) { @@ -779,11 +779,11 @@ MenuDialogHandlerResult endscreen_handle_2p_completed(s32 operation, struct menu MenuDialogHandlerResult endscreen_handle_2p_failed(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { g_Menus[g_MpPlayerNum].endscreen.unke1c = 0; } - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_TICK) { if (g_Menus[g_MpPlayerNum].curdialog) { if (g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef || (dialogdef->nextsibling && dialogdef->nextsibling == g_Menus[g_MpPlayerNum].curdialog->definition)) { @@ -1016,7 +1016,7 @@ MenuItemHandlerResult endscreen_handle_cheat_info(s32 operation, struct menuitem { static u32 cheatcolour = 0xff7f7fff; - if (operation == MENUOP_GETCOLOUR + if (operation == MENUOP_GET_LABEL_COLOURS && ((g_Menus[g_MpPlayerNum].endscreen.cheatinfo & CHEATINFO_TIMED_UNLOCKING) || item->param == 5)) { // Timed cheat just got unlocked, or this item is the timed cheat name u32 weight = menu_get_sin_osc_frac(40) * 255; @@ -1039,7 +1039,7 @@ MenuItemHandlerResult endscreen_handle_cheat_info(s32 operation, struct menuitem } } - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { if (item->param == 1) { // target time u32 info = g_Menus[g_MpPlayerNum].endscreen.cheatinfo; diff --git a/src/game/filemgr.c b/src/game/filemgr.c index 852ed9b43..445e4fa43 100644 --- a/src/game/filemgr.c +++ b/src/game/filemgr.c @@ -68,7 +68,7 @@ bool filemgr_attempt_operation(s32 device, bool closeonsuccess); #if PAL MenuItemHandlerResult filemgr_handle_set_language(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_Vars.language = item->param; lang_set_european(g_Vars.language); menu_pop_dialog(); @@ -169,7 +169,7 @@ char *filemgr_get_device_name(s32 index) MenuItemHandlerResult filemgr_device_name_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { if ((g_Menus[g_MpPlayerNum].fm.device1 & 0x7f) >= SAVEDEVICE_INVALID) { return true; } @@ -237,7 +237,7 @@ const u32 g_FileTypeSizes[] = {0xa0, 0x31, 0x4e, 0x4a0}; MenuItemHandlerResult filemgr_file_name_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { if (g_Menus[g_MpPlayerNum].fm.filetodelete == 0) { return true; } @@ -313,7 +313,7 @@ char *filemgr0f108484(struct menuitem *item) MenuItemHandlerResult filemgr_device_name_for_error_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { if ((g_Menus[g_MpPlayerNum].fm.device1 & 0x7f) >= SAVEDEVICE_INVALID) { return true; } @@ -431,7 +431,7 @@ s32 filemgr_get_device_name_or_start_index(s32 listnum, s32 operation, s32 optio for (i = 0; i < ARRAYCOUNT(names); i++) { if (g_FileLists[listnum]->devicestartindexes[i] != -1) { if (remaining == 0) { - if (operation == MENUOP_GETOPTGROUPTEXT) { + if (operation == MENUOP_GET_OPTGROUP_TEXT) { return (s32)lang_get(names[i]); } @@ -590,7 +590,7 @@ void filemgr_handle_success(void) MenuItemHandlerResult filemgr_retry_save_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { filemgr_retry_save(2); } @@ -599,7 +599,7 @@ MenuItemHandlerResult filemgr_retry_save_menu_handler(s32 operation, struct menu MenuItemHandlerResult filemgr_save_elsewhere_yes_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { s32 filetype; menu_close_dialog(); @@ -629,7 +629,7 @@ MenuItemHandlerResult filemgr_save_elsewhere_yes_menu_handler(s32 operation, str MenuItemHandlerResult filemgr_cancel_save2_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_close_dialog(); func0f10898c(); menu_update_cur_frame(); @@ -643,7 +643,7 @@ MenuItemHandlerResult filemgr_cancel_save2_menu_handler(s32 operation, struct me */ MenuItemHandlerResult filemgr0f108d14(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { filemgr_retry_save(2); } @@ -652,7 +652,7 @@ MenuItemHandlerResult filemgr0f108d14(s32 operation, struct menuitem *item, unio MenuItemHandlerResult filemgr_acknowledge_file_lost_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_close_dialog(); func0f10898c(); menu_update_cur_frame(); @@ -685,7 +685,7 @@ void filemgr_erase_corrupt_file(void) MenuDialogHandlerResult filemgr_insert_original_pak_menu_dialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_TICK) { if (g_Menus[g_MpPlayerNum].curdialog && g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef) { filemgr_retry_save(0); @@ -697,7 +697,7 @@ MenuDialogHandlerResult filemgr_insert_original_pak_menu_dialog(s32 operation, s MenuItemHandlerResult filemgr_reinserted_ok_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { pak_execute_debug_operations(); filemgr_retry_save(1); } @@ -707,7 +707,7 @@ MenuItemHandlerResult filemgr_reinserted_ok_menu_handler(s32 operation, struct m MenuItemHandlerResult filemgr_reinserted_cancel_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { if (FILEOP_IS_SAVE(g_Menus[g_MpPlayerNum].fm.fileop) && g_Menus[g_MpPlayerNum].fm.fileop != FILEOP_SAVE_GAME_001) { menu_replace_current_dialog(&g_FilemgrSaveElsewhereMenuDialog); } else { @@ -1523,13 +1523,13 @@ MenuItemHandlerResult filemgr_confirm_rename_menu_handler(s32 operation, struct char *name = data->keyboard.string; switch (operation) { - case MENUOP_GETTEXT: + case MENUOP_GET_KEYBOARD_STRING: filemgr_get_rename_name(name); break; - case MENUOP_SETTEXT: + case MENUOP_SET_KEYBOARD_STRING: filemgr_set_rename_name(name); break; - case MENUOP_SET: + case MENUOP_CONFIRM: filemgr_save_to_device(); break; } @@ -1541,7 +1541,7 @@ MenuItemHandlerResult filemgr_confirm_rename_menu_handler(s32 operation, struct #if VERSION >= VERSION_NTSC_1_0 MenuItemHandlerResult filemgr_duplicate_rename_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_pop_dialog(); menu_push_dialog(&g_FilemgrRenameMenuDialog); } @@ -1553,7 +1553,7 @@ MenuItemHandlerResult filemgr_duplicate_rename_menu_handler(s32 operation, struc #if VERSION >= VERSION_NTSC_1_0 MenuItemHandlerResult filemgr_duplicate_cancel_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_pop_dialog(); menu_pop_dialog(); } @@ -1754,13 +1754,13 @@ MenuItemHandlerResult filemgr_select_location_menu_handler(s32 operation, struct return 0; } - if (operation == MENUOP_CHECKDISABLED) { + if (operation == MENUOP_IS_DISABLED) { if (g_FileLists[g_Menus[g_MpPlayerNum].fm.listnum]->spacesfree[item->param] < 1) { return true; } } - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { #if VERSION >= VERSION_NTSC_1_0 g_Menus[g_MpPlayerNum].fm.device2 = item->param; filemgr_save_to_device(); @@ -1797,7 +1797,7 @@ MenuItemHandlerResult filemgr_select_location_menu_handler(s32 operation, struct MenuItemHandlerResult filemgr_cancel_save_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_pop_dialog(); } @@ -1806,7 +1806,7 @@ MenuItemHandlerResult filemgr_cancel_save_menu_handler(s32 operation, struct men MenuItemHandlerResult filemgr_delete_files_for_save_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { filemgr_push_delete_file_dialog(g_Menus[g_MpPlayerNum].fm.listnum); g_Menus[g_MpPlayerNum].fm.isdeletingforsave = true; } @@ -1878,7 +1878,7 @@ bool filemgr_is_file_in_use(struct filelistfile *file) MenuItemHandlerResult filemgr_confirm_delete_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { #if VERSION >= VERSION_JPN_FINAL struct filelistfile file; file.fileid = g_FilemgrFileToDelete[g_MpPlayerNum].fileid; @@ -2034,10 +2034,10 @@ MenuItemHandlerResult filemgr_file_to_copy_or_delete_list_menu_handler(s32 opera } switch (operation) { - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = 0x0fffff; break; - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = list->numfiles; break; case MENUOP_RENDER: @@ -2074,15 +2074,15 @@ MenuItemHandlerResult filemgr_file_to_copy_or_delete_list_menu_handler(s32 opera return (uintptr_t) gdl; } - case MENUOP_GETOPTIONHEIGHT: + case MENUOP_GET_OPTION_HEIGHT: data->list.value = 11; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = list->numdevices; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return filemgr_get_device_name_or_start_index(listnum, operation, data->list.value); - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: data->list.groupstartindex = filemgr_get_device_name_or_start_index(listnum, operation, data->list.value); return 0; } @@ -2096,7 +2096,7 @@ MenuItemHandlerResult filemgr_file_to_delete_list_menu_handler(s32 operation, st return 0; } - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { struct filelistfile *file = &g_FileLists[g_Menus[g_MpPlayerNum].fm.listnum]->files[data->list.value]; if (file) { @@ -2128,7 +2128,7 @@ MenuItemHandlerResult filemgr_file_to_copy_list_menu_handler(s32 operation, stru return 0; } - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { struct filelistfile *file = &list->files[data->list.value]; if (file) { @@ -2147,7 +2147,7 @@ MenuItemHandlerResult filemgr_file_to_copy_list_menu_handler(s32 operation, stru MenuDialogHandlerResult filemgr_copy_or_delete_list_menu_dialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_CLOSE) { + if (operation == MENUOP_ON_CLOSE) { if (g_Menus[g_MpPlayerNum].fm.isdeletingforsave == true) { g_Menus[g_MpPlayerNum].fm.isdeletingforsave = false; } else { @@ -2178,7 +2178,7 @@ void filemgr_push_delete_file_dialog(s32 listnum) MenuItemHandlerResult pak_delete_game_note_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { OSPfsState *note = &g_EditingPak->notes[g_Menus[g_MpPlayerNum].fm.noteindex]; s32 result; @@ -2236,10 +2236,10 @@ MenuItemHandlerResult pak_game_note_list_menu_handler(s32 operation, struct menu } switch (operation) { - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = 0x0fffff; break; - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = 16; break; case MENUOP_RENDER: @@ -2291,10 +2291,10 @@ MenuItemHandlerResult pak_game_note_list_menu_handler(s32 operation, struct menu renderdata->colour, vi_get_width(), vi_get_height(), 0, 1); return (uintptr_t) gdl; - case MENUOP_GETOPTIONHEIGHT: + case MENUOP_GET_OPTION_HEIGHT: data->list.value = VERSION == VERSION_JPN_FINAL ? LINEHEIGHT - 1 : LINEHEIGHT; break; - case MENUOP_SET: + case MENUOP_CONFIRM: if (g_EditingPak->notesinuse[data->list.value] == true) { g_Menus[g_MpPlayerNum].fm.noteindex = data->list.value; menu_push_dialog(&g_PakDeleteNoteMenuDialog); @@ -2315,7 +2315,7 @@ const char var7f1b34e8[] = "Try to find last opened file...\n"; */ MenuDialogHandlerResult pak_game_notes_menu_dialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_TICK) { if (g_Menus[g_MpPlayerNum].curdialog && g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef) { PakErr1 ret = pak0f1168c4(g_Menus[g_MpPlayerNum].fm.device, &g_EditingPak); @@ -2406,13 +2406,13 @@ char *pak_menu_text_editing_pak_name(struct menuitem *item) */ MenuItemHandlerResult pak_selection_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKDISABLED) { + if (operation == MENUOP_IS_DISABLED) { if (!mempak_is_okay((s8)item->param)) { return true; } } - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_Menus[g_MpPlayerNum].fm.device = item->param; menu_push_dialog(&g_PakGameNotesMenuDialog); } @@ -2429,14 +2429,14 @@ MenuDialogHandlerResult pak_choose_pak_menu_dialog(s32 operation, struct menudia { #if VERSION >= VERSION_NTSC_1_0 switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: joy_set_pfs_poll_interval(3); g_Menus[g_MpPlayerNum].fm.unke24 = 0; break; - case MENUOP_TICK: + case MENUOP_ON_TICK: var80062944 = 1; break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: if (g_Vars.stagenum != STAGE_BOOTPAKMENU) { s32 i; @@ -2453,15 +2453,15 @@ MenuDialogHandlerResult pak_choose_pak_menu_dialog(s32 operation, struct menudia } #else switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: joy_set_pfs_poll_interval(3); joy_set_pfs_poll_interval(-1); g_Menus[g_MpPlayerNum].fm.unke24 = 0; break; - case MENUOP_TICK: + case MENUOP_ON_TICK: var80062944 = 1; break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: { s32 i; @@ -2482,7 +2482,7 @@ MenuDialogHandlerResult pak_choose_pak_menu_dialog(s32 operation, struct menudia MenuItemHandlerResult filemgr_open_copy_file_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_Menus[g_MpPlayerNum].fm.filetypeplusone = item->param + 1; filelist_create(0, item->param); @@ -2499,7 +2499,7 @@ MenuItemHandlerResult filemgr_open_copy_file_menu_handler(s32 operation, struct MenuItemHandlerResult filemgr_open_delete_file_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_Menus[g_MpPlayerNum].fm.filetypeplusone = item->param + 1; filelist_create(0, item->param); g_Menus[g_MpPlayerNum].fm.unke3e = -1; @@ -2518,13 +2518,13 @@ MenuItemHandlerResult filemgr_agent_name_keyboard_menu_handler(s32 operation, st } switch (operation) { - case MENUOP_GETTEXT: + case MENUOP_GET_KEYBOARD_STRING: strcpy(name, g_GameFile.name); break; - case MENUOP_SETTEXT: + case MENUOP_SET_KEYBOARD_STRING: strcpy(g_GameFile.name, name); break; - case MENUOP_SET: + case MENUOP_CONFIRM: filemgr_push_select_location_dialog(0, FILETYPE_GAME); g_Menus[g_MpPlayerNum].fm.unke2c = 1; break; @@ -2561,10 +2561,10 @@ MenuItemHandlerResult filemgr_choose_agent_list_menu_handler(s32 operation, stru } switch (operation) { - case MENUOP_GETSELECTEDINDEX: - data->list.value = 0x0fffff; + case MENUOP_GET_SELECTED_INDEX: + data->list.value = 0xfffff; break; - case MENUOP_25: + case MENUOP_GET_OPTION_INDEX2: pass = false; if (data->list.unk04 == 1) { @@ -2597,7 +2597,7 @@ MenuItemHandlerResult filemgr_choose_agent_list_menu_handler(s32 operation, stru } } break; - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = g_FileLists[0]->numfiles + 1; break; case MENUOP_RENDER: @@ -2727,10 +2727,10 @@ MenuItemHandlerResult filemgr_choose_agent_list_menu_handler(s32 operation, stru } gdl = text_end(gdl); return (uintptr_t) gdl; - case MENUOP_GETOPTIONHEIGHT: + case MENUOP_GET_OPTION_HEIGHT: data->list.value = 40; break; - case MENUOP_SET: + case MENUOP_CONFIRM: if (data->list.value == g_FileLists[0]->numfiles) { // New agent gamefile_load_defaults(&g_GameFile); @@ -2745,15 +2745,15 @@ MenuItemHandlerResult filemgr_choose_agent_list_menu_handler(s32 operation, stru } } break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = g_FileLists[0]->numdevices + 1; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: if (data->list.value >= g_FileLists[0]->numdevices) { return (uintptr_t) lang_get(L_OPTIONS_402); // "New..." } return filemgr_get_device_name_or_start_index(0, operation, data->list.value); - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: if (data->list.value >= g_FileLists[0]->numdevices) { data->list.groupstartindex = g_FileLists[0]->numfiles; } else { @@ -2770,7 +2770,7 @@ MenuDialogHandlerResult filemgr_main_menu_dialog(s32 operation, struct menudialo s32 i; switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: g_Menus[g_MpPlayerNum].fm.filetypeplusone = 0; filelist_create(0, FILETYPE_GAME); @@ -2783,11 +2783,11 @@ MenuDialogHandlerResult filemgr_main_menu_dialog(s32 operation, struct menudialo } } break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: func0f110bf8(); break; #if VERSION < VERSION_NTSC_1_0 - case MENUOP_TICK: + case MENUOP_ON_TICK: filelists_tick(); break; #endif diff --git a/src/game/fmb.c b/src/game/fmb.c index d26d69314..7bc609fad 100644 --- a/src/game/fmb.c +++ b/src/game/fmb.c @@ -14,7 +14,7 @@ MenuItemHandlerResult fmb_handle_drop_out(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_pop_dialog(); menu_pop_dialog(); @@ -28,7 +28,7 @@ MenuItemHandlerResult fmb_handle_drop_out(s32 operation, struct menuitem *item, MenuItemHandlerResult fmd_handle_abort_game(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { if (g_Vars.stagenum == STAGE_4MBMENU) { menu_save_and_push_root_dialog(&g_MainMenu4MbMenuDialog, MENUROOT_4MBMAINMENU); } else { @@ -41,7 +41,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) { + if (operation == MENUOP_CONFIRM) { menu_save_and_push_root_dialog(&g_AdvancedSetup4MbMenuDialog, MENUROOT_4MBMAINMENU); } @@ -50,7 +50,7 @@ MenuItemHandlerResult fmb_handle_advanced_setup(s32 operation, struct menuitem * MenuItemHandlerResult fmb_handle_accept_challenge(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { challenge_set_current_by_slot(g_Menus[g_MpPlayerNum].main4mb.slotindex); menu_save_and_push_root_dialog(&g_MpQuickGo4MbMenuDialog, MENUROOT_4MBMAINMENU); } @@ -96,7 +96,7 @@ void fmb_reset(void) MenuDialogHandlerResult fmb_handle_main_menu(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { g_Vars.waitingtojoin[0] = false; g_Vars.waitingtojoin[1] = false; g_Vars.waitingtojoin[2] = false; @@ -105,7 +105,7 @@ MenuDialogHandlerResult fmb_handle_main_menu(s32 operation, struct menudialogdef if (g_Menus[g_MpPlayerNum].curdialog && g_Menus[g_MpPlayerNum].curdialog->definition == &g_MainMenu4MbMenuDialog - && operation == MENUOP_TICK) { + && operation == MENUOP_ON_TICK) { g_Vars.mpsetupmenu = MPSETUPMENU_GENERAL; g_Vars.mpquickteam = MPQUICKTEAM_NONE; g_Vars.usingadvsetup = false; diff --git a/src/game/mainmenu.c b/src/game/mainmenu.c index ff67d00e4..4e7358b1c 100644 --- a/src/game/mainmenu.c +++ b/src/game/mainmenu.c @@ -89,28 +89,28 @@ MenuItemHandlerResult menuhandler_control_style_impl(s32 operation, struct menui } switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = 8; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 2; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) lang_get(g_ControlStyleOptions[data->list.value]); - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return (s32) lang_get(categories[data->list.value]); - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: data->list.groupstartindex = data->list.value == 0 ? 0 : 4; break; - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_control_mode(mpindex, data->list.value); g_Vars.modifiedfiles |= MODFILE_GAME; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = options_get_control_mode(mpindex); g_Menus[g_MpPlayerNum].main.mpindex = mpindex; break; - case MENUOP_LISTITEMFOCUS: + case MENUOP_ON_OPTION_FOCUS: if (g_MenuData.root == MENUROOT_MAINMENU) { g_Menus[g_MpPlayerNum].main.controlmode = data->list.value; } @@ -141,9 +141,9 @@ MenuItemHandlerResult menuhandler_reverse_pitch(s32 operation, struct menuitem * } switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return !options_get_forward_pitch(mpchrnum); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_forward_pitch(mpchrnum, data->checkbox.value == 0); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -175,20 +175,20 @@ MenuItemHandlerResult menuhandler_aim_control(s32 operation, struct menuitem *it #endif switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = 2; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: #if VERSION >= VERSION_PAL_FINAL return (s32) lang_get(options[index][data->dropdown.value]); #else return (s32) lang_get(options[data->dropdown.value]); #endif - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_aim_control(playernum, data->dropdown.value); g_Vars.modifiedfiles |= MODFILE_GAME; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = options_get_aim_control(playernum); } @@ -205,16 +205,16 @@ MenuItemHandlerResult menuhandler_sound_mode(s32 operation, struct menuitem *ite }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = 4; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) lang_get(options[data->dropdown.value]); - case MENUOP_SET: + case MENUOP_CONFIRM: snd_set_sound_mode(data->dropdown.value); g_Vars.modifiedfiles |= MODFILE_GAME; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = g_SoundMode; } @@ -230,16 +230,16 @@ MenuItemHandlerResult menuhandler_screen_size(s32 operation, struct menuitem *it }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = 3; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) lang_get(options[data->dropdown.value]); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_screen_size(data->dropdown.value); g_Vars.modifiedfiles |= MODFILE_GAME; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = options_get_effective_screen_size(); } @@ -254,16 +254,16 @@ MenuItemHandlerResult menuhandler_screen_ratio(s32 operation, struct menuitem *i }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = 2; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) lang_get(options[data->dropdown.value]); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_screen_ratio(data->dropdown.value); g_Vars.modifiedfiles |= MODFILE_GAME; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = options_get_screen_ratio(); } @@ -282,17 +282,17 @@ MenuItemHandlerResult menuhandler_language(s32 operation, struct menuitem *item, }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = 5; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32)lang_get(labels[data->dropdown.value]); - case MENUOP_SET: + case MENUOP_CONFIRM: g_Vars.language = data->dropdown.value; lang_set_european(g_Vars.language); g_Vars.modifiedfiles |= MODFILE_GAME | MODFILE_BOSS; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = g_Vars.language; if (data->dropdown.value > LANGUAGE_PAL_ES) { @@ -313,12 +313,12 @@ MenuItemHandlerResult menuhandler_screen_split(s32 operation, struct menuitem *i }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = 2; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) lang_get(options[data->dropdown.value]); - case MENUOP_SET: + case MENUOP_CONFIRM: if (data->dropdown.value != (u32)options_get_screen_split()) { options_set_screen_split(data->dropdown.value); @@ -334,7 +334,7 @@ MenuItemHandlerResult menuhandler_screen_split(s32 operation, struct menuitem *i } } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = options_get_screen_split(); break; } @@ -353,9 +353,9 @@ MenuItemHandlerResult menuhandler_look_ahead(s32 operation, struct menuitem *ite } switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_look_ahead(mpchrnum); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_look_ahead(mpchrnum, data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -374,9 +374,9 @@ MenuItemHandlerResult menuhandler_head_roll(s32 operation, struct menuitem *item } switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_head_roll(mpchrnum); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_head_roll(mpchrnum, data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -387,9 +387,9 @@ MenuItemHandlerResult menuhandler_head_roll(s32 operation, struct menuitem *item MenuItemHandlerResult menuhandler_in_game_subtitles(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_in_game_subtitles(); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_in_game_subtitles(data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -400,9 +400,9 @@ MenuItemHandlerResult menuhandler_in_game_subtitles(s32 operation, struct menuit MenuItemHandlerResult menuhandler_cutscene_subtitles(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_cutscene_subtitles(); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_cutscene_subtitles(data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -413,14 +413,14 @@ MenuItemHandlerResult menuhandler_cutscene_subtitles(s32 operation, struct menui MenuItemHandlerResult menuhandler_alternative_title(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_HIDDEN: if (g_Vars.stagenum != STAGE_CITRAINING || (u8)g_AltTitleUnlocked == false) { return true; } break; - case MENUOP_GET: + case MENUOP_IS_CHECKED: return g_AltTitleEnabled; - case MENUOP_SET: + case MENUOP_CONFIRM: g_AltTitleEnabled = data->checkbox.value; g_Vars.modifiedfiles |= MODFILE_BOSS; } @@ -431,7 +431,7 @@ MenuItemHandlerResult menuhandler_alternative_title(s32 operation, struct menuit MenuItemHandlerResult menuhandler_hi_res(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_HIDDEN: if (IS4MB()) { return true; } @@ -441,9 +441,9 @@ MenuItemHandlerResult menuhandler_hi_res(s32 operation, struct menuitem *item, u } } break; - case MENUOP_GET: + case MENUOP_IS_CHECKED: return g_HiResEnabled == true; - case MENUOP_SET: + case MENUOP_CONFIRM: player_set_hi_res_enabled(data->checkbox.value ? 1 : 0); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -462,9 +462,9 @@ MenuItemHandlerResult menuhandler_ammo_on_screen(s32 operation, struct menuitem } switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_ammo_on_screen(mpchrnum); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_ammo_on_screen(mpchrnum, data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -483,14 +483,14 @@ MenuItemHandlerResult menuhandler_show_gun_function(s32 operation, struct menuit } switch (operation) { - case MENUOP_CHECKDISABLED: + case MENUOP_IS_DISABLED: if (options_get_ammo_on_screen(mpchrnum) == 0) { return true; } break; - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_show_gun_function(mpchrnum); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_show_gun_function(mpchrnum, data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -509,9 +509,9 @@ MenuItemHandlerResult menuhandler_show_mission_time(s32 operation, struct menuit } switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_show_mission_time(mpchrnum); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_show_mission_time(mpchrnum, data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -530,14 +530,14 @@ MenuItemHandlerResult menuhandler_always_show_target(s32 operation, struct menui } switch (operation) { - case MENUOP_CHECKDISABLED: + case MENUOP_IS_DISABLED: if (options_get_sight_on_screen(mpchrnum) == 0) { return true; } break; - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_always_show_target(mpchrnum); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_always_show_target(mpchrnum, data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -556,14 +556,14 @@ MenuItemHandlerResult menuhandler_show_zoom_range(s32 operation, struct menuitem } switch (operation) { - case MENUOP_CHECKDISABLED: + case MENUOP_IS_DISABLED: if (options_get_sight_on_screen(mpchrnum) == 0) { return true; } break; - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_show_zoom_range(mpchrnum); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_show_zoom_range(mpchrnum, data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -582,9 +582,9 @@ MenuItemHandlerResult menuhandler_paintball(s32 operation, struct menuitem *item } switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_paintball(mpchrnum); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_paintball(mpchrnum, data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -603,9 +603,9 @@ MenuItemHandlerResult menuhandler_sight_on_screen(s32 operation, struct menuitem } switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_sight_on_screen(mpchrnum); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_sight_on_screen(mpchrnum, data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -624,9 +624,9 @@ MenuItemHandlerResult menuhandler_autoaim(s32 operation, struct menuitem *item, } switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return options_get_autoaim(mpchrnum); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_autoaim(mpchrnum, data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -637,10 +637,10 @@ MenuItemHandlerResult menuhandler_autoaim(s32 operation, struct menuitem *item, MenuItemHandlerResult menuhandler_music_volume(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETSLIDER: + case MENUOP_GET_SLIDER_VALUE: data->slider.value = options_get_music_volume(); break; - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_music_volume(data->slider.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -651,10 +651,10 @@ MenuItemHandlerResult menuhandler_music_volume(s32 operation, struct menuitem *i MenuItemHandlerResult menuhandler_sfx_volume(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETSLIDER: + case MENUOP_GET_SLIDER_VALUE: data->slider.value = VOLUME(g_SfxVolume); break; - case MENUOP_SET: + case MENUOP_CONFIRM: snd_set_sfx_volume(data->slider.value); g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -664,13 +664,13 @@ MenuItemHandlerResult menuhandler_sfx_volume(s32 operation, struct menuitem *ite MenuDialogHandlerResult menudialog_briefing(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_TICK) { if (g_Menus[g_MpPlayerNum].curdialog && g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef) { struct menuinputs *inputs = data->dialog2.inputs; if (inputs->start) { - menuhandler_accept_mission(MENUOP_SET, NULL, data); + menuhandler_accept_mission(MENUOP_CONFIRM, NULL, data); } inputs->start = false; @@ -703,7 +703,7 @@ struct menudialogdef g_PreAndPostMissionBriefingMenuDialog = { MenuItemHandlerResult menuhandler_accept_mission(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_stop(); if (g_Vars.stagenum == g_MissionConfig.stagenum) { @@ -773,14 +773,14 @@ char *solo_menu_title_stage_overview(struct menudialogdef *dialogdef) MenuDialogHandlerResult menudialog_accept_mission(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: g_Menus[g_MpPlayerNum].menumodel.curparams = 0; setup_load_briefing(g_MissionConfig.stagenum, g_Menus[g_MpPlayerNum].menumodel.allocstart, g_Menus[g_MpPlayerNum].menumodel.alloclen, &g_Briefing); break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: lang_clear_bank(g_Briefing.langbank); break; } @@ -848,13 +848,13 @@ MenuItemHandlerResult menuhandler_pd_mode_setting(s32 operation, struct menuitem } switch (operation) { - case MENUOP_GETSLIDER: + case MENUOP_GET_SLIDER_VALUE: data->slider.value = *property; break; - case MENUOP_SET: + case MENUOP_CONFIRM: *property = (u16)data->slider.value; break; - case MENUOP_GETSLIDERLABEL: + case MENUOP_GET_SLIDER_LABEL: fvalue = mainmenu_pdmode_handicap_to_value(*property, item->param); if (item->param == 0) { fvalue = fvalue * 4 + 1.0f; @@ -868,7 +868,7 @@ MenuItemHandlerResult menuhandler_pd_mode_setting(s32 operation, struct menuitem MenuItemHandlerResult menuhandler_accept_pd_mode_settings(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_MissionConfig.pdmode = true; g_MissionConfig.pdmodehealthf = mainmenu_pdmode_handicap_to_value(g_MissionConfig.pdmodehealth, PDMODEPROP_HEALTH); g_MissionConfig.pdmodedamagef = mainmenu_pdmode_handicap_to_value(g_MissionConfig.pdmodedamage, PDMODEPROP_DAMAGE); @@ -1102,7 +1102,7 @@ bool is_stage_difficulty_unlocked(s32 stageindex, s32 difficulty) MenuItemHandlerResult menuhandler_solo_difficulty(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_CHECKPREFOCUSED: + case MENUOP_IS_PREFOCUSED: #if VERSION >= VERSION_NTSC_1_0 if (is_stage_difficulty_unlocked(g_MissionConfig.stageindex, item->param)) { if (item->param3 == 0) { @@ -1121,14 +1121,14 @@ MenuItemHandlerResult menuhandler_solo_difficulty(s32 operation, struct menuitem } #endif break; - case MENUOP_SET: + case MENUOP_CONFIRM: g_MissionConfig.pdmode = false; g_MissionConfig.difficulty = item->param; lv_set_difficulty(g_MissionConfig.difficulty); menu_pop_dialog(); menu_push_dialog(&g_AcceptMissionMenuDialog); break; - case MENUOP_CHECKDISABLED: + case MENUOP_IS_DISABLED: if (!is_stage_difficulty_unlocked(g_MissionConfig.stageindex, item->param)) { return true; } @@ -1140,10 +1140,10 @@ MenuItemHandlerResult menuhandler_solo_difficulty(s32 operation, struct menuitem MenuItemHandlerResult menuhandler_pd_mode(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_SET: + case MENUOP_CONFIRM: menu_push_dialog(&g_PdModeSettingsMenuDialog); break; - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_HIDDEN: if (g_GameFile.besttimes[SOLOSTAGEINDEX_SKEDARRUINS][DIFF_PA] == 0) { return true; } @@ -1247,12 +1247,12 @@ struct menudialogdef g_SoloMissionDifficultyMenuDialog = { MenuItemHandlerResult menuhandler_buddy_options_continue(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_pop_dialog(); menu_push_dialog(&g_AcceptMissionMenuDialog); } - if (operation == MENUOP_CHECKPREFOCUSED) { + if (operation == MENUOP_IS_PREFOCUSED) { return true; } @@ -1298,7 +1298,7 @@ s32 get_max_ai_buddies(void) MenuDialogHandlerResult menudialog_coop_anti_options(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { #if VERSION >= VERSION_NTSC_1_0 - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { s32 max = get_max_ai_buddies(); if (g_Vars.numaibuddies > max) { @@ -1307,12 +1307,12 @@ MenuDialogHandlerResult menudialog_coop_anti_options(s32 operation, struct menud } #endif - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_TICK) { if (g_Menus[g_MpPlayerNum].curdialog && g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef) { struct menuinputs *inputs = data->dialog2.inputs; if (inputs->start) { - menuhandler_buddy_options_continue(MENUOP_SET, NULL, NULL); + menuhandler_buddy_options_continue(MENUOP_CONFIRM, NULL, NULL); } inputs->start = false; @@ -1325,9 +1325,9 @@ MenuDialogHandlerResult menudialog_coop_anti_options(s32 operation, struct menud MenuItemHandlerResult menuhandler_coop_radar(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return g_Vars.coopradaron; - case MENUOP_SET: + case MENUOP_CONFIRM: g_Vars.coopradaron = data->checkbox.value ? true : false; g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -1338,9 +1338,9 @@ MenuItemHandlerResult menuhandler_coop_radar(s32 operation, struct menuitem *ite MenuItemHandlerResult menuhandler_coop_friendly_fire(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return g_Vars.coopfriendlyfire; - case MENUOP_SET: + case MENUOP_CONFIRM: g_Vars.coopfriendlyfire = data->checkbox.value ? true : false; g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -1359,7 +1359,7 @@ MenuItemHandlerResult menuhandler_coop_buddy(s32 operation, struct menuitem *ite }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: #if VERSION >= VERSION_NTSC_1_0 { s32 maxaibuddies = get_max_ai_buddies(); @@ -1408,7 +1408,7 @@ MenuItemHandlerResult menuhandler_coop_buddy(s32 operation, struct menuitem *ite } #endif break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: { s32 extra = 1; @@ -1418,7 +1418,7 @@ MenuItemHandlerResult menuhandler_coop_buddy(s32 operation, struct menuitem *ite return (s32)lang_get(labels[data->dropdown.value + extra]); } - case MENUOP_SET: + case MENUOP_CONFIRM: { s32 extra = 1; @@ -1430,7 +1430,7 @@ MenuItemHandlerResult menuhandler_coop_buddy(s32 operation, struct menuitem *ite g_Vars.modifiedfiles |= MODFILE_GAME; } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: { s32 extra = 1; @@ -1514,9 +1514,9 @@ struct menudialogdef g_CoopOptionsMenuDialog = { MenuItemHandlerResult menuhandler_anti_radar(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return g_Vars.antiradaron; - case MENUOP_SET: + case MENUOP_CONFIRM: g_Vars.antiradaron = data->checkbox.value ? 1 : 0; g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -1529,16 +1529,16 @@ MenuItemHandlerResult menuhandler_anti_player(s32 operation, struct menuitem *it const u16 labels[] = {L_OPTIONS_271, L_OPTIONS_272}; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = 2; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) lang_get(labels[data->dropdown.value]); - case MENUOP_SET: + case MENUOP_CONFIRM: g_Vars.pendingantiplayernum = data->dropdown.value; g_Vars.modifiedfiles |= MODFILE_GAME; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = g_Vars.pendingantiplayernum; break; } @@ -1602,14 +1602,14 @@ struct menudialogdef g_AntiOptionsMenuDialog = { MenuItemHandlerResult menuhandler_coop_difficulty(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_SET: + case MENUOP_CONFIRM: g_MissionConfig.pdmode = false; g_MissionConfig.difficulty = item->param; lv_set_difficulty(g_MissionConfig.difficulty); menu_pop_dialog(); menu_push_dialog(&g_CoopOptionsMenuDialog); break; - case MENUOP_CHECKDISABLED: + case MENUOP_IS_DISABLED: if (!is_stage_difficulty_unlocked(g_MissionConfig.stageindex, item->param)) { return true; } @@ -1674,7 +1674,7 @@ struct menudialogdef g_CoopMissionDifficultyMenuDialog = { MenuItemHandlerResult menuhandler_anti_difficulty(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_SET: + case MENUOP_CONFIRM: g_MissionConfig.pdmode = false; g_MissionConfig.difficulty = item->param; lv_set_difficulty(g_MissionConfig.difficulty); @@ -1834,8 +1834,8 @@ MenuItemHandlerResult menuhandler_mission_list(s32 operation, struct menuitem *i u32 stageindex2; union handlerdata sp178; union handlerdata sp168; - s32 sp164; - s32 sp160; + s32 numspecial; + s32 specialindex; union handlerdata sp150; s32 k; union handlerdata sp13c; @@ -1850,7 +1850,7 @@ MenuItemHandlerResult menuhandler_mission_list(s32 operation, struct menuitem *i union handlerdata spdc; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = 0; for (i = 0; i <= SOLOSTAGEINDEX_SKEDARRUINS; i++) { @@ -1876,9 +1876,9 @@ MenuItemHandlerResult menuhandler_mission_list(s32 operation, struct menuitem *i data->list.value += get_num_unlocked_special_stages(); break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: if (data->list.unk04u32 == 0) { - menuhandler_mission_list(MENUOP_GETOPTIONCOUNT, item, &sp18c); + menuhandler_mission_list(MENUOP_GET_OPTION_COUNT, item, &sp18c); data->list.unk04u32 = sp18c.list.value - get_num_unlocked_special_stages(); } @@ -1890,9 +1890,9 @@ MenuItemHandlerResult menuhandler_mission_list(s32 operation, struct menuitem *i // Special stages have no dash and suffix, so just return the name return (intptr_t) lang_get(g_SoloStages[mainmenu_specialindex_to_stageindex(data->list.value - data->list.unk04u32)].name1); - case MENUOP_SET: + case MENUOP_CONFIRM: stageindex2 = data->list.value; - menuhandler_mission_list(MENUOP_GETOPTIONCOUNT, item, &sp178); + menuhandler_mission_list(MENUOP_GET_OPTION_COUNT, item, &sp178); sp178.list.value -= get_num_unlocked_special_stages(); if (data->list.value >= sp178.list.value) { @@ -1913,31 +1913,31 @@ MenuItemHandlerResult menuhandler_mission_list(s32 operation, struct menuitem *i } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = 0xfffff; break; - case MENUOP_25: + case MENUOP_GET_OPTION_INDEX2: if (data->list.unk04 == 0 && !g_MissionConfig.iscoop && !g_MissionConfig.isanti) { data->list.value = g_GameFile.autostageindex; - menuhandler_mission_list(MENUOP_GETOPTIONCOUNT, item, &sp168); + menuhandler_mission_list(MENUOP_GET_OPTION_COUNT, item, &sp168); sp168.list.value -= get_num_unlocked_special_stages(); if (data->list.value >= sp168.list.value) { - sp164 = get_num_unlocked_special_stages(); + numspecial = get_num_unlocked_special_stages(); data->list.value = sp168.list.value - 1; - for (sp160 = 0; sp160 < sp164; sp160++) { - if (mainmenu_specialindex_to_stageindex(sp160) == g_GameFile.autostageindex) { - data->list.value = sp168.list.values32 + sp160; + for (specialindex = 0; specialindex < numspecial; specialindex++) { + if (mainmenu_specialindex_to_stageindex(specialindex) == g_GameFile.autostageindex) { + data->list.value = sp168.list.values32 + specialindex; } } } } break; - case MENUOP_GETOPTGROUPCOUNT: - menuhandler_mission_list(MENUOP_GETOPTIONCOUNT, item, &sp150); + case MENUOP_GET_OPTGROUP_COUNT: + menuhandler_mission_list(MENUOP_GET_OPTION_COUNT, item, &sp150); sp150.list.value -= get_num_unlocked_special_stages(); data->list.unk0c = 0; @@ -1950,14 +1950,14 @@ MenuItemHandlerResult menuhandler_mission_list(s32 operation, struct menuitem *i data->list.value = data->list.unk0c + 1; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: if (data->list.unk0c == data->list.value) { return (s32) lang_get(groups[9].name); // "Special Assignments" } return (s32) lang_get(groups[data->list.value].name); - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: if (data->list.unk0c == data->list.value) { - menuhandler_mission_list(MENUOP_GETOPTIONCOUNT, item, &sp13c); + menuhandler_mission_list(MENUOP_GET_OPTION_COUNT, item, &sp13c); data->list.groupstartindex = sp13c.list.value - get_num_unlocked_special_stages(); } else { data->list.groupstartindex = groups[data->list.value].offset; @@ -1970,7 +1970,7 @@ MenuItemHandlerResult menuhandler_mission_list(s32 operation, struct menuitem *i stageindex = data->type19.unk04u32; if (data->type19.unk0c == 0) { - menuhandler_mission_list(MENUOP_GETOPTIONCOUNT, item, &spdc); + menuhandler_mission_list(MENUOP_GET_OPTION_COUNT, item, &spdc); data->type19.unk0c = spdc.list.value - get_num_unlocked_special_stages(); } @@ -2099,7 +2099,7 @@ MenuItemHandlerResult menuhandler_mission_list(s32 operation, struct menuitem *i gdl = text_end(gdl); return (s32) gdl; - case MENUOP_GETOPTIONHEIGHT: + case MENUOP_GET_OPTION_HEIGHT: data->list.value = 42; break; } @@ -2110,9 +2110,9 @@ MenuItemHandlerResult menuhandler_mission_list(s32 operation, struct menuitem *i MenuDialogHandlerResult menudialog_mainmenu_options(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: if ((g_Vars.modifiedfiles & MODFILE_GAME) && g_Vars.coopplayernum < 0 && g_Vars.antiplayernum < 0) { if (filemgr_save_or_load(&g_GameFileGuid, FILEOP_SAVE_GAME_001, 0) == 0) { data->dialog1.preventclose = true; @@ -2186,26 +2186,26 @@ char *menutext_control_style_p1(struct menuitem *item) { union handlerdata data; - menuhandler_control_style_p1(MENUOP_GETSELECTEDINDEX, item, &data); + menuhandler_control_style_p1(MENUOP_GET_SELECTED_INDEX, item, &data); - return (char *)menuhandler_control_style_p1(MENUOP_GETOPTIONTEXT, item, &data); + return (char *)menuhandler_control_style_p1(MENUOP_GET_OPTION_TEXT, item, &data); } char *menutext_control_style_p2(struct menuitem *item) { union handlerdata data; - menuhandler_control_style_p2(MENUOP_GETSELECTEDINDEX, item, &data); + menuhandler_control_style_p2(MENUOP_GET_SELECTED_INDEX, item, &data); - return (char *)menuhandler_control_style_p2(MENUOP_GETOPTIONTEXT, item, &data); + return (char *)menuhandler_control_style_p2(MENUOP_GET_OPTION_TEXT, item, &data); } MenuItemHandlerResult menuhandler_lang_filter(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return g_Vars.langfilteron; - case MENUOP_SET: + case MENUOP_CONFIRM: g_Vars.langfilteron = data->checkbox.value; g_Vars.modifiedfiles |= MODFILE_GAME; } @@ -2215,7 +2215,7 @@ MenuItemHandlerResult menuhandler_lang_filter(s32 operation, struct menuitem *it MenuItemHandlerResult menuhandler_control_style(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { if (PLAYERCOUNT() >= 2) { menu_push_dialog(&g_2PMissionControlStyleMenuDialog); } else { @@ -2234,7 +2234,7 @@ MenuItemHandlerResult menuhandler_control_style(s32 operation, struct menuitem * */ MenuItemHandlerResult menuhandler_save_game(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { filemgr_save_or_load(&g_GameFileGuid, FILEOP_SAVE_GAME_002, 0); } @@ -2243,7 +2243,7 @@ MenuItemHandlerResult menuhandler_save_game(s32 operation, struct menuitem *item MenuItemHandlerResult menuhandler_change_agent(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_save_and_push_root_dialog(NULL, MENUROOT_CHANGE_AGENT); } @@ -2267,7 +2267,7 @@ struct menudialogdef g_2PMissionControlStyleMenuDialog = { L_OPTIONS_236, // "Control" g_2PMissionControlStyleMenuItems, NULL, - MENUDIALOGFLAG_0400, + MENUDIALOGFLAG_NOVERTICALBORDERS, NULL, }; @@ -2302,7 +2302,7 @@ struct menudialogdef g_SoloMissionControlStyleMenuDialog = { L_OPTIONS_236, // "Control" g_SoloMissionControlStyleMenuItems, NULL, - MENUDIALOGFLAG_0400, + MENUDIALOGFLAG_NOVERTICALBORDERS, NULL, }; @@ -2337,7 +2337,7 @@ struct menudialogdef g_CiControlStyleMenuDialog = { L_OPTIONS_236, // "Control" g_CiControlStyleMenuItems, NULL, - MENUDIALOGFLAG_0400, + MENUDIALOGFLAG_NOVERTICALBORDERS, NULL, }; @@ -2372,7 +2372,7 @@ struct menudialogdef g_CiControlStylePlayer2MenuDialog = { L_OPTIONS_236, // "Control" g_CiControlStylePlayer2MenuItems, NULL, - MENUDIALOGFLAG_0400, + MENUDIALOGFLAG_NOVERTICALBORDERS, NULL, }; @@ -3842,7 +3842,7 @@ void mainmenu_prepare_weapon_menumodel(s32 weaponnum) MenuDialogHandlerResult inventory_menu_dialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_TICK) { if (g_Menus[g_MpPlayerNum].curdialog && g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef) { g_Menus[g_MpPlayerNum].menumodel.zoomtimer60 -= g_Vars.diffframe60; g_Menus[g_MpPlayerNum].menumodel.newroty = 18.849555969238f * g_20SecIntervalFrac; @@ -4116,9 +4116,9 @@ struct menudialogdef g_SoloMissionInventoryMenuDialog = { g_SoloMissionInventoryMenuItems, inventory_menu_dialog, #if VERSION >= VERSION_JPN_FINAL - MENUDIALOGFLAG_0002 | MENUDIALOGFLAG_DISABLERESIZE | MENUDIALOGFLAG_0400 | MENUDIALOGFLAG_1000, + MENUDIALOGFLAG_ALLOW_MODELS | MENUDIALOGFLAG_DISABLERESIZE | MENUDIALOGFLAG_NOVERTICALBORDERS | MENUDIALOGFLAG_LESSHEIGHT, #else - MENUDIALOGFLAG_0002 | MENUDIALOGFLAG_DISABLERESIZE | MENUDIALOGFLAG_0400, + MENUDIALOGFLAG_ALLOW_MODELS | MENUDIALOGFLAG_DISABLERESIZE | MENUDIALOGFLAG_NOVERTICALBORDERS, #endif &g_SoloMissionOptionsMenuDialog, }; @@ -4128,7 +4128,7 @@ struct menudialogdef g_FrWeaponsAvailableMenuDialog = { L_OPTIONS_179, // "Weapons Available" g_FrWeaponsAvailableMenuItems, inventory_menu_dialog, - MENUDIALOGFLAG_0002 | MENUDIALOGFLAG_DISABLERESIZE | MENUDIALOGFLAG_0400, + MENUDIALOGFLAG_ALLOW_MODELS | MENUDIALOGFLAG_DISABLERESIZE | MENUDIALOGFLAG_NOVERTICALBORDERS, NULL, }; @@ -4137,27 +4137,27 @@ MenuItemHandlerResult menuhandler_fr_inventory_list(s32 operation, struct menuit static u8 g_FrFocusedSlotIndex = 0; switch (operation) { - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 0; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return 0; - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: data->list.groupstartindex = 0; break; - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = fr_get_num_weapons_available(); break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: g_FrFocusedSlotIndex = data->list.value; return (s32)bgun_get_name(fr_get_weapon_by_slot(data->list.value)); - case MENUOP_SET: + case MENUOP_CONFIRM: g_FrFocusedSlotIndex = data->list.value; return 0; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = g_FrFocusedSlotIndex; break; - case MENUOP_LISTITEMFOCUS: + case MENUOP_ON_OPTION_FOCUS: g_InventoryWeapon = fr_get_weapon_by_slot(data->list.value); g_Menus[g_MpPlayerNum].training.weaponnum = g_InventoryWeapon; g_FrFocusedSlotIndex = data->list.value; @@ -4176,12 +4176,12 @@ MenuItemHandlerResult menuhandler_fr_inventory_list(s32 operation, struct menuit MenuItemHandlerResult menuhandler_inventory_list(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = inv_get_count(); break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32)inv_get_name_by_index(data->list.value); - case MENUOP_SET: + case MENUOP_CONFIRM: { s32 weaponnum = inv_get_weapon_num_by_index(data->list.value); bool equippable = true; @@ -4217,10 +4217,10 @@ MenuItemHandlerResult menuhandler_inventory_list(s32 operation, struct menuitem var800711f0 = data->list.value; } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = inv_get_current_index(); break; - case MENUOP_GETLISTITEMCHECKBOX: + case MENUOP_IS_OPTION_CHECKED: { s32 weaponnum = inv_get_weapon_num_by_index(data->list.value); @@ -4233,7 +4233,7 @@ MenuItemHandlerResult menuhandler_inventory_list(s32 operation, struct menuitem } } break; - case MENUOP_LISTITEMFOCUS: + case MENUOP_ON_OPTION_FOCUS: g_InventoryWeapon = inv_get_weapon_num_by_index(data->list.value); g_Menus[g_MpPlayerNum].training.weaponnum = g_InventoryWeapon; @@ -4249,7 +4249,7 @@ MenuItemHandlerResult menuhandler_inventory_list(s32 operation, struct menuitem MenuItemHandlerResult menuhandler_abort_mission(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_Vars.currentplayer->aborted = true; main_end_stage(); } @@ -4259,7 +4259,7 @@ MenuItemHandlerResult menuhandler_abort_mission(s32 operation, struct menuitem * MenuDialogHandlerResult menudialog_abort_mission(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_TICK) { // empty } @@ -4342,7 +4342,7 @@ struct menudialogdef g_2PMissionAbortVMenuDialog = { MenuDialogHandlerResult solo_menu_dialog_pause_status(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { struct briefingobj *briefing = g_BriefingObjs; struct objective *objective; s32 wanttype = BRIEFINGTYPE_TEXT_PA; @@ -4605,17 +4605,17 @@ MenuItemHandlerResult menuhandler_cinema(s32 operation, struct menuitem *item, u }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: // Add one for Play All option data->list.value = g_CutsceneCountsByMission[get_num_completed_missions()] + 1; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: if (data->list.value == 0) { sprintf(g_StringPointer, lang_get(L_OPTIONS_448)); // "Play All" return (s32) g_StringPointer; } return (s32) lang_get(g_Cutscenes[data->list.value - 1].name); - case MENUOP_SET: + case MENUOP_CONFIRM: if (data->list.value == 0) { // Play all s32 index = get_num_completed_missions(); @@ -4631,15 +4631,15 @@ MenuItemHandlerResult menuhandler_cinema(s32 operation, struct menuitem *item, u menu_stop(); } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = 0xfffff; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = ARRAYCOUNT(groups); break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return (s32) lang_get(groups[data->list.value].name); - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: data->list.groupstartindex = groups[data->list.value].first_cutscene_index; break; } @@ -4691,13 +4691,13 @@ struct menudialogdef g_SelectMissionMenuDialog = { MenuItemHandlerResult menuhandler_main_menu_solo_missions(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_MissionConfig.iscoop = false; g_MissionConfig.isanti = false; menu_push_dialog(&g_SelectMissionMenuDialog); } - if (operation == MENUOP_CHECKPREFOCUSED) { + if (operation == MENUOP_IS_PREFOCUSED) { if (is_stage_difficulty_unlocked(SOLOSTAGEINDEX_INVESTIGATION, DIFF_A)) { return true; } @@ -4708,7 +4708,7 @@ MenuItemHandlerResult menuhandler_main_menu_solo_missions(s32 operation, struct MenuItemHandlerResult menuhandler_main_menu_combat_simulator(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_Vars.bondplayernum = 0; g_Vars.coopplayernum = -1; g_Vars.antiplayernum = -1; @@ -4723,7 +4723,7 @@ MenuItemHandlerResult menuhandler_main_menu_combat_simulator(s32 operation, stru MenuItemHandlerResult menuhandler_main_menu_cooperative(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_MissionConfig.iscoop = true; g_MissionConfig.isanti = false; menu_push_dialog(&g_SelectMissionMenuDialog); @@ -4734,13 +4734,13 @@ MenuItemHandlerResult menuhandler_main_menu_cooperative(s32 operation, struct me MenuItemHandlerResult menuhandler_main_menu_counter_operative(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKDISABLED) { + if (operation == MENUOP_IS_DISABLED) { if ((joy_get_connected_controllers() & 2) == 0) { return true; } } - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_MissionConfig.iscoop = false; g_MissionConfig.isanti = true; menu_push_dialog(&g_SelectMissionMenuDialog); @@ -4752,10 +4752,10 @@ MenuItemHandlerResult menuhandler_main_menu_counter_operative(s32 operation, str MenuDialogHandlerResult menudialog_main_menu(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: g_Menus[g_MpPlayerNum].main.unke2c = 0; break; - case MENUOP_TICK: + case MENUOP_ON_TICK: if (g_Menus[g_MpPlayerNum].curdialog && g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef) { g_MissionConfig.iscoop = false; diff --git a/src/game/menu.c b/src/game/menu.c index 3a7c657d0..e97ed430a 100644 --- a/src/game/menu.c +++ b/src/game/menu.c @@ -545,9 +545,9 @@ void menu_calculate_item_size(struct menuitem *item, s16 *width, s16 *height, st char *text2; s32 numobjectives; - // Check if item's handler handles MENUOP_CHECKHIDDEN + // Check if item's handler handles MENUOP_IS_HIDDEN if (item->handler && (item->flags & MENUITEMFLAG_SELECTABLE_OPENSDIALOG) == 0) { - if (item->handler(MENUOP_CHECKHIDDEN, item, &handlerdata)) { + if (item->handler(MENUOP_IS_HIDDEN, item, &handlerdata)) { *width = 0; *height = 0; return; @@ -625,9 +625,9 @@ void menu_calculate_item_size(struct menuitem *item, s16 *width, s16 *height, st if (item->handler) { handlerdata2.dropdown.value = 0; - item->handler(MENUOP_GETSELECTEDINDEX, item, &handlerdata2); + item->handler(MENUOP_GET_SELECTED_INDEX, item, &handlerdata2); handlerdata2.dropdown.unk04 = 0; - text2 = (char *)item->handler(MENUOP_GETOPTIONTEXT, item, &handlerdata2); + text2 = (char *)item->handler(MENUOP_GET_OPTION_TEXT, item, &handlerdata2); text_measure(&textheight, &textwidth, text2, g_CharsHandelGothicSm, g_FontHandelGothicSm, 0); #if VERSION >= VERSION_PAL_FINAL @@ -1029,7 +1029,7 @@ void dialog_calculate_content_size(struct menudialogdef *dialogdef, struct menud #if VERSION == VERSION_JPN_FINAL contentheight += 15; - if ((dialog->definition->flags & MENUDIALOGFLAG_1000) == 0) { + if ((dialog->definition->flags & MENUDIALOGFLAG_LESSHEIGHT) == 0) { contentheight += 2; } #else @@ -1128,7 +1128,7 @@ bool menu_is_item_disabled(struct menuitem *item, struct menudialog *dialog) if (item->handler && (item->flags & MENUITEMFLAG_SELECTABLE_OPENSDIALOG) == 0 - && item->handler(MENUOP_CHECKDISABLED, item, &sp30)) { + && item->handler(MENUOP_IS_DISABLED, item, &sp30)) { return true; } @@ -1342,7 +1342,7 @@ s32 dialog_change_item_focus(struct menudialog *dialog, s32 leftright, s32 updow if (dialog->focuseditem->handler != NULL) { if ((dialog->focuseditem->flags & MENUITEMFLAG_SELECTABLE_OPENSDIALOG) == 0) { union handlerdata data; - dialog->focuseditem->handler(MENUOP_FOCUS, dialog->focuseditem, &data); + dialog->focuseditem->handler(MENUOP_ON_FOCUS, dialog->focuseditem, &data); } } } @@ -1394,7 +1394,7 @@ void menu_open_dialog(struct menudialogdef *dialogdef, struct menudialog *dialog while (item->type != MENUITEMTYPE_END) { if (item->handler && (item->flags & MENUITEMFLAG_SELECTABLE_OPENSDIALOG) == 0 - && item->handler(MENUOP_CHECKPREFOCUSED, item, &data1)) { + && item->handler(MENUOP_IS_PREFOCUSED, item, &data1)) { dialog->focuseditem = item; } @@ -1405,7 +1405,7 @@ void menu_open_dialog(struct menudialogdef *dialogdef, struct menudialog *dialog if (dialog->focuseditem && dialog->focuseditem->handler && (dialog->focuseditem->flags & MENUITEMFLAG_SELECTABLE_OPENSDIALOG) == 0) { - dialog->focuseditem->handler(MENUOP_FOCUS, dialog->focuseditem, &data2); + dialog->focuseditem->handler(MENUOP_ON_FOCUS, dialog->focuseditem, &data2); } dialog->dimmed = false; @@ -1413,7 +1413,7 @@ void menu_open_dialog(struct menudialogdef *dialogdef, struct menudialog *dialog dialog->dstscroll = 0; if (dialogdef->handler) { - dialogdef->handler(MENUOP_OPEN, dialogdef, &data3); + dialogdef->handler(MENUOP_ON_OPEN, dialogdef, &data3); } dialog_calculate_content_size(dialogdef, dialog, menu); @@ -1580,7 +1580,7 @@ void menu_close_dialog(void) data.dialog1.preventclose = false; if (layer->siblings[i]->definition->handler) { - layer->siblings[i]->definition->handler(MENUOP_CLOSE, layer->siblings[i]->definition, &data); + layer->siblings[i]->definition->handler(MENUOP_ON_CLOSE, layer->siblings[i]->definition, &data); } if (value_prevent == data.dialog1.preventclose) { @@ -2492,7 +2492,7 @@ Gfx *dialog_render(Gfx *gdl, struct menudialog *dialog, struct menu *menu, bool g_TextHoloRayEnabled = false; if (g_Menus[g_MpPlayerNum].curdialog == dialog - && (dialog->definition->flags & MENUDIALOGFLAG_0002) + && (dialog->definition->flags & MENUDIALOGFLAG_ALLOW_MODELS) && !lightweight && g_Menus[g_MpPlayerNum].menumodel.drawbehinddialog == true) { gSPSetGeometryMode(gdl++, G_ZBUFFER); @@ -2730,9 +2730,9 @@ Gfx *dialog_render(Gfx *gdl, struct menudialog *dialog, struct menu *menu, bool // Render models (inventory, chr/vehicle bios) if (g_Menus[g_MpPlayerNum].curdialog == dialog - && (dialog->definition->flags & MENUDIALOGFLAG_0002) + && (dialog->definition->flags & MENUDIALOGFLAG_ALLOW_MODELS) && !lightweight - && !g_Menus[g_MpPlayerNum].menumodel.drawbehinddialog) { + && g_Menus[g_MpPlayerNum].menumodel.drawbehinddialog == false) { gSPSetGeometryMode(gdl++, G_ZBUFFER); gdl = menu_render_model(gdl, &g_Menus[g_MpPlayerNum].menumodel, MENUMODELTYPE_DEFAULT); @@ -2770,7 +2770,7 @@ Gfx *dialog_render(Gfx *gdl, struct menudialog *dialog, struct menu *menu, bool colindex = dialog->colstart + i; - if (i != 0 && (dialog->definition->flags & MENUDIALOGFLAG_0400) == 0) { + if (i != 0 && (dialog->definition->flags & MENUDIALOGFLAG_NOVERTICALBORDERS) == 0) { gdl = menugfx_draw_filled_rect(gdl, curx - 1, dialogtop + LINEHEIGHT + 1, curx, dialogbottom, sp120, sp120); } @@ -3880,7 +3880,7 @@ void menu_swipe(s32 direction) while (item->type != MENUITEMTYPE_END) { if (item->handler && (item->flags & MENUITEMFLAG_SELECTABLE_OPENSDIALOG) == 0 - && item->handler(MENUOP_CHECKPREFOCUSED, item, &sp50)) { + && item->handler(MENUOP_IS_PREFOCUSED, item, &sp50)) { g_Menus[g_MpPlayerNum].curdialog->focuseditem = item; } @@ -3890,7 +3890,7 @@ void menu_swipe(s32 direction) if (g_Menus[g_MpPlayerNum].curdialog->focuseditem != 0 && g_Menus[g_MpPlayerNum].curdialog->focuseditem->handler && ((g_Menus[g_MpPlayerNum].curdialog->focuseditem->flags & MENUITEMFLAG_SELECTABLE_OPENSDIALOG) == 0)) { - g_Menus[g_MpPlayerNum].curdialog->focuseditem->handler(MENUOP_FOCUS, g_Menus[g_MpPlayerNum].curdialog->focuseditem, &sp40); + g_Menus[g_MpPlayerNum].curdialog->focuseditem->handler(MENUOP_ON_FOCUS, g_Menus[g_MpPlayerNum].curdialog->focuseditem, &sp40); } g_Menus[g_MpPlayerNum].curdialog->swipedir = direction; @@ -4278,7 +4278,7 @@ void dialog_tick(struct menudialog *dialog, struct menuinputs *inputs, u32 tickf data.dialog2.inputs = inputs; if (definition->handler != NULL) { - definition->handler(MENUOP_TICK, definition, &data); + definition->handler(MENUOP_ON_TICK, definition, &data); } if (dialog->dimmed) { @@ -4398,7 +4398,7 @@ void dialog_tick(struct menudialog *dialog, struct menuinputs *inputs, u32 tickf s32 y = dialog_find_item(dialog, dialog->focuseditem, &rowindex, &colindex); - if ((dialog->focuseditem->flags & MENUITEMFLAG_00010000) == 0) { + if ((dialog->focuseditem->flags & MENUITEMFLAG_DISABLESCROLL) == 0) { itemy = y + menu->rows[rowindex].height / 2; dstscroll = (dialog->height - LINEHEIGHT - 1) / 2 - itemy; @@ -5608,7 +5608,7 @@ MenuItemHandlerResult menuhandler_pak_acknowledge(s32 operation, struct menuitem { bool done = false; - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { // Close all pak success/error dialogs while (!done) { done = true; @@ -5637,7 +5637,7 @@ MenuItemHandlerResult menuhandler_pak_acknowledge(s32 operation, struct menuitem */ MenuDialogHandlerResult menudialog_pak(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_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) { @@ -5657,7 +5657,7 @@ MenuDialogHandlerResult menudialog_pak(s32 operation, struct menudialogdef *dial */ MenuItemHandlerResult menuhandler_pak_setdamaged(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_replace_current_dialog(&g_PakDamagedMenuDialog); } @@ -5667,7 +5667,7 @@ MenuItemHandlerResult menuhandler_pak_setdamaged(s32 operation, struct menuitem MenuItemHandlerResult menuhandler_repair_pak(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { if (pak_repair(g_Menus[g_MpPlayerNum].fm.device3)) { menu_replace_current_dialog(&g_PakRepairSuccessMenuDialog); } else { @@ -5899,7 +5899,7 @@ char *menu_text_save_device_name(struct menuitem *item) MenuItemHandlerResult menuhandler_retry_save_pak(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_pop_dialog(); #if VERSION >= VERSION_NTSC_1_0 @@ -5916,7 +5916,7 @@ MenuItemHandlerResult menuhandler_retry_save_pak(s32 operation, struct menuitem MenuItemHandlerResult menuhandler_warn_repair_pak(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { #if VERSION >= VERSION_NTSC_1_0 menu_push_dialog(&g_PakAttemptRepairMenuDialog); #else diff --git a/src/game/menuitem.c b/src/game/menuitem.c index 6c11d93eb..aaef4c643 100644 --- a/src/game/menuitem.c +++ b/src/game/menuitem.c @@ -75,7 +75,7 @@ s32 menuitem0f0e5d2c(s32 arg0, struct menuitem *item) data.list.value = 0; data.list.unk0c = 0; - item->handler(MENUOP_GETOPTGROUPCOUNT, item, &data); + item->handler(MENUOP_GET_OPTGROUP_COUNT, item, &data); if (data.list.value == 0) { s1 = arg0 / g_LineHeight; @@ -89,7 +89,7 @@ s32 menuitem0f0e5d2c(s32 arg0, struct menuitem *item) while (!done) { if (data.list.values32 < numgroups) { - item->handler(MENUOP_GETGROUPSTARTINDEX, item, &data); + item->handler(MENUOP_GET_OPTGROUP_START_INDEX, item, &data); a0 = data.list.groupstartindex; } else { a0 = 9999; @@ -131,7 +131,7 @@ s16 menuitem_list_get_offset_y(s16 optionindex, struct menuitem *item) data.list.value = 0; data.list.unk0c = 0; - item->handler(MENUOP_GETOPTGROUPCOUNT, item, &data); + item->handler(MENUOP_GET_OPTGROUP_COUNT, item, &data); if (data.list.value == 0) { return optionindex * g_LineHeight; @@ -144,7 +144,7 @@ s16 menuitem_list_get_offset_y(s16 optionindex, struct menuitem *item) data.list.unk04 = 0; for (data.list.value = 0; !done && data.list.values32 < numgroups; data.list.value++) { - item->handler(MENUOP_GETGROUPSTARTINDEX, item, &data); + item->handler(MENUOP_GET_OPTGROUP_START_INDEX, item, &data); if (optionindex >= data.list.groupstartindex) { numlines++; @@ -232,7 +232,7 @@ Gfx *menuitem_list_render(Gfx *gdl, struct menurendercontext *context) char *title; if (context->item->flags & MENUITEMFLAG_LIST_CUSTOMRENDER) { - context->item->handler(MENUOP_GETOPTIONHEIGHT, context->item, &spd4); + context->item->handler(MENUOP_GET_OPTION_HEIGHT, context->item, &spd4); g_LineHeight = spd4.list.value; } else { g_LineHeight = LINEHEIGHT; @@ -317,7 +317,7 @@ Gfx *menuitem_list_render(Gfx *gdl, struct menurendercontext *context) } sp15c.list.value = 0; - context->item->handler(MENUOP_GETSELECTEDINDEX, context->item, &sp15c); + context->item->handler(MENUOP_GET_SELECTED_INDEX, context->item, &sp15c); selectedindex = sp15c.list.value; if (selectedindex >= 0x10000) { @@ -326,7 +326,7 @@ Gfx *menuitem_list_render(Gfx *gdl, struct menurendercontext *context) sp104 = context->y + 1; - context->item->handler(MENUOP_GETOPTIONCOUNT, context->item, &sp15c); + context->item->handler(MENUOP_GET_OPTION_COUNT, context->item, &sp15c); numoptions = sp15c.list.value; tmp = itemdata->curoffsety - halfheight; @@ -343,12 +343,12 @@ Gfx *menuitem_list_render(Gfx *gdl, struct menurendercontext *context) sp14c.list.value = 0; sp14c.list.unk0c = 0; - context->item->handler(MENUOP_GETOPTGROUPCOUNT, context->item, &sp14c); + context->item->handler(MENUOP_GET_OPTGROUP_COUNT, context->item, &sp14c); numgroups = sp14c.list.values32 & 0xffffffff; if (numoptions > 0) { // If this list uses option groups, draw a sticky group header - // if the player has scroll down far enough + // if the player has scrolled down far enough if (numgroups != 0) { s32 spc8; done = false; @@ -360,7 +360,7 @@ Gfx *menuitem_list_render(Gfx *gdl, struct menurendercontext *context) // Iterate all groups ascending until we find the first one that's // on-screen, then take the one before it while (!done && sp14c.list.values32 < numgroups) { - context->item->handler(MENUOP_GETGROUPSTARTINDEX, context->item, &sp14c); + context->item->handler(MENUOP_GET_OPTGROUP_START_INDEX, context->item, &sp14c); tmp = sp14c.list.groupstartindex & 0xffffffff; if (tmp <= firstonscreenoptionindex) { @@ -377,7 +377,7 @@ Gfx *menuitem_list_render(Gfx *gdl, struct menurendercontext *context) sp13c.list.unk0c = sp14c.list.unk0c; if (nextgroupstartindex < firstonscreenoptionindex || s4 < LINEHEIGHT) { - text = (char *) context->item->handler(MENUOP_GETOPTGROUPTEXT, context->item, &sp13c); + text = (char *) context->item->handler(MENUOP_GET_OPTGROUP_TEXT, context->item, &sp13c); if (s4 + g_LineHeight > 0) { gdl = menuitem_list_render_header(gdl, context->x, context->y, context->width, width, LINEHEIGHT, text, context->dialog); @@ -389,7 +389,7 @@ Gfx *menuitem_list_render(Gfx *gdl, struct menurendercontext *context) sp13c.list.value++; if (sp14c.list.values32 < numgroups) { - context->item->handler(MENUOP_GETGROUPSTARTINDEX, context->item, &sp14c); + context->item->handler(MENUOP_GET_OPTGROUP_START_INDEX, context->item, &sp14c); tmp = sp14c.list.groupstartindex & 0xffffffff; nextgroupstartindex = tmp; sp14c.list.values32++; @@ -421,7 +421,7 @@ Gfx *menuitem_list_render(Gfx *gdl, struct menurendercontext *context) gdl = menu_apply_scissor(gdl); } - title = (char *) context->item->handler(MENUOP_GETOPTGROUPTEXT, context->item, &sp13c); + title = (char *) context->item->handler(MENUOP_GET_OPTGROUP_TEXT, context->item, &sp13c); sp13c.list.value++; height = context->height - s4; @@ -433,7 +433,7 @@ Gfx *menuitem_list_render(Gfx *gdl, struct menurendercontext *context) gdl = menuitem_list_render_header(gdl, context->x, context->y + s4, context->width, width, height, title, context->dialog); if (sp14c.list.values32 < numgroups) { - context->item->handler(MENUOP_GETGROUPSTARTINDEX, context->item, &sp14c); + context->item->handler(MENUOP_GET_OPTGROUP_START_INDEX, context->item, &sp14c); tmp = sp14c.list.groupstartindex & 0xffffffff; nextgroupstartindex = tmp; sp14c.list.value++; @@ -585,7 +585,7 @@ Gfx *menuitem_list_render(Gfx *gdl, struct menurendercontext *context) } else { // Default/simple option (label and optional checkbox) sp15c.list.value = optionindex; - text2 = (char *) context->item->handler(MENUOP_GETOPTIONTEXT, context->item, &sp15c); + text2 = (char *) context->item->handler(MENUOP_GET_OPTION_TEXT, context->item, &sp15c); sp128 = 0; y = context->y + s4 + 1; @@ -612,7 +612,7 @@ Gfx *menuitem_list_render(Gfx *gdl, struct menurendercontext *context) spb8.list.value = optionindex; spb8.list.unk04 = 255; - context->item->handler(MENUOP_GETLISTITEMCHECKBOX, context->item, &spb8); + context->item->handler(MENUOP_IS_OPTION_CHECKED, context->item, &spb8); if (spb8.list.unk04 != 255) { gdl = menugfx_draw_checkbox(gdl, left, context->y + s4 + 1, 6, spb8.list.unk04, colour, 0xff00007f); @@ -676,7 +676,7 @@ bool menuitem_list_tick(struct menuitem *item, struct menuinputs *inputs, u32 ti } if (item->flags & MENUITEMFLAG_LIST_CUSTOMRENDER) { - item->handler(MENUOP_GETOPTIONHEIGHT, item, &handlerdata2); + item->handler(MENUOP_GET_OPTION_HEIGHT, item, &handlerdata2); g_LineHeight = handlerdata2.list.value; } else { g_LineHeight = LINEHEIGHT; @@ -693,7 +693,7 @@ bool menuitem_list_tick(struct menuitem *item, struct menuinputs *inputs, u32 ti data->list.targetoffsety = min; } - item->handler(MENUOP_GETOPTIONCOUNT, item, &handlerdata); + item->handler(MENUOP_GET_OPTION_COUNT, item, &handlerdata); max = (s16) handlerdata.list.value * g_LineHeight - data->list.viewheight + min; @@ -722,7 +722,7 @@ bool menuitem_list_tick(struct menuitem *item, struct menuinputs *inputs, u32 ti } if (tickflags & MENUTICKFLAG_ITEMISFOCUSED) { - item->handler(MENUOP_GETOPTIONCOUNT, item, &handlerdata); + item->handler(MENUOP_GET_OPTION_COUNT, item, &handlerdata); if (handlerdata.list.value) { last = handlerdata.list.value - 1; @@ -748,7 +748,7 @@ bool menuitem_list_tick(struct menuitem *item, struct menuinputs *inputs, u32 ti if (prev2 != data->list.index) { handlerdata.list.value = data->list.index; - item->handler(MENUOP_LISTITEMFOCUS, item, &handlerdata); + item->handler(MENUOP_ON_OPTION_FOCUS, item, &handlerdata); menu_play_sound(MENUSOUND_SUBFOCUS); } @@ -762,7 +762,7 @@ bool menuitem_list_tick(struct menuitem *item, struct menuinputs *inputs, u32 ti handlerdata.list.unk04 = 1; } - item->handler(MENUOP_SET, item, &handlerdata); + item->handler(MENUOP_CONFIRM, item, &handlerdata); menu_play_sound(MENUSOUND_SELECT); @@ -781,7 +781,7 @@ bool menuitem_list_tick(struct menuitem *item, struct menuinputs *inputs, u32 ti handlerdata.list.unk0c = tmp; handlerdata.list.groupstartindex = (tickflags & MENUTICKFLAG_ITEMISFOCUSED) ? 1 : 0; - item->handler(MENUOP_25, item, &handlerdata); + item->handler(MENUOP_GET_OPTION_INDEX2, item, &handlerdata); if (handlerdata.list.unk0c != handlerdata.list.value) { data->list.index = handlerdata.list.value; @@ -807,30 +807,27 @@ void menuitem_dropdown_init(struct menuitem *item, union menuitemdata *data) handler = item->handler; if (item->flags & MENUITEMFLAG_LIST_CUSTOMRENDER) { - handler(MENUOP_GETOPTIONHEIGHT, item, &handlerdata2); + handler(MENUOP_GET_OPTION_HEIGHT, item, &handlerdata2); g_LineHeight = handlerdata2.dropdown.value; } else { g_LineHeight = LINEHEIGHT; } - item->handler(MENUOP_GETSELECTEDINDEX, item, &handlerdata); + item->handler(MENUOP_GET_SELECTED_INDEX, item, &handlerdata); if (handlerdata.dropdown.value < 0xffff) { data->dropdown.list.index = (u16) handlerdata.dropdown.value; } else { - // The value won't fit in unk02. - // Maybe MENUOP_25 is getting a scaled-down value? - // But then how does it know the value is scaled? handlerdata.dropdown.value = 0; handlerdata.dropdown.unk04 = 0; - item->handler(MENUOP_25, item, &handlerdata); + item->handler(MENUOP_GET_OPTION_INDEX2, item, &handlerdata); data->dropdown.list.index = handlerdata.dropdown.value; } data->dropdown.list.targetoffsety = menuitem_list_get_offset_y(data->dropdown.list.index, item); - item->handler(MENUOP_LISTITEMFOCUS, item, &handlerdata); + item->handler(MENUOP_ON_OPTION_FOCUS, item, &handlerdata); } Gfx *menuitem_dropdown_render(Gfx *gdl, struct menurendercontext *context) @@ -906,10 +903,10 @@ Gfx *menuitem_dropdown_render(Gfx *gdl, struct menurendercontext *context) s32 textwidth; data.list.value = 0; - context->item->handler(MENUOP_GETSELECTEDINDEX, context->item, &data); + context->item->handler(MENUOP_GET_SELECTED_INDEX, context->item, &data); data.list.unk04 = 0; - text = (char *)context->item->handler(MENUOP_GETOPTIONTEXT, context->item, &data); + text = (char *)context->item->handler(MENUOP_GET_OPTION_TEXT, context->item, &data); text_measure(&textheight, &textwidth, text, g_CharsHandelGothicSm, g_FontHandelGothicSm, 0); @@ -953,7 +950,7 @@ bool menuitem_dropdown_tick(struct menuitem *item, struct menudialog *dialog, st menuitem_dropdown_init(item, data); handlerdata.dropdown.value = 0; - item->handler(MENUOP_GETSELECTEDINDEX, item, &handlerdata); + item->handler(MENUOP_GET_SELECTED_INDEX, item, &handlerdata); data->dropdown.unk0e = (u32)handlerdata.dropdown.value * g_LineHeight; menu_play_sound(MENUSOUND_TOGGLEOFF); } @@ -1005,13 +1002,13 @@ Gfx *menuitem_dropdown_overlay(Gfx *gdl, s16 x, s16 y, s16 x2, s16 y2, struct me if (item->flags & MENUITEMFLAG_LIST_CUSTOMRENDER) { union handlerdata handlerdata2; - item->handler(MENUOP_GETOPTIONHEIGHT, item, &handlerdata2); \ + item->handler(MENUOP_GET_OPTION_HEIGHT, item, &handlerdata2); \ g_LineHeight = handlerdata2.dropdown.value; \ } else { \ g_LineHeight = LINEHEIGHT; } - item->handler(MENUOP_GETOPTIONCOUNT, item, &handlerdata); + item->handler(MENUOP_GET_OPTION_COUNT, item, &handlerdata); numoptions = handlerdata.dropdown.value; context.width = 0; @@ -1019,7 +1016,7 @@ Gfx *menuitem_dropdown_overlay(Gfx *gdl, s16 x, s16 y, s16 x2, s16 y2, struct me for (i = 0; i != numoptions; i++) { handlerdata.dropdown.value = i; - text = (char *)item->handler(MENUOP_GETOPTIONTEXT, item, &handlerdata); + text = (char *)item->handler(MENUOP_GET_OPTION_TEXT, item, &handlerdata); text_measure(&textheight, &textwidth, text, g_CharsHandelGothicSm, g_FontHandelGothicSm, 0); textwidth += 6; @@ -1423,11 +1420,11 @@ bool menuitem_keyboard_tick(struct menuitem *item, struct menuinputs *inputs, u3 menu_play_sound(MENUSOUND_SELECT); handlerdata.keyboard.string = kb->string; - item->handler(MENUOP_SETTEXT, item, &handlerdata); + item->handler(MENUOP_SET_KEYBOARD_STRING, item, &handlerdata); menu_pop_dialog(); - item->handler(MENUOP_SET, item, &handlerdata); + item->handler(MENUOP_CONFIRM, item, &handlerdata); } inputs->start = false; @@ -1449,7 +1446,7 @@ bool menuitem_keyboard_tick(struct menuitem *item, struct menuinputs *inputs, u3 if (kb->col == 8) { if (item->handler && !menuitem_keyboard_is_string_empty_or_spaces(kb->string)) { handlerdata.keyboard.string = kb->string; - item->handler(MENUOP_SETTEXT, item, &handlerdata); + item->handler(MENUOP_SET_KEYBOARD_STRING, item, &handlerdata); } } @@ -1461,7 +1458,7 @@ bool menuitem_keyboard_tick(struct menuitem *item, struct menuinputs *inputs, u3 menu_pop_dialog(); if (ok) { - item->handler(MENUOP_SET, item, &handlerdata); + item->handler(MENUOP_CONFIRM, item, &handlerdata); menu_play_sound(MENUSOUND_SELECT); } else { menu_play_sound(MENUSOUND_KEYBOARDCANCEL); @@ -1562,7 +1559,7 @@ void menuitem_keyboard_init(struct menuitem *item, union menuitemdata *data) if (item->handler) { union handlerdata handlerdata; handlerdata.keyboard.string = data->keyboard.string; - item->handler(MENUOP_GETTEXT, item, &handlerdata); + item->handler(MENUOP_GET_KEYBOARD_STRING, item, &handlerdata); } data->keyboard.col = 0; @@ -1975,11 +1972,10 @@ Gfx *menuitem_label_render(Gfx *gdl, struct menurendercontext *context) data.label.colour1 = colour1; if (context->item->handlervoid) { - context->item->handlervoid(MENUOP_GETCOLOUR, context->item, &data); + context->item->handlervoid(MENUOP_GET_LABEL_COLOURS, context->item, &data); } - if (context->item->handlervoid) { - } + if (context->item->handlervoid); colour2 = data.label.colour2; colour1 = data.label.colour1; @@ -2244,7 +2240,7 @@ bool menuitem_selectable_tick(struct menuitem *item, struct menuinputs *inputs, menu_push_dialog((struct menudialogdef *)item->handler); } else if (item->handler) { union handlerdata data; - item->handler(MENUOP_SET, item, &data); + item->handler(MENUOP_CONFIRM, item, &data); } } @@ -2268,7 +2264,7 @@ Gfx *menuitem_slider_render(Gfx *gdl, struct menurendercontext *context) extray = 0; if (context->item->handler != NULL) { - context->item->handler(MENUOP_GETSLIDER, context->item, &data); + context->item->handler(MENUOP_GET_SLIDER_VALUE, context->item, &data); slidervalue = (s16) data.slider.value; } else { slidervalue = 0; @@ -2355,7 +2351,7 @@ Gfx *menuitem_slider_render(Gfx *gdl, struct menurendercontext *context) data.slider.value = slidervalue; data.slider.label = buffer; - context->item->handler(MENUOP_GETSLIDERLABEL, context->item, &data); + context->item->handler(MENUOP_GET_SLIDER_LABEL, context->item, &data); } text_measure(&textheight, &textwidth, buffer, g_CharsHandelGothicSm, g_FontHandelGothicSm, 0); @@ -2392,7 +2388,7 @@ bool menuitem_slider_tick(struct menuitem *item, struct menudialog *dialog, stru if ((tickflags & MENUTICKFLAG_ITEMISFOCUSED)) { if (tickflags & MENUTICKFLAG_DIALOGISDIMMED) { if (item->handler) { - item->handler(MENUOP_GETSLIDER, item, &handlerdata); + item->handler(MENUOP_GET_SLIDER_VALUE, item, &handlerdata); index = (s16) handlerdata.slider.value; } else { index = 0; @@ -2474,7 +2470,7 @@ bool menuitem_slider_tick(struct menuitem *item, struct menudialog *dialog, stru handlerdata.slider.value = index; if (item->handler) { - item->handler(MENUOP_SET, item, &handlerdata); + item->handler(MENUOP_CONFIRM, item, &handlerdata); } if (inputs->select) { @@ -2529,7 +2525,7 @@ Gfx *menuitem_carousel_render(Gfx *gdl, struct menurendercontext *context) union handlerdata data; s32 headorbodynum = 0; - context->item->handler(MENUOP_GETSELECTEDINDEX, context->item, &data); + context->item->handler(MENUOP_GET_SELECTED_INDEX, context->item, &data); headorbodynum += data.carousel.value; gdl = func0f14f07c(gdl, headorbodynum, @@ -2537,7 +2533,7 @@ Gfx *menuitem_carousel_render(Gfx *gdl, struct menurendercontext *context) context->x + context->width / 2 + 32, context->y + 64); } else if ((context->item->param2 == 124 || context->item->param2 == 125) && context->item->handler) { union handlerdata data; - context->item->handler(MENUOP_GETSELECTEDINDEX, context->item, &data); + context->item->handler(MENUOP_GET_SELECTED_INDEX, context->item, &data); } return gdl; @@ -2551,16 +2547,15 @@ bool menuitem_carousel_tick(struct menuitem *item, struct menuinputs *inputs, u3 bool done; u32 stack; - if (((tickflags & MENUTICKFLAG_ITEMISFOCUSED) || (item->flags & MENUITEMFLAG_CAROUSEL_04000000)) && item->handler) { + if (((tickflags & MENUTICKFLAG_ITEMISFOCUSED) || (item->flags & MENUITEMFLAG_CAROUSEL_SCROLLWITHOUTFOCUS)) && item->handler) { if (inputs->leftright != 0) { - if (mp_is_player_locked_out(g_MpPlayerNum) == 0 || (item->flags & MENUITEMFLAG_LOCKABLEMINOR) == 0) { + if (!mp_is_player_locked_out(g_MpPlayerNum) || (item->flags & MENUITEMFLAG_LOCKABLEMINOR) == 0) { done = false; - item->handler(MENUOP_GETOPTIONCOUNT, item, &data); - + item->handler(MENUOP_GET_OPTION_COUNT, item, &data); numoptions = data.carousel.value; - item->handler(MENUOP_GETSELECTEDINDEX, item, &data); + item->handler(MENUOP_GET_SELECTED_INDEX, item, &data); index = data.carousel.value; while (!done) { @@ -2574,10 +2569,10 @@ bool menuitem_carousel_tick(struct menuitem *item, struct menuinputs *inputs, u3 index = numoptions - 1; } - // Some kind of option-is-locked check? data.carousel.value = index; - if (!item->handler(MENUOP_21, item, &data)) { + // If this option is visible, break from the loop + if (!item->handler(MENUOP_IS_CAROUSEL_OPTION_HIDDEN, item, &data)) { done = true; } } @@ -2587,12 +2582,12 @@ bool menuitem_carousel_tick(struct menuitem *item, struct menuinputs *inputs, u3 data.carousel.unk04 = inputs->shoulder; #endif - item->handler(MENUOP_SET, item, &data); + item->handler(MENUOP_CONFIRM, item, &data); } } if (item->handler) { - item->handler(MENUOP_11, item, &data); + item->handler(MENUOP_ON_CAROUSEL_TICK, item, &data); } } @@ -2605,7 +2600,7 @@ Gfx *menuitem_checkbox_render(Gfx *gdl, struct menurendercontext *context) char *text; s32 x; s32 y; - u8 data[3]; + u8 data[1]; bool checked = false; u32 fillcolour = 0xff002faf; struct font *font2 = g_FontHandelGothicSm; @@ -2621,8 +2616,7 @@ Gfx *menuitem_checkbox_render(Gfx *gdl, struct menurendercontext *context) text = menu_resolve_param2_text(context->item); data[0] = 0; - if (context->item->handler - && context->item->handler(MENUOP_GET, context->item, (union handlerdata *)data) == true) { + if (context->item->handler && context->item->handler(MENUOP_IS_CHECKED, context->item, (union handlerdata *)data) == true) { checked = true; if (context->dialog->transitionfrac < 0) { @@ -2725,7 +2719,7 @@ bool menuitem_checkbox_tick(struct menuitem *item, struct menuinputs *inputs, u3 union handlerdata data; if ((tickflags & MENUTICKFLAG_ITEMISFOCUSED) && inputs->select) { - if (item->handler && item->handler(MENUOP_GET, item, &data) == 1) { + if (item->handler && item->handler(MENUOP_IS_CHECKED, item, &data) == true) { data.checkbox.value = 0; menu_play_sound(MENUSOUND_TOGGLEOFF); } else { @@ -2734,7 +2728,7 @@ bool menuitem_checkbox_tick(struct menuitem *item, struct menuinputs *inputs, u3 } if (item->handler) { - item->handler(MENUOP_SET, item, &data); + item->handler(MENUOP_CONFIRM, item, &data); } } diff --git a/src/game/mplayer/ingame.c b/src/game/mplayer/ingame.c index a80634f93..d73d5f1b6 100644 --- a/src/game/mplayer/ingame.c +++ b/src/game/mplayer/ingame.c @@ -36,7 +36,7 @@ MenuItemHandlerResult mp_stats_for_player_dropdown_handler(s32 operation, struct s32 a1; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = 0; for (v0 = 0; v0 < MAX_MPCHRS; v0++) { @@ -45,7 +45,7 @@ MenuItemHandlerResult mp_stats_for_player_dropdown_handler(s32 operation, struct } } break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: v0 = 0; for (a1 = 0; a1 < MAX_MPCHRS; a1++) { @@ -61,7 +61,7 @@ MenuItemHandlerResult mp_stats_for_player_dropdown_handler(s32 operation, struct } return (s32) ""; - case MENUOP_SET: + case MENUOP_CONFIRM: v0 = 0; for (a1 = 0; a1 < MAX_MPCHRS; a1++) { @@ -77,7 +77,7 @@ MenuItemHandlerResult mp_stats_for_player_dropdown_handler(s32 operation, struct } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: v0 = 0; for (v1 = 0; v1 < MAX_MPCHRS; v1++) { @@ -100,7 +100,7 @@ MenuItemHandlerResult mp_stats_for_player_dropdown_handler(s32 operation, struct MenuItemHandlerResult menuhandler_mp_end_game(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_Vars.currentplayer->aborted = true; main_end_stage(); } @@ -113,7 +113,7 @@ MenuItemHandlerResult menuhandler_mp_end_game(s32 operation, struct menuitem *it */ MenuItemHandlerResult menuhandler00178018(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { if (g_BossFile.locktype != MPLOCKTYPE_CHALLENGE) { return true; } @@ -143,7 +143,7 @@ char *mp_menu_text_in_game_limit(struct menuitem *item) MenuItemHandlerResult menuhandler_mp_in_game_limit_label(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { switch (item->param) { case 0: if (g_MpSetup.timelimit == 60) return true; break; case 1: if (g_MpSetup.scorelimit == 100) return true; break; @@ -156,7 +156,7 @@ MenuItemHandlerResult menuhandler_mp_in_game_limit_label(s32 operation, struct m MenuItemHandlerResult menuhandler_mp_pause(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { if (mp_is_paused()) { mp_set_paused(MPPAUSEMODE_UNPAUSED); } else { @@ -164,13 +164,13 @@ MenuItemHandlerResult menuhandler_mp_pause(s32 operation, struct menuitem *item, } } - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { if (PLAYERCOUNT() == 1) { return true; } } - if (operation == MENUOP_CHECKPREFOCUSED) { + if (operation == MENUOP_IS_PREFOCUSED) { if (item->param == 1) { return true; } @@ -530,7 +530,7 @@ struct menudialogdef g_MpPausePlayerStatsMenuDialog = { (uintptr_t)&mp_menu_title_stats_for, g_MpInGamePlayerStatsMenuItems, NULL, - VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_1000 : 0, + VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_LESSHEIGHT : 0, &g_MpPauseInventoryMenuDialog, }; @@ -539,7 +539,7 @@ struct menudialogdef g_MpEndscreenPlayerStatsMenuDialog = { (uintptr_t)&mp_menu_title_stats_for, g_MpInGamePlayerStatsMenuItems, NULL, - VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_1000 : 0, + VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_LESSHEIGHT : 0, NULL, }; @@ -560,7 +560,7 @@ struct menudialogdef g_MpPausePlayerRankingMenuDialog = { L_MPMENU_276, // "Player Ranking" g_MpPlayerRankingMenuItems, NULL, - VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_1000 : 0, + VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_LESSHEIGHT : 0, &g_MpPausePlayerStatsMenuDialog, }; @@ -569,7 +569,7 @@ struct menudialogdef g_MpEndscreenPlayerRankingMenuDialog = { L_MPMENU_276, // "Player Ranking" g_MpPlayerRankingMenuItems, NULL, - VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_1000 : 0, + VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_LESSHEIGHT : 0, &g_MpEndscreenPlayerStatsMenuDialog, }; @@ -590,7 +590,7 @@ struct menudialogdef g_MpPauseTeamRankingsMenuDialog = { L_MPMENU_279, // "Team Ranking" g_MpTeamRankingsMenuItems, NULL, - VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_1000 : 0, + VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_LESSHEIGHT : 0, &g_MpPausePlayerRankingMenuDialog, }; @@ -599,7 +599,7 @@ struct menudialogdef g_MpEndscreenTeamRankingMenuDialog = { L_MPMENU_279, // "Team Ranking" g_MpTeamRankingsMenuItems, NULL, - VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_1000 : 0, + VERSION >= VERSION_JPN_FINAL ? MENUDIALOGFLAG_LESSHEIGHT : 0, &g_MpEndscreenPlayerRankingMenuDialog, }; @@ -625,7 +625,7 @@ char *mp_menu_text_placement_with_suffix(struct menuitem *item) MenuItemHandlerResult mp_placement_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_GETCOLOUR) { + if (operation == MENUOP_GET_LABEL_COLOURS) { if (g_PlayerConfigsArray[g_MpPlayerNum].base.placement == 0) { // winner data->label.colour2 = colour_blend(data->label.colour2, 0xffff00ff, menu_get_sin_osc_frac(40) * 255); } @@ -706,7 +706,7 @@ MenuItemHandlerResult mp_awards_menu_handler(s32 operation, struct menuitem *ite MenuItemHandlerResult mp_player_title_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_GETCOLOUR) { + if (operation == MENUOP_GET_LABEL_COLOURS) { if (g_PlayerConfigsArray[g_MpPlayerNum].title != g_PlayerConfigsArray[g_MpPlayerNum].newtitle) { data->label.colour2 = colour_blend(data->label.colour2, 0xffff00ff, menu_get_sin_osc_frac(40) * 255); } @@ -727,7 +727,7 @@ MenuItemHandlerResult mp_confirm_player_name_handler(s32 operation, struct menui s32 i; switch (operation) { - case MENUOP_GETTEXT: + case MENUOP_GET_KEYBOARD_STRING: i = 0; while (g_PlayerConfigsArray[g_MpPlayerNum].base.name[i] != '\n' @@ -742,7 +742,7 @@ MenuItemHandlerResult mp_confirm_player_name_handler(s32 operation, struct menui i++; } break; - case MENUOP_SETTEXT: + case MENUOP_SET_KEYBOARD_STRING: i = 0; while (i <= 10 && name[i] != '\0') { @@ -758,7 +758,7 @@ MenuItemHandlerResult mp_confirm_player_name_handler(s32 operation, struct menui i++; } break; - case MENUOP_SET: + case MENUOP_CONFIRM: filemgr_push_select_location_dialog(6, FILETYPE_MPPLAYER); break; } diff --git a/src/game/mplayer/scenarios.c b/src/game/mplayer/scenarios.c index e6f3e6b97..a7815b88f 100644 --- a/src/game/mplayer/scenarios.c +++ b/src/game/mplayer/scenarios.c @@ -97,7 +97,7 @@ struct scenariodata g_ScenarioData; MenuItemHandlerResult menuhandler_mp_display_team(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKDISABLED) { + if (operation == MENUOP_IS_DISABLED) { if (g_MpSetup.options & MPOPTION_TEAMSENABLED) { return false; } @@ -110,7 +110,7 @@ MenuItemHandlerResult menuhandler_mp_display_team(s32 operation, struct menuitem MenuItemHandlerResult menuhandler_mp_one_hit_kills(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKDISABLED || operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_DISABLED || operation == MENUOP_IS_HIDDEN) { if (challenge_is_feature_unlocked(MPFEATURE_ONEHITKILLS)) { return false; } @@ -130,18 +130,18 @@ MenuItemHandlerResult menuhandler_mp_slow_motion(s32 operation, struct menuitem }; switch (operation) { - case MENUOP_CHECKDISABLED: - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_DISABLED: + case MENUOP_IS_HIDDEN: if (challenge_is_feature_unlocked(MPFEATURE_SLOWMOTION)) { return false; } return true; - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = 3; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32)lang_get(labels[data->dropdown.value]); - case MENUOP_SET: + case MENUOP_CONFIRM: g_MpSetup.options &= ~(MPOPTION_SLOWMOTION_ON | MPOPTION_SLOWMOTION_SMART); if (data->dropdown.value == SLOWMOTION_ON) { @@ -150,7 +150,7 @@ MenuItemHandlerResult menuhandler_mp_slow_motion(s32 operation, struct menuitem g_MpSetup.options |= MPOPTION_SLOWMOTION_SMART; } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: if (g_MpSetup.options & MPOPTION_SLOWMOTION_SMART) { data->dropdown.value = SLOWMOTION_SMART; } else if (g_MpSetup.options & MPOPTION_SLOWMOTION_ON) { @@ -266,7 +266,7 @@ struct mpscenariooverview g_MpScenarioOverviews[] = { */ MenuDialogHandlerResult mp_options_menu_dialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_TICK) { if (g_Menus[g_MpPlayerNum].curdialog->definition != g_MpScenarios[g_MpSetup.scenario].optionsdialog) { s32 i; s32 end = ARRAYCOUNT(g_MpScenarios); @@ -322,7 +322,7 @@ MenuItemHandlerResult scenario_scenario_menu_handler(s32 operation, struct menui } switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: for (i = 0; i < ARRAYCOUNT(g_MpScenarioOverviews); i++) { if (challenge_is_feature_unlocked(g_MpScenarioOverviews[i].requirefeature) && (teamgame || g_MpScenarioOverviews[i].teamonly == false)) { @@ -332,7 +332,7 @@ MenuItemHandlerResult scenario_scenario_menu_handler(s32 operation, struct menui data->list.value = count; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: for (i = 0; i < ARRAYCOUNT(g_MpScenarioOverviews); i++) { if (challenge_is_feature_unlocked(g_MpScenarioOverviews[i].requirefeature) && (teamgame || g_MpScenarioOverviews[i].teamonly == false)) { @@ -345,7 +345,7 @@ MenuItemHandlerResult scenario_scenario_menu_handler(s32 operation, struct menui } break; - case MENUOP_SET: + case MENUOP_CONFIRM: for (i = 0; i < ARRAYCOUNT(g_MpScenarioOverviews); i++) { if (challenge_is_feature_unlocked(g_MpScenarioOverviews[i].requirefeature) && (teamgame || g_MpScenarioOverviews[i].teamonly == false)) { @@ -360,7 +360,7 @@ MenuItemHandlerResult scenario_scenario_menu_handler(s32 operation, struct menui scenario_init(); break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: for (i = 0; i < ARRAYCOUNT(g_MpScenarioOverviews); i++) { if (challenge_is_feature_unlocked(g_MpScenarioOverviews[i].requirefeature) && (teamgame || g_MpScenarioOverviews[i].teamonly == false)) { @@ -374,16 +374,16 @@ MenuItemHandlerResult scenario_scenario_menu_handler(s32 operation, struct menui } break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 2; if (!teamgame || (!challenge_is_feature_unlocked(MPFEATURE_SCENARIO_KOH) && !challenge_is_feature_unlocked(MPFEATURE_SCENARIO_CTC))) { data->list.value--; } break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return (s32)lang_get(groups[data->list.value].textid); - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: for (i = 0; i < groups[data->list.value].startindex; i++) { if (challenge_is_feature_unlocked(g_MpScenarioOverviews[i].requirefeature) && (teamgame || g_MpScenarioOverviews[i].teamonly == false)) { @@ -400,7 +400,7 @@ MenuItemHandlerResult scenario_scenario_menu_handler(s32 operation, struct menui MenuItemHandlerResult menuhandler_mp_open_options(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_push_dialog(g_MpScenarios[g_MpSetup.scenario].optionsdialog); } diff --git a/src/game/mplayer/scenarios/kingofthehill.inc b/src/game/mplayer/scenarios/kingofthehill.inc index 71dfcd6d4..ad6041090 100644 --- a/src/game/mplayer/scenarios/kingofthehill.inc +++ b/src/game/mplayer/scenarios/kingofthehill.inc @@ -16,13 +16,13 @@ MenuItemHandlerResult menuhandler_mp_hill_time(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETSLIDER: + case MENUOP_GET_SLIDER_VALUE: data->slider.value = g_Vars.mphilltime; break; - case MENUOP_SET: + case MENUOP_CONFIRM: g_Vars.mphilltime = (u8)data->slider.value; break; - case MENUOP_GETSLIDERLABEL: + case MENUOP_GET_SLIDER_LABEL: sprintf(data->slider.label, lang_get(L_MPWEAPONS_023), data->slider.value + 10); // "%ds/Point" break; } diff --git a/src/game/mplayer/setup.c b/src/game/mplayer/setup.c index 29aa15255..b4aca3c75 100644 --- a/src/game/mplayer/setup.c +++ b/src/game/mplayer/setup.c @@ -40,7 +40,7 @@ void mp_close_dialogs_for_new_setup(void); MenuItemHandlerResult menuhandler_mp_drop_out(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_pop_dialog(); menu_pop_dialog(); } @@ -55,7 +55,7 @@ char *mp_get_current_player_name(struct menuitem *item) MenuItemHandlerResult menuhandler_mp_teams_label(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKDISABLED) { + if (operation == MENUOP_IS_DISABLED) { if ((g_MpSetup.options & MPOPTION_TEAMSENABLED) == 0) { return true; } @@ -167,7 +167,7 @@ MenuItemHandlerResult mp_arena_menu_handler(s32 operation, struct menuitem *item s32 groupindex; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: for (i = 0; i < ARRAYCOUNT(g_MpArenas); i++) { if (challenge_is_feature_unlocked(g_MpArenas[i].requirefeature)) { count++; @@ -176,7 +176,7 @@ MenuItemHandlerResult mp_arena_menu_handler(s32 operation, struct menuitem *item data->list.value = count; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: for (i = 0; i < ARRAYCOUNT(g_MpArenas); i++) { if (challenge_is_feature_unlocked(g_MpArenas[i].requirefeature)) { if (count == data->list.value) { @@ -187,7 +187,7 @@ MenuItemHandlerResult mp_arena_menu_handler(s32 operation, struct menuitem *item } } break; - case MENUOP_SET: + case MENUOP_CONFIRM: for (i = 0; i < ARRAYCOUNT(g_MpArenas); i++) { if (challenge_is_feature_unlocked(g_MpArenas[i].requirefeature)) { if (count == data->list.value) { @@ -200,7 +200,7 @@ MenuItemHandlerResult mp_arena_menu_handler(s32 operation, struct menuitem *item g_MpSetup.stagenum = g_MpArenas[i].stagenum; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: for (i = 0; i < ARRAYCOUNT(g_MpArenas); i++) { if (g_MpSetup.stagenum == g_MpArenas[i].stagenum) { data->list.value = count; @@ -211,7 +211,7 @@ MenuItemHandlerResult mp_arena_menu_handler(s32 operation, struct menuitem *item } } break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 3; if (!challenge_is_feature_unlocked(MPFEATURE_STAGE_COMPLEX) @@ -220,7 +220,7 @@ MenuItemHandlerResult mp_arena_menu_handler(s32 operation, struct menuitem *item data->list.value--; } break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: count = data->list.value; if (!challenge_is_feature_unlocked(MPFEATURE_STAGE_COMPLEX) @@ -230,7 +230,7 @@ MenuItemHandlerResult mp_arena_menu_handler(s32 operation, struct menuitem *item count++; } return (s32)lang_get(groups[count].name); - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: groupindex = data->list.value; if (!challenge_is_feature_unlocked(MPFEATURE_STAGE_COMPLEX) @@ -262,15 +262,15 @@ MenuItemHandlerResult menuhandler_mp_control_style(s32 operation, struct menuite }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = 4; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) lang_get(labels[data->dropdown.value]); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_control_mode(g_MpPlayerNum, data->dropdown.value); break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = options_get_control_mode(g_MpPlayerNum); break; } @@ -281,15 +281,15 @@ MenuItemHandlerResult menuhandler_mp_control_style(s32 operation, struct menuite MenuItemHandlerResult menuhandler_mp_weapon_slot(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = mp_get_num_weapon_options(); break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) mp_get_weapon_label(data->dropdown.value); - case MENUOP_SET: + case MENUOP_CONFIRM: mp_set_weapon_slot(item->param3, data->dropdown.value); break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = mp_get_weapon_slot(item->param3); } @@ -304,15 +304,15 @@ char *mp_menu_text_weapon_name_for_slot(struct menuitem *item) MenuItemHandlerResult menuhandler_mp_weapon_set_dropdown(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = mp_get_num_weaponset_slots(item->param); break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) mp_get_weaponset_name_by_slotnum(data->dropdown.value); - case MENUOP_SET: + case MENUOP_CONFIRM: mp_set_weaponset_slotnum(data->dropdown.value); break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = mp_get_weaponset_slotnum(); break; } @@ -325,7 +325,7 @@ MenuItemHandlerResult menuhandler_mp_control_checkbox(s32 operation, struct menu s32 val; switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: if (item->param3 == OPTION_FORWARDPITCH) { if ((g_PlayerConfigsArray[g_MpPlayerNum].options & item->param3) == 0) { return true; @@ -336,7 +336,7 @@ MenuItemHandlerResult menuhandler_mp_control_checkbox(s32 operation, struct menu return false; } return true; - case MENUOP_SET: + case MENUOP_CONFIRM: val = OPTION_FORWARDPITCH; if (item->param3 == val) { @@ -370,15 +370,15 @@ MenuItemHandlerResult menuhandler_mp_aim_control(s32 operation, struct menuitem }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = 2; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) lang_get(labels[data->dropdown.value]); - case MENUOP_SET: + case MENUOP_CONFIRM: options_set_aim_control(g_MpPlayerNum, data->dropdown.value); break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = options_get_aim_control(g_MpPlayerNum); break; } @@ -389,12 +389,12 @@ MenuItemHandlerResult menuhandler_mp_aim_control(s32 operation, struct menuitem MenuItemHandlerResult menuhandler_mp_checkbox_option(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: if ((g_MpSetup.options & item->param3) == 0) { return false; } return true; - case MENUOP_SET: + case MENUOP_CONFIRM: g_MpSetup.options = g_MpSetup.options & ~item->param3; if (data->checkbox.value) { g_MpSetup.options = g_MpSetup.options | item->param3; @@ -406,7 +406,7 @@ MenuItemHandlerResult menuhandler_mp_checkbox_option(s32 operation, struct menui MenuItemHandlerResult menuhandler_mp_teams_enabled(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKDISABLED) { + if (operation == MENUOP_IS_DISABLED) { if (g_MpSetup.scenario == MPSCENARIO_CAPTURETHECASE || g_MpSetup.scenario == MPSCENARIO_KINGOFTHEHILL) { return true; @@ -421,12 +421,12 @@ MenuItemHandlerResult menuhandler_mp_teams_enabled(s32 operation, struct menuite MenuItemHandlerResult menuhandler_mp_display_option_checkbox(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: if ((g_PlayerConfigsArray[g_MpPlayerNum].base.displayoptions & item->param3) == 0) { return false; } return true; - case MENUOP_SET: + case MENUOP_CONFIRM: g_PlayerConfigsArray[g_MpPlayerNum].base.displayoptions &= ~(u8)item->param3; if (data->checkbox.value) { @@ -440,7 +440,7 @@ MenuItemHandlerResult menuhandler_mp_display_option_checkbox(s32 operation, stru MenuItemHandlerResult menuhandler_mp_confirm_save_chr(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_pop_dialog(); filemgr_push_select_location_dialog(6, FILETYPE_MPPLAYER); } @@ -453,13 +453,13 @@ MenuItemHandlerResult menuhandler_mp_setup_name(s32 operation, struct menuitem * char *name = data->keyboard.string; switch (operation) { - case MENUOP_GETTEXT: + case MENUOP_GET_KEYBOARD_STRING: strcpy(name, g_MpSetup.name); break; - case MENUOP_SETTEXT: + case MENUOP_SET_KEYBOARD_STRING: strcpy(g_MpSetup.name, name); break; - case MENUOP_SET: + case MENUOP_CONFIRM: filemgr_push_select_location_dialog(7, FILETYPE_MPSETUP); break; } @@ -469,7 +469,7 @@ MenuItemHandlerResult menuhandler_mp_setup_name(s32 operation, struct menuitem * MenuItemHandlerResult menuhandler_mp_save_setup_overwrite(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_pop_dialog(); filemgr_save_or_load(&g_MpSetup.fileguid, FILEOP_SAVE_MPSETUP, 0); } @@ -479,7 +479,7 @@ MenuItemHandlerResult menuhandler_mp_save_setup_overwrite(s32 operation, struct MenuItemHandlerResult menuhandler_mp_save_setup_copy(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_pop_dialog(); menu_push_dialog(&g_MpSaveSetupNameMenuDialog); } @@ -505,13 +505,13 @@ char *mp_menu_text_setup_name(struct menuitem *item) MenuItemHandlerResult menuhandler_mp_handicap1(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETSLIDER: + case MENUOP_GET_SLIDER_VALUE: data->slider.value = g_PlayerConfigsArray[g_MpPlayerNum].base.unk18; break; - case MENUOP_SET: + case MENUOP_CONFIRM: g_PlayerConfigsArray[g_MpPlayerNum].base.unk18 = (u8) data->slider.value; break; - case MENUOP_GETSLIDERLABEL: + case MENUOP_GET_SLIDER_LABEL: sprintf(data->slider.label, "%d%%\n", data->slider.value + 20); break; } @@ -522,13 +522,13 @@ MenuItemHandlerResult menuhandler_mp_handicap1(s32 operation, struct menuitem *i MenuItemHandlerResult menuhandler_mp_handicap2(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETSLIDER: + case MENUOP_GET_SLIDER_VALUE: data->slider.value = g_PlayerConfigsArray[g_MpPlayerNum].base.unk1a; break; - case MENUOP_SET: + case MENUOP_CONFIRM: g_PlayerConfigsArray[g_MpPlayerNum].base.unk1a = (u8) data->slider.value; break; - case MENUOP_GETSLIDERLABEL: + case MENUOP_GET_SLIDER_LABEL: sprintf(data->slider.label, "%d%%\n", data->slider.value + 20); break; } @@ -539,13 +539,13 @@ MenuItemHandlerResult menuhandler_mp_handicap2(s32 operation, struct menuitem *i MenuItemHandlerResult menuhandler_mp_handicap3(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETSLIDER: + case MENUOP_GET_SLIDER_VALUE: data->slider.value = g_PlayerConfigsArray[g_MpPlayerNum].base.unk1c; break; - case MENUOP_SET: + case MENUOP_CONFIRM: g_PlayerConfigsArray[g_MpPlayerNum].base.unk1c = data->slider.value; break; - case MENUOP_GETSLIDERLABEL: + case MENUOP_GET_SLIDER_LABEL: sprintf(data->slider.label, "%d%%\n", data->slider.value + 25); break; } @@ -555,7 +555,7 @@ MenuItemHandlerResult menuhandler_mp_handicap3(s32 operation, struct menuitem *i MenuItemHandlerResult menuhandler_mp_reset_handicaps(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { mp_init_handicaps(g_MpPlayerNum); } @@ -568,10 +568,10 @@ MenuItemHandlerResult menuhandler_mp_reset_handicaps(s32 operation, struct menui MenuItemHandlerResult mp_character_body_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data, s32 mpbodynum, s32 mpheadnum, bool isplayer) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->carousel.value = mp_get_num_bodies(); break; - case MENUOP_11: + case MENUOP_ON_CAROUSEL_TICK: g_Menus[g_MpPlayerNum].menumodel.newanimnum = ANIM_01FC; g_Menus[g_MpPlayerNum].menumodel.newparams = MENUMODELPARAMS_SET_MP_HEADBODY(mpheadnum, mpbodynum); g_Menus[g_MpPlayerNum].menumodel.zoomtimer60 += g_Vars.diffframe60; @@ -595,21 +595,21 @@ MenuItemHandlerResult mp_character_body_menu_handler(s32 operation, struct menui g_Menus[g_MpPlayerNum].menumodel.partvisibility = NULL; g_Menus[g_MpPlayerNum].menumodel.zoom = 30; break; - case MENUOP_21: + case MENUOP_IS_CAROUSEL_OPTION_HIDDEN: if (!challenge_is_feature_unlocked(mp_get_body_required_feature(data->carousel.value))) { return 1; } break; #if VERSION >= VERSION_NTSC_1_0 - case MENUOP_FOCUS: + case MENUOP_ON_FOCUS: g_Menus[g_MpPlayerNum].menumodel.loaddelay = 3; break; #endif - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->carousel.value = mpbodynum; break; - case MENUOP_SET: - case MENUOP_CHECKPREFOCUSED: + case MENUOP_CONFIRM: + case MENUOP_IS_PREFOCUSED: g_Menus[g_MpPlayerNum].menumodel.removingpiece = false; menu_configure_model(&g_Menus[g_MpPlayerNum].menumodel, 0, 0, 0, 0, 0, 0, 1, MENUMODELFLAG_HASSCALE); @@ -630,7 +630,7 @@ MenuItemHandlerResult mp_character_body_menu_handler(s32 operation, struct menui g_Menus[g_MpPlayerNum].menumodel.loaddelay = 8; #if VERSION >= VERSION_NTSC_1_0 - if (operation == MENUOP_CHECKPREFOCUSED) { + if (operation == MENUOP_IS_PREFOCUSED) { g_Menus[g_MpPlayerNum].menumodel.loaddelay = 16; } #endif @@ -644,7 +644,7 @@ MenuItemHandlerResult mp_character_body_menu_handler(s32 operation, struct menui MenuItemHandlerResult menuhandler_mp_character_body(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_SET: + case MENUOP_CONFIRM: if (g_PlayerConfigsArray[g_MpPlayerNum].base.mpheadnum < mp_get_num_heads()) { #if VERSION >= VERSION_NTSC_1_0 if (!data->carousel.unk04) @@ -656,7 +656,7 @@ MenuItemHandlerResult menuhandler_mp_character_body(s32 operation, struct menuit g_PlayerConfigsArray[g_MpPlayerNum].base.mpbodynum = data->carousel.value; mp_restart_character_body_label_timer(); break; - case MENUOP_CHECKPREFOCUSED: + case MENUOP_IS_PREFOCUSED: #if VERSION >= VERSION_NTSC_1_0 mp_character_body_menu_handler(operation, item, data, g_PlayerConfigsArray[g_MpPlayerNum].base.mpbodynum, @@ -673,16 +673,16 @@ MenuItemHandlerResult menuhandler_mp_character_body(s32 operation, struct menuit MenuDialogHandlerResult menudialog_mp_human_character(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: break; - case MENUOP_TICK: + case MENUOP_ON_TICK: if (g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef && g_Menus[g_MpPlayerNum].curdialog->focuseditem != &dialogdef->items[1] && g_Menus[g_MpPlayerNum].curdialog->focuseditem != &dialogdef->items[2]) { union handlerdata data; - menuhandler_mp_character_body(MENUOP_11, &dialogdef->items[2], &data); + menuhandler_mp_character_body(MENUOP_ON_CAROUSEL_TICK, &dialogdef->items[2], &data); } } @@ -703,7 +703,7 @@ MenuItemHandlerResult mp_challenges_list_handler(s32 operation, struct menuitem s32 size = 11; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = challenge_get_auto_focused_index(g_MpPlayerNum); break; case MENUOP_RENDER: @@ -773,7 +773,7 @@ MenuItemHandlerResult mp_challenges_list_handler(s32 operation, struct menuitem } return (s32) gdl; - case MENUOP_GETOPTIONHEIGHT: + case MENUOP_GET_OPTION_HEIGHT: data->list.value = 26; break; } @@ -1021,7 +1021,7 @@ char *mp_menu_title_stats_for_player_name(struct menudialogdef *dialogdef) MenuItemHandlerResult menuhandler_mp_username_password(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { if (g_PlayerConfigsArray[g_MpPlayerNum].title != MPPLAYERTITLE_PERFECT) { return true; } @@ -1891,10 +1891,10 @@ MenuItemHandlerResult mp_character_head_menu_handler(s32 operation, struct menui }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->carousel.value = mp_get_num_heads2(); break; - case MENUOP_11: + case MENUOP_ON_CAROUSEL_TICK: #if VERSION >= VERSION_PAL_BETA diffframe = g_Menus[g_MpPlayerNum].menumodel.curroty + 0.01f * g_Vars.diffframe60freal; #else @@ -1921,16 +1921,16 @@ MenuItemHandlerResult mp_character_head_menu_handler(s32 operation, struct menui g_Menus[g_MpPlayerNum].menumodel.partvisibility = visibility; g_Menus[g_MpPlayerNum].menumodel.zoom = 30; break; - case MENUOP_21: + case MENUOP_IS_CAROUSEL_OPTION_HIDDEN: if (!challenge_is_feature_unlocked(mp_get_head_required_feature(data->carousel.value))) { return 1; } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->carousel.value = mpheadnum; break; - case MENUOP_SET: - case MENUOP_FOCUS: + case MENUOP_CONFIRM: + case MENUOP_ON_FOCUS: #if VERSION >= VERSION_NTSC_1_0 g_Menus[g_MpPlayerNum].menumodel.loaddelay = 3; #endif @@ -1960,7 +1960,7 @@ MenuItemHandlerResult mp_character_head_menu_handler(s32 operation, struct menui MenuItemHandlerResult menuhandler_mp_character_head(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_PlayerConfigsArray[g_MpPlayerNum].base.mpheadnum = data->carousel.value; } @@ -1983,7 +1983,7 @@ MenuItemHandlerResult mp_player_name_menu_handler(s32 operation, struct menuitem s32 i; switch (operation) { - case MENUOP_GETTEXT: + case MENUOP_GET_KEYBOARD_STRING: i = 0; while (g_PlayerConfigsArray[g_MpPlayerNum].base.name[i] != '\n' @@ -1998,7 +1998,7 @@ MenuItemHandlerResult mp_player_name_menu_handler(s32 operation, struct menuitem i++; } break; - case MENUOP_SETTEXT: + case MENUOP_SET_KEYBOARD_STRING: i = 0; while (i < 11 && name[i] != '\0') { @@ -2022,14 +2022,14 @@ MenuItemHandlerResult mp_player_name_menu_handler(s32 operation, struct menuitem MenuItemHandlerResult mp_load_settings_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = mp_get_num_unlocked_presets(); if (g_FileLists[1] != NULL) { data->list.value += g_FileLists[1]->numfiles; } break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: if (data->list.value < mp_get_num_unlocked_presets()) { return (s32)mp_get_preset_name_by_slot(data->list.value); } @@ -2038,7 +2038,7 @@ MenuItemHandlerResult mp_load_settings_menu_handler(s32 operation, struct menuit return (s32)g_StringPointer; } break; - case MENUOP_SET: + case MENUOP_CONFIRM: mp_close_dialogs_for_new_setup(); if (data->list.value < mp_get_num_unlocked_presets()) { @@ -2061,17 +2061,17 @@ MenuItemHandlerResult mp_load_settings_menu_handler(s32 operation, struct menuit } } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = 0xfffff; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 1; if (g_FileLists[1] != NULL) { data->list.value += g_FileLists[1]->numdevices; } break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: if (data->list.value == 0) { return (s32)lang_get(L_MPMENU_141); // "Presets" } @@ -2079,7 +2079,7 @@ MenuItemHandlerResult mp_load_settings_menu_handler(s32 operation, struct menuit return (s32)filemgr_get_device_name_or_start_index(1, operation, data->list.value - 1); } break; - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: if (data->list.value == 0) { data->list.groupstartindex = 0; } else { @@ -2090,7 +2090,7 @@ MenuItemHandlerResult mp_load_settings_menu_handler(s32 operation, struct menuit } } break; - case MENUOP_LISTITEMFOCUS: + case MENUOP_ON_OPTION_FOCUS: if (data->list.value < mp_get_num_unlocked_presets()) { g_Menus[g_MpPlayerNum].mpsetup.slotindex = 0xffff; } else { @@ -2165,13 +2165,13 @@ MenuItemHandlerResult mp_load_player_menu_handler(s32 operation, struct menuitem } switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = g_FileLists[0]->numfiles; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: filemgr_get_select_name(g_StringPointer, &g_FileLists[0]->files[data->list.value], FILETYPE_MPPLAYER); return (s32)g_StringPointer; - case MENUOP_SET: + case MENUOP_CONFIRM: file = &g_FileLists[0]->files[data->list.value]; available = true; @@ -2197,15 +2197,15 @@ MenuItemHandlerResult mp_load_player_menu_handler(s32 operation, struct menuitem filemgr_push_error_dialog(FILEERROR_ALREADYLOADED); } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = 0xfffff; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = g_FileLists[0]->numdevices; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return filemgr_get_device_name_or_start_index(0, operation, data->list.value); - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: data->list.groupstartindex = filemgr_get_device_name_or_start_index(0, operation, data->list.value); return 0; } @@ -2216,13 +2216,13 @@ MenuItemHandlerResult mp_load_player_menu_handler(s32 operation, struct menuitem MenuItemHandlerResult menuhandler_mp_time_limit_slider(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETSLIDER: + case MENUOP_GET_SLIDER_VALUE: data->slider.value = g_MpSetup.timelimit; break; - case MENUOP_SET: + case MENUOP_CONFIRM: g_MpSetup.timelimit = data->slider.value; break; - case MENUOP_GETSLIDERLABEL: + case MENUOP_GET_SLIDER_LABEL: if (data->slider.value == 60) { sprintf(data->slider.label, lang_get(L_MPMENU_112)); // "No Limit" } else { @@ -2235,13 +2235,13 @@ MenuItemHandlerResult menuhandler_mp_time_limit_slider(s32 operation, struct men MenuItemHandlerResult menuhandler_mp_score_limit_slider(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETSLIDER: + case MENUOP_GET_SLIDER_VALUE: data->slider.value = g_MpSetup.scorelimit; break; - case MENUOP_SET: + case MENUOP_CONFIRM: g_MpSetup.scorelimit = data->slider.value; break; - case MENUOP_GETSLIDERLABEL: + case MENUOP_GET_SLIDER_LABEL: if (data->slider.value == 100) { sprintf(data->slider.label, lang_get(L_MPMENU_112)); // "No Limit" } else { @@ -2255,13 +2255,13 @@ MenuItemHandlerResult menuhandler_mp_score_limit_slider(s32 operation, struct me MenuItemHandlerResult menuhandler_mp_team_score_limit_slider(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETSLIDER: + case MENUOP_GET_SLIDER_VALUE: data->slider.value = mp_calculate_team_score_limit(); break; - case MENUOP_SET: + case MENUOP_CONFIRM: g_MpSetup.teamscorelimit = data->slider.value; break; - case MENUOP_GETSLIDERLABEL: + case MENUOP_GET_SLIDER_LABEL: if (data->slider.value == 400) { sprintf(data->slider.label, lang_get(L_MPMENU_112)); // "No Limit" } else { @@ -2274,7 +2274,7 @@ MenuItemHandlerResult menuhandler_mp_team_score_limit_slider(s32 operation, stru MenuItemHandlerResult menuhandler_mp_restore_score_defaults(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { mp_init_limits(); } @@ -2284,18 +2284,18 @@ MenuItemHandlerResult menuhandler_mp_restore_score_defaults(s32 operation, struc MenuItemHandlerResult menuhandler_mp_handicap_player(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_HIDDEN: if ((g_MpSetup.chrslots & (1 << item->param)) == 0) { return 1; } break; - case MENUOP_GETSLIDER: + case MENUOP_GET_SLIDER_VALUE: data->slider.value = g_PlayerConfigsArray[item->param].handicap; break; - case MENUOP_SET: + case MENUOP_CONFIRM: g_PlayerConfigsArray[item->param].handicap = (u16)data->slider.value; break; - case MENUOP_GETSLIDERLABEL: + case MENUOP_GET_SLIDER_LABEL: sprintf(data->slider.label, "%s%s%.00f%%\n", "", "", mp_handicap_to_value(g_PlayerConfigsArray[item->param].handicap) * 100); break; } @@ -2314,7 +2314,7 @@ char *mp_menu_text_handicap_player_name(struct menuitem *item) MenuItemHandlerResult menuhandler_mp_restore_handicap_defaults(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { s32 i; for (i = 0; i < MAX_PLAYERS; i++) { @@ -2327,7 +2327,7 @@ MenuItemHandlerResult menuhandler_mp_restore_handicap_defaults(s32 operation, st MenuDialogHandlerResult menudialog_mp_ready(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { if (g_PlayerConfigsArray[g_MpPlayerNum].fileguid.fileid && g_PlayerConfigsArray[g_MpPlayerNum].fileguid.deviceserial) { filemgr_save_or_load(&g_PlayerConfigsArray[g_MpPlayerNum].fileguid, FILEOP_SAVE_MPPLAYER, g_MpPlayerNum); } @@ -2338,7 +2338,7 @@ MenuDialogHandlerResult menudialog_mp_ready(s32 operation, struct menudialogdef MenuDialogHandlerResult menudialog_mp_simulant(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_TICK) { if ((u8)g_BotConfigsArray[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.name[0] == '\0') { menu_pop_dialog(); } @@ -2380,7 +2380,7 @@ struct menudialogdef g_MpCharacterMenuDialog = { L_MPMENU_143, // "Character" g_MpCharacterMenuItems, menudialog_mp_human_character, - MENUDIALOGFLAG_0002, + MENUDIALOGFLAG_ALLOW_MODELS, NULL, }; @@ -2678,7 +2678,7 @@ MenuItemHandlerResult mp_add_change_simulant_menu_handler(s32 operation, struct bool creating; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: for (i = 0; i < ARRAYCOUNT(g_BotProfiles); i++) { if (challenge_is_feature_unlocked(g_BotProfiles[i].requirefeature)) { count++; @@ -2687,7 +2687,7 @@ MenuItemHandlerResult mp_add_change_simulant_menu_handler(s32 operation, struct data->list.value = count; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: for (i = 0; i < ARRAYCOUNT(g_BotProfiles); i++) { if (challenge_is_feature_unlocked(g_BotProfiles[i].requirefeature)) { if (count == data->list.value) { @@ -2698,7 +2698,7 @@ MenuItemHandlerResult mp_add_change_simulant_menu_handler(s32 operation, struct } } break; - case MENUOP_SET: + case MENUOP_CONFIRM: botnum = g_Menus[g_MpPlayerNum].mpsetup.slotindex; creating = false; @@ -2732,7 +2732,7 @@ MenuItemHandlerResult mp_add_change_simulant_menu_handler(s32 operation, struct mp_generate_bot_names(); g_Menus[g_MpPlayerNum].mpsetup.slotcount = data->list.value; break; - case MENUOP_LISTITEMFOCUS: + case MENUOP_ON_OPTION_FOCUS: for (i = 0; i < ARRAYCOUNT(g_BotProfiles); i++) { if (challenge_is_feature_unlocked(g_BotProfiles[i].requirefeature)) { if (count == data->list.value) { @@ -2745,15 +2745,15 @@ MenuItemHandlerResult mp_add_change_simulant_menu_handler(s32 operation, struct g_Menus[g_MpPlayerNum].mpsetup.botprofileindex = i; // fall-through - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = g_Menus[g_MpPlayerNum].mpsetup.slotcount; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 2; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return (s32)lang_get(groups[data->list.value].name); - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: for (i = 0; i < groups[data->list.value].offset; i++) { if (challenge_is_feature_unlocked(g_BotProfiles[i].requirefeature)) { count++; @@ -2784,13 +2784,13 @@ MenuItemHandlerResult menuhandler_mp_simulant_head(s32 operation, struct menuite /** * Rare developers forgot to add a break statement to the first case, * and when they noticed a problem their fix was to add an additional - * MENUOP_FOCUS check in the next case. + * MENUOP_ON_FOCUS check in the next case. */ switch (operation) { - case MENUOP_SET: + case MENUOP_CONFIRM: g_BotConfigsArray[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.mpheadnum = start + data->carousel.value; - case MENUOP_FOCUS: - if (operation == MENUOP_FOCUS + case MENUOP_ON_FOCUS: + if (operation == MENUOP_ON_FOCUS && item->param2 == 1 && g_BotConfigsArray[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.mpheadnum < start) { g_BotConfigsArray[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.mpheadnum = start; @@ -2803,7 +2803,7 @@ MenuItemHandlerResult menuhandler_mp_simulant_head(s32 operation, struct menuite MenuItemHandlerResult menuhandler_mp_simulant_body(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_BotConfigsArray[g_Menus[g_MpPlayerNum].mpsetup.slotindex].base.mpbodynum = data->carousel.value; } @@ -2816,12 +2816,12 @@ MenuItemHandlerResult menuhandler_mp_simulant_body(s32 operation, struct menuite MenuDialogHandlerResult menudialog_mp_bot_character(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { switch (operation) { - case MENUOP_TICK: + case MENUOP_ON_TICK: if (g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef && g_Menus[g_MpPlayerNum].curdialog->focuseditem != &dialogdef->items[0] && g_Menus[g_MpPlayerNum].curdialog->focuseditem != &dialogdef->items[1]) { union handlerdata data; - menuhandler_mp_character_body(MENUOP_11, &dialogdef->items[1], &data); + menuhandler_mp_character_body(MENUOP_ON_CAROUSEL_TICK, &dialogdef->items[1], &data); } } @@ -2834,11 +2834,11 @@ MenuItemHandlerResult mp_bot_difficulty_menu_handler(s32 operation, struct menui s32 i; switch (operation) { - case MENUOP_SET: + case MENUOP_CONFIRM: mp_set_bot_difficulty(g_Menus[g_MpPlayerNum].mpsetup.slotindex, data->dropdown.value); mp_generate_bot_names(); break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: if (g_BotConfigsArray[g_Menus[g_MpPlayerNum].mpsetup.slotindex].difficulty >= 0 && g_BotConfigsArray[g_Menus[g_MpPlayerNum].mpsetup.slotindex].difficulty < BOTDIFF_DISABLED) { data->dropdown.value = g_BotConfigsArray[g_Menus[g_MpPlayerNum].mpsetup.slotindex].difficulty; @@ -2846,7 +2846,7 @@ MenuItemHandlerResult mp_bot_difficulty_menu_handler(s32 operation, struct menui data->dropdown.value = 0; } break; - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: for (i = 0; i < BOTDIFF_DISABLED; i++) { if (challenge_is_feature_unlocked(g_BotProfiles[i].requirefeature)) { count++; @@ -2855,7 +2855,7 @@ MenuItemHandlerResult mp_bot_difficulty_menu_handler(s32 operation, struct menui data->dropdown.value = count; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: for (i = 0; i < BOTDIFF_DISABLED; i++) { if (challenge_is_feature_unlocked(g_BotProfiles[i].requirefeature)) { if (count == data->dropdown.value) { @@ -2875,7 +2875,7 @@ MenuItemHandlerResult mp_bot_difficulty_menu_handler(s32 operation, struct menui MenuItemHandlerResult menuhandler_mp_delete_simulant(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { mp_remove_simulant(g_Menus[g_MpPlayerNum].mpsetup.slotindex); menu_pop_dialog(); } @@ -2891,7 +2891,7 @@ char *mp_menu_title_edit_simulant(struct menudialogdef *dialogdef) MenuItemHandlerResult menuhandler_mp_change_simulant_type(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { s32 i; s32 count = 0; s32 profilenum = mp_find_bot_profile( @@ -2914,7 +2914,7 @@ MenuItemHandlerResult menuhandler_mp_change_simulant_type(s32 operation, struct MenuItemHandlerResult menuhandler_mp_clear_all_simulants(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { s32 i; for (i = 0; i < MAX_BOTS; i++) { mp_remove_simulant(i); @@ -2927,11 +2927,11 @@ MenuItemHandlerResult menuhandler_mp_clear_all_simulants(s32 operation, struct m MenuItemHandlerResult menuhandler_mp_add_simulant(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_SET: + case MENUOP_CONFIRM: g_Menus[g_MpPlayerNum].mpsetup.slotindex = -1; menu_push_dialog(&g_MpAddSimulantMenuDialog); break; - case MENUOP_CHECKDISABLED: + case MENUOP_IS_DISABLED: if (mp_has_unused_bot_slots() == 0) { return true; } @@ -2943,7 +2943,7 @@ MenuItemHandlerResult menuhandler_mp_add_simulant(s32 operation, struct menuitem MenuItemHandlerResult menuhandler_mp_simulant_slot(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_SET: + case MENUOP_CONFIRM: g_Menus[g_MpPlayerNum].mpsetup.slotindex = item->param; if ((g_MpSetup.chrslots & (1 << (item->param + 4))) == 0) { @@ -2954,12 +2954,12 @@ MenuItemHandlerResult menuhandler_mp_simulant_slot(s32 operation, struct menuite menu_push_dialog(&g_MpEditSimulantMenuDialog); } break; - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_HIDDEN: if (item->param >= 4 && !challenge_is_feature_unlocked(MPFEATURE_8BOTS)) { return true; } break; - case MENUOP_CHECKDISABLED: + case MENUOP_IS_DISABLED: if (!mp_is_sim_slot_enabled(item->param)) { return true; } @@ -2993,7 +2993,7 @@ char *mp_menu_text_simulant_num(struct menuitem *item) MenuDialogHandlerResult menudialog_mp_simulants(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { g_Menus[g_MpPlayerNum].mpsetup.slotcount = 0; } @@ -3063,7 +3063,7 @@ struct menudialogdef g_MpSimulantCharacterMenuDialog = { L_MPMENU_100, // "Simulant Character" g_MpSimulantCharacterMenuItems, menudialog_mp_bot_character, - MENUDIALOGFLAG_0002 | MENUDIALOGFLAG_MPLOCKABLE, + MENUDIALOGFLAG_ALLOW_MODELS | MENUDIALOGFLAG_MPLOCKABLE, NULL, }; @@ -3247,7 +3247,7 @@ struct menudialogdef g_MpSimulantsMenuDialog = { MenuItemHandlerResult menuhandler_mp_n_teams(s32 operation, struct menuitem *item, union handlerdata *data, s32 numteams) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { s32 numchrs = mp_get_num_chrs(); s32 array[] = {0, 0, 0, 0}; s32 somevalue = (numchrs + numteams - 1) / numteams; @@ -3340,7 +3340,7 @@ MenuItemHandlerResult menuhandler_mp_four_teams(s32 operation, struct menuitem * MenuItemHandlerResult menuhandler_mp_maximum_teams(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { s32 i; u8 team = 0; @@ -3364,7 +3364,7 @@ MenuItemHandlerResult menuhandler_mp_maximum_teams(s32 operation, struct menuite MenuItemHandlerResult menuhandler_mp_humans_vs_simulants(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { s32 i; for (i = 0; i != MAX_MPCHRS; i++) { @@ -3383,7 +3383,7 @@ MenuItemHandlerResult menuhandler_mp_humans_vs_simulants(s32 operation, struct m MenuItemHandlerResult menuhandler_mp_human_simulant_pairs(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { u8 team_ids[4] = {0, 1, 2, 3}; s32 i; s32 playerindex = 0; @@ -3425,10 +3425,10 @@ char *mp_menu_text_chr_name_for_team_setup(struct menuitem *item) MenuItemHandlerResult menuhandler_mp_team_slot2(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = scenario_get_max_teams(); break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: if ((g_MpSetup.options & MPOPTION_TEAMSENABLED) == 0) { return (s32) "\n"; } @@ -3444,11 +3444,11 @@ MenuItemHandlerResult menuhandler_mp_team_slot(s32 operation, struct menuitem *i struct mpchrconfig *mpchr; switch (operation) { - case MENUOP_SET: + case MENUOP_CONFIRM: mpchr = mp_get_chr_config_by_slot_num(item->param); mpchr->team = data->dropdown.value; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: mpchr = mp_get_chr_config_by_slot_num(item->param); if (!mpchr) { @@ -3458,7 +3458,7 @@ MenuItemHandlerResult menuhandler_mp_team_slot(s32 operation, struct menuitem *i } break; - case MENUOP_CHECKDISABLED: + case MENUOP_IS_DISABLED: mpchr = mp_get_chr_config_by_slot_num(item->param); if (!mpchr) { @@ -3848,7 +3848,7 @@ u32 var80085ce8[] = { MenuItemHandlerResult mp_select_tune_list_handler(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = mp_get_num_unlocked_tracks(); if (mp_get_using_multiple_tunes()) { @@ -3857,7 +3857,7 @@ MenuItemHandlerResult mp_select_tune_list_handler(s32 operation, struct menuitem data->list.value++; } break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: { s32 numtracks = mp_get_num_unlocked_tracks(); @@ -3871,7 +3871,7 @@ MenuItemHandlerResult mp_select_tune_list_handler(s32 operation, struct menuitem return (s32) lang_get(var80085ce8[data->list.value - numtracks]); } - case MENUOP_SET: + case MENUOP_CONFIRM: { s32 numtracks = mp_get_num_unlocked_tracks(); @@ -3903,7 +3903,7 @@ MenuItemHandlerResult mp_select_tune_list_handler(s32 operation, struct menuitem } } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: if (mp_get_using_multiple_tunes()) { data->list.value = 0x000fffff; } else { @@ -3916,12 +3916,12 @@ MenuItemHandlerResult mp_select_tune_list_handler(s32 operation, struct menuitem } } break; - case MENUOP_LISTITEMFOCUS: + case MENUOP_ON_OPTION_FOCUS: if (data->list.value < mp_get_num_unlocked_tracks()) { music_start_track_as_menu(mp_get_track_music_num(data->list.value)); } break; - case MENUOP_GETLISTITEMCHECKBOX: + case MENUOP_IS_OPTION_CHECKED: { s32 numtracks = mp_get_num_unlocked_tracks(); @@ -3937,11 +3937,11 @@ MenuItemHandlerResult mp_select_tune_list_handler(s32 operation, struct menuitem MenuDialogHandlerResult menudialog_mp_select_tune(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { g_MusicInterval240 = 80; } - if (operation == MENUOP_CLOSE) { + if (operation == MENUOP_ON_CLOSE) { g_MusicInterval240 = 15; } @@ -3968,9 +3968,9 @@ char *mp_menu_text_current_track(struct menuitem *item) MenuItemHandlerResult menuhandler_mp_multiple_tunes(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GET: + case MENUOP_IS_CHECKED: return mp_get_using_multiple_tunes(); - case MENUOP_SET: + case MENUOP_CONFIRM: mp_set_using_multiple_tunes(data->checkbox.value); g_Vars.modifiedfiles |= MODFILE_MPSETUP; } @@ -3984,7 +3984,7 @@ MenuItemHandlerResult mp_team_name_menu_handler(s32 operation, struct menuitem * s32 i; switch (operation) { - case MENUOP_GETTEXT: + case MENUOP_GET_KEYBOARD_STRING: i = 0; while (g_BossFile.teamnames[g_Menus[g_MpPlayerNum].mpsetup.slotindex][i] != '\n' @@ -3999,7 +3999,7 @@ MenuItemHandlerResult mp_team_name_menu_handler(s32 operation, struct menuitem * i++; } break; - case MENUOP_SETTEXT: + case MENUOP_SET_KEYBOARD_STRING: i = 0; while (i < 11 && name[i] != '\0') { @@ -4037,7 +4037,7 @@ char *mp_menu_text_team_name(struct menuitem *item) MenuItemHandlerResult menuhandler_mp_team_name_slot(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_Menus[g_MpPlayerNum].mpsetup.slotindex = item->param2 - 0x5608; menu_push_dialog(&g_MpChangeTeamNameMenuDialog); } @@ -4056,7 +4056,7 @@ char *menutext_mp_challenge_name(struct menudialogdef *dialogdef) */ MenuItemHandlerResult menuhandler_mp_accept_challenge(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { #if VERSION >= VERSION_NTSC_1_0 challenge_unset_current(); #endif @@ -4071,7 +4071,7 @@ MenuItemHandlerResult menuhandler_mp_accept_challenge(s32 operation, struct menu MenuDialogHandlerResult menudialog_mp_confirm_challenge(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: g_Menus[g_MpPlayerNum].menumodel.curparams = 0; g_Menus[g_MpPlayerNum].training.mpconfig = challenge_load_by_slot( @@ -4079,9 +4079,9 @@ MenuDialogHandlerResult menudialog_mp_confirm_challenge(s32 operation, struct me g_Menus[g_MpPlayerNum].menumodel.allocstart, g_Menus[g_MpPlayerNum].menumodel.alloclen); break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: break; - case MENUOP_TICK: + case MENUOP_ON_TICK: if (g_BossFile.locktype == MPLOCKTYPE_CHALLENGE) { menu_pop_dialog(); } @@ -4487,15 +4487,15 @@ MenuItemHandlerResult mp_challenges_list_menu_handler(s32 operation, struct menu s32 i; switch (operation) { - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_HIDDEN: if (g_BossFile.locktype == MPLOCKTYPE_CHALLENGE) { return 1; } break; - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = challenge_get_num_available(); break; - case MENUOP_SET: + case MENUOP_CONFIRM: if (data->list.unk04 != 0) { data->list.unk04 = 2; } @@ -4510,15 +4510,15 @@ MenuItemHandlerResult mp_challenges_list_menu_handler(s32 operation, struct menu menu_push_dialog(&g_MpConfirmChallengeMenuDialog); } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = 0xfffff; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 0; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return 0; - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: data->list.groupstartindex = 0; break; case MENUOP_RENDER: @@ -4578,7 +4578,7 @@ MenuItemHandlerResult mp_challenges_list_menu_handler(s32 operation, struct menu marginleft += 13; } return (s32)gdl; - case MENUOP_GETOPTIONHEIGHT: + case MENUOP_GET_OPTION_HEIGHT: data->list.value = 26; break; } @@ -4592,7 +4592,7 @@ MenuItemHandlerResult mp_challenges_list_menu_handler(s32 operation, struct menu */ MenuItemHandlerResult menuhandler_mp_challenge_description_and_separator(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { if (g_BossFile.locktype != MPLOCKTYPE_CHALLENGE) { return true; } @@ -4603,13 +4603,13 @@ MenuItemHandlerResult menuhandler_mp_challenge_description_and_separator(s32 ope MenuItemHandlerResult menuhandler_mp_abort_challenge(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { if (g_BossFile.locktype != MPLOCKTYPE_CHALLENGE) { return true; } } - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { challenge_remove_player_lock(); } @@ -4618,12 +4618,12 @@ MenuItemHandlerResult menuhandler_mp_abort_challenge(s32 operation, struct menui MenuItemHandlerResult menuhandler_mp_start_challenge(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { if (g_BossFile.locktype != MPLOCKTYPE_CHALLENGE) { return true; } } - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { menu_push_dialog(&g_MpReadyMenuDialog); } @@ -4644,7 +4644,7 @@ char *mp_menu_text_challenge_name(struct menuitem *item) MenuDialogHandlerResult mp_combat_challenges_menu_dialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_TICK) { + if (operation == MENUOP_ON_TICK) { if (g_BossFile.locktype == MPLOCKTYPE_CHALLENGE && g_Menus[g_MpPlayerNum].curdialog && g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef @@ -4657,7 +4657,7 @@ MenuDialogHandlerResult mp_combat_challenges_menu_dialog(s32 operation, struct m } } - if (operation == MENUOP_CLOSE) { + if (operation == MENUOP_ON_CLOSE) { if (g_Menus[g_MpPlayerNum].menumodel.curparams == 0x4fac5ace) { challenge_unset_current(); } @@ -4668,7 +4668,7 @@ MenuDialogHandlerResult mp_combat_challenges_menu_dialog(s32 operation, struct m MenuItemHandlerResult menuhandler_mp_accept_challenge2(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { challenge_set_current_by_slot(g_Menus[g_MpPlayerNum].mpsetup.slotindex); menu_save_and_push_root_dialog(&g_MpQuickGoMenuDialog, MENUROOT_MPSETUP); } @@ -4707,10 +4707,10 @@ MenuItemHandlerResult menuhandler_mp_lock(s32 operation, struct menuitem *item, }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = mp_get_lock_type() == MPLOCKTYPE_CHALLENGE ? 1 : 5; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: if (mp_get_lock_type() == MPLOCKTYPE_CHALLENGE) { return (s32) lang_get(L_MPMENU_049); // "Challenge" } @@ -4721,13 +4721,13 @@ MenuItemHandlerResult menuhandler_mp_lock(s32 operation, struct menuitem *item, return (s32) g_PlayerConfigsArray[mp_get_lock_player_num()].base.name; } return (s32) mp_get_current_player_name(item); - case MENUOP_SET: + case MENUOP_CONFIRM: if (mp_get_lock_type() != MPLOCKTYPE_CHALLENGE) { mp_set_lock(data->dropdown.value, g_MpPlayerNum); } g_Vars.modifiedfiles |= MODFILE_MPSETUP; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = mp_get_lock_type() == MPLOCKTYPE_CHALLENGE ? 0 : mp_get_lock_type(); break; } @@ -4737,7 +4737,7 @@ MenuItemHandlerResult menuhandler_mp_lock(s32 operation, struct menuitem *item, MenuItemHandlerResult menuhandler_mp_save_player(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { if (g_PlayerConfigsArray[g_MpPlayerNum].fileguid.fileid == 0) { filemgr_push_select_location_dialog(6, FILETYPE_MPPLAYER); } else { @@ -4759,7 +4759,7 @@ char *mp_menu_text_save_player_or_copy(struct menuitem *item) MenuItemHandlerResult menuhandler_mp_abort_setup(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { if (g_Vars.stagenum == STAGE_CITRAINING) { if (IS4MB()) { menu_save_and_push_root_dialog(&g_CiMenuViaPauseMenuDialog, MENUROOT_MAINMENU); @@ -4776,7 +4776,7 @@ MenuItemHandlerResult menuhandler_mp_abort_setup(s32 operation, struct menuitem MenuItemHandlerResult menuhandler_mp_save_settings(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { if (g_MpSetup.fileguid.fileid == 0) { menu_push_dialog(&g_MpSaveSetupNameMenuDialog); } else { @@ -4811,7 +4811,7 @@ char *mp_menu_text_weapon_set_name(struct menuitem *item) MenuDialogHandlerResult menudialog_mp_game_setup(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { g_Vars.mpsetupmenu = MPSETUPMENU_ADVSETUP; g_Vars.usingadvsetup = true; } @@ -4821,7 +4821,7 @@ MenuDialogHandlerResult menudialog_mp_game_setup(s32 operation, struct menudialo MenuDialogHandlerResult menudialog_mp_quick_go(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { g_Vars.mpsetupmenu = MPSETUPMENU_QUICKGO; } @@ -4946,12 +4946,12 @@ void mp_apply_quickstart(void) MenuItemHandlerResult menuhandler_mp_finished_setup(s32 operation, struct menuitem *item, union handlerdata *data) { #if VERSION >= VERSION_NTSC_1_0 - if (operation == MENUOP_CHECKPREFOCUSED) { + if (operation == MENUOP_IS_PREFOCUSED) { return true; } #endif - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { mp_apply_quickstart(); } @@ -4960,7 +4960,7 @@ MenuItemHandlerResult menuhandler_mp_finished_setup(s32 operation, struct menuit MenuItemHandlerResult menuhandler_quick_team_separator(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_CHECKHIDDEN) { + if (operation == MENUOP_IS_HIDDEN) { if (g_Vars.mpquickteam == MPQUICKTEAM_PLAYERSONLY) { return true; } @@ -4972,19 +4972,19 @@ MenuItemHandlerResult menuhandler_quick_team_separator(s32 operation, struct men MenuItemHandlerResult menuhandler_player_team(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: #if VERSION >= VERSION_JPN_FINAL data->dropdown.value = scenario_get_max_teams(); #else data->dropdown.value = MAX_TEAMS; #endif break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) &g_BossFile.teamnames[data->dropdown.value]; - case MENUOP_SET: + case MENUOP_CONFIRM: g_Vars.mpplayerteams[item->param] = data->dropdown.value; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: #if VERSION >= VERSION_JPN_FINAL if (g_Vars.mpplayerteams[item->param] >= scenario_get_max_teams()) { g_Vars.mpplayerteams[item->param] %= scenario_get_max_teams(); @@ -4992,7 +4992,7 @@ MenuItemHandlerResult menuhandler_player_team(s32 operation, struct menuitem *it #endif data->dropdown.value = g_Vars.mpplayerteams[item->param]; break; - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_HIDDEN: if (g_Vars.mpquickteam != MPQUICKTEAM_PLAYERSTEAMS) { return true; } @@ -5005,19 +5005,19 @@ MenuItemHandlerResult menuhandler_player_team(s32 operation, struct menuitem *it MenuItemHandlerResult menuhandler_mp_number_of_simulants(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = !challenge_is_feature_unlocked(MPFEATURE_8BOTS) ? 4 : MAX_BOTS; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: sprintf(g_StringPointer, "%d\n", data->dropdown.value + 1); return (s32) g_StringPointer; - case MENUOP_SET: + case MENUOP_CONFIRM: g_Vars.mpquickteamnumsims = data->dropdown.value + 1; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = g_Vars.mpquickteamnumsims - 1; break; - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_HIDDEN: if (g_Vars.mpquickteam != MPQUICKTEAM_PLAYERSANDSIMS && g_Vars.mpquickteam != MPQUICKTEAM_PLAYERSVSSIMS) { return true; @@ -5031,19 +5031,19 @@ MenuItemHandlerResult menuhandler_mp_number_of_simulants(s32 operation, struct m MenuItemHandlerResult menuhandler_mp_simulants_per_team(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = 2; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: sprintf(g_StringPointer, "%d\n", data->dropdown.value + 1); return (s32) g_StringPointer; - case MENUOP_SET: + case MENUOP_CONFIRM: g_Vars.unk0004a0 = data->dropdown.value + 1; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = g_Vars.unk0004a0 - 1; break; - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_HIDDEN: if (g_Vars.mpquickteam != MPQUICKTEAM_PLAYERSIMTEAMS) { return true; } @@ -5059,7 +5059,7 @@ MenuItemHandlerResult mp_quick_team_simulant_difficulty_handler(s32 operation, s s32 i; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: for (i = 0; i < NUM_BOTDIFFS; i++) { if (challenge_is_feature_unlocked(g_BotProfiles[i].requirefeature)) { count++; @@ -5068,7 +5068,7 @@ MenuItemHandlerResult mp_quick_team_simulant_difficulty_handler(s32 operation, s data->dropdown.value = count; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: for (i = 0; i < NUM_BOTDIFFS; i++) { if (challenge_is_feature_unlocked(g_BotProfiles[i].requirefeature)) { if (count == data->dropdown.value) { @@ -5079,13 +5079,13 @@ MenuItemHandlerResult mp_quick_team_simulant_difficulty_handler(s32 operation, s } } break; - case MENUOP_SET: + case MENUOP_CONFIRM: g_Vars.mpsimdifficulty = data->dropdown.value; break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = g_Vars.mpsimdifficulty; break; - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_HIDDEN: if (g_Vars.mpquickteam != MPQUICKTEAM_PLAYERSANDSIMS && g_Vars.mpquickteam != MPQUICKTEAM_PLAYERSVSSIMS && g_Vars.mpquickteam != MPQUICKTEAM_PLAYERSIMTEAMS) { @@ -5098,7 +5098,7 @@ MenuItemHandlerResult mp_quick_team_simulant_difficulty_handler(s32 operation, s MenuItemHandlerResult menuhandler_mp_quick_team_option(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { g_Vars.mpquickteam = item->param; if (mp_get_weaponset_slotnum() >= mp_get_num_weaponset_slots(false)) { @@ -5121,7 +5121,7 @@ MenuItemHandlerResult menuhandler_mp_quick_team_option(s32 operation, struct men MenuDialogHandlerResult menudialog_combat_simulator(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_OPEN) { + if (operation == MENUOP_ON_OPEN) { g_Vars.waitingtojoin[0] = false; g_Vars.waitingtojoin[1] = false; g_Vars.waitingtojoin[2] = false; @@ -5130,7 +5130,7 @@ MenuDialogHandlerResult menudialog_combat_simulator(s32 operation, struct menudi if (g_Menus[g_MpPlayerNum].curdialog && g_Menus[g_MpPlayerNum].curdialog->definition == &g_CombatSimulatorMenuDialog - && operation == MENUOP_TICK) { + && operation == MENUOP_ON_TICK) { g_Vars.mpsetupmenu = MPSETUPMENU_GENERAL; g_Vars.mpquickteam = MPQUICKTEAM_NONE; g_Vars.usingadvsetup = false; @@ -5143,7 +5143,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) { + if (operation == MENUOP_CONFIRM) { menu_save_and_push_root_dialog(&g_MpAdvancedSetupMenuDialog, MENUROOT_MPSETUP); } diff --git a/src/game/trainingmenus.c b/src/game/trainingmenus.c index c63bdb839..18b9c1d48 100644 --- a/src/game/trainingmenus.c +++ b/src/game/trainingmenus.c @@ -35,9 +35,9 @@ MenuItemHandlerResult fr_details_ok_menu_handler(s32 operation, struct menuitem s32 i; switch (operation) { - case MENUOP_CHECKPREFOCUSED: + case MENUOP_IS_PREFOCUSED: return true; - case MENUOP_SET: + case MENUOP_CONFIRM: if (fr_is_in_training() == false) { s32 weapon = fr_get_weapon_by_slot(fr_get_slot()); @@ -74,7 +74,7 @@ MenuItemHandlerResult fr_details_ok_menu_handler(s32 operation, struct menuitem MenuItemHandlerResult fr_abort_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { if (fr_is_in_training()) { fr_end_session(true); } @@ -99,23 +99,23 @@ MenuItemHandlerResult fr_weapon_list_menu_handler(s32 operation, struct menuitem s32 y; switch (operation) { - case MENUOP_GETOPTIONHEIGHT: + case MENUOP_GET_OPTION_HEIGHT: data->list.value = LINEHEIGHT; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 0; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return 0; - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: data->list.groupstartindex = 0; break; - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = fr_get_num_weapons_available(); break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return 0; - case MENUOP_SET: + case MENUOP_CONFIRM: weaponnum = fr_get_weapon_by_slot(data->list.value); score = fr_get_score(fr_weaponnum_to_frweaponnum(weaponnum)); @@ -137,7 +137,7 @@ MenuItemHandlerResult fr_weapon_list_menu_handler(s32 operation, struct menuitem menu_push_dialog(&g_FrTrainingInfoPreGameMenuDialog); } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = fr_get_slot(); break; case MENUOP_RENDER: @@ -218,7 +218,7 @@ MenuDialogHandlerResult fr_training_info_menu_dialog(s32 operation, struct menud s32 weaponnum; switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: weaponnum = fr_get_weapon_by_slot(fr_get_slot()); g_Menus[g_MpPlayerNum].training.weaponnum = weaponnum; mainmenu_prepare_weapon_menumodel(weaponnum); @@ -227,14 +227,14 @@ MenuDialogHandlerResult fr_training_info_menu_dialog(s32 operation, struct menud fr_init_ammo(weaponnum); } break; - case MENUOP_TICK: + case MENUOP_ON_TICK: if (g_Menus[g_MpPlayerNum].curdialog && g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef) { g_Menus[g_MpPlayerNum].menumodel.zoomtimer60 -= g_Vars.diffframe60; g_Menus[g_MpPlayerNum].menumodel.curroty = g_Menus[g_MpPlayerNum].menumodel.newroty = 18.849555969238f * g_20SecIntervalFrac; g_Menus[g_MpPlayerNum].menumodel.currotz = g_Menus[g_MpPlayerNum].menumodel.newrotz = 0; } break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: if (!fr_is_in_training()) { fr_end_session(true); } @@ -246,7 +246,7 @@ MenuDialogHandlerResult fr_training_info_menu_dialog(s32 operation, struct menud MenuDialogHandlerResult fr_training_stats_menu_dialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_CLOSE) { + if (operation == MENUOP_ON_CLOSE) { if (fr_is_in_training() == false) { fr_end_session(true); } @@ -268,20 +268,20 @@ MenuItemHandlerResult fr_difficulty_dropdown_menu_handler(s32 operation, struct }; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->dropdown.value = fr_get_score(fr_get_slot()) + 1; if (data->dropdown.value > 3) { data->dropdown.value = 3; } break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) lang_get(names[data->dropdown.value]); - case MENUOP_SET: + case MENUOP_CONFIRM: fr_set_difficulty(data->dropdown.value); menu_push_dialog(&g_FrTrainingInfoPreGameMenuDialog); break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->dropdown.value = fr_get_difficulty(); break; } @@ -292,16 +292,16 @@ MenuItemHandlerResult fr_difficulty_dropdown_menu_handler(s32 operation, struct MenuItemHandlerResult fr_difficulty_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_CHECKHIDDEN: + case MENUOP_IS_HIDDEN: if (fr_get_score(fr_weaponnum_to_frweaponnum(fr_get_weapon_by_slot(fr_get_slot()))) < item->param) { return true; } break; - case MENUOP_SET: + case MENUOP_CONFIRM: fr_set_difficulty(item->param); menu_push_dialog(&g_FrTrainingInfoPreGameMenuDialog); break; - case MENUOP_CHECKPREFOCUSED: + case MENUOP_IS_PREFOCUSED: if (fr_get_score(fr_weaponnum_to_frweaponnum(fr_get_weapon_by_slot(fr_get_slot()))) >= item->param) { return true; } @@ -882,7 +882,7 @@ MenuItemHandlerResult fr_scoring_menu_handler(s32 operation, struct menuitem *it #if VERSION >= VERSION_NTSC_1_0 MenuItemHandlerResult menuhandler_fr_failed_continue(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { if (g_Vars.currentplayer->prop->rooms[0] == 0xa) { menu_replace_current_dialog(&g_FrWeaponListMenuDialog); } else { @@ -1065,7 +1065,7 @@ struct menudialogdef g_FrTrainingInfoInGameMenuDialog = { L_MPMENU_447, // "Training Info" g_FrTrainingInfoInGameMenuItems, fr_training_info_menu_dialog, - MENUDIALOGFLAG_0002 | MENUDIALOGFLAG_DISABLERESIZE | MENUDIALOGFLAG_0400, + MENUDIALOGFLAG_ALLOW_MODELS | MENUDIALOGFLAG_DISABLERESIZE | MENUDIALOGFLAG_NOVERTICALBORDERS, NULL, }; @@ -1158,7 +1158,7 @@ struct menudialogdef g_FrTrainingInfoPreGameMenuDialog = { L_MPMENU_447, // "Training Info" g_FrTrainingInfoPreGameMenuItems, fr_training_info_menu_dialog, - MENUDIALOGFLAG_0002 | MENUDIALOGFLAG_DISABLERESIZE | MENUDIALOGFLAG_0400, + MENUDIALOGFLAG_ALLOW_MODELS | MENUDIALOGFLAG_DISABLERESIZE | MENUDIALOGFLAG_NOVERTICALBORDERS, NULL, }; @@ -1429,10 +1429,10 @@ MenuItemHandlerResult ci_office_information_menu_handler(s32 operation, struct m groups[1].offset = numunlockedchrbios; switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = numunlockedchrbios + numunlockedmiscbios; break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: if (data->list.value < numunlockedchrbios) { chrbio = ci_get_chr_bio_by_bodynum(ci_get_chr_bio_bodynum_by_slot(data->list.value)); return (s32) lang_get(chrbio->name); @@ -1441,7 +1441,7 @@ MenuItemHandlerResult ci_office_information_menu_handler(s32 operation, struct m return (s32) lang_get(miscbio->name); } break; - case MENUOP_SET: + case MENUOP_CONFIRM: g_ChrBioSlot = data->list.value; if (g_ChrBioSlot < numunlockedchrbios) { menu_push_dialog(&g_BioProfileMenuDialog); @@ -1449,15 +1449,15 @@ MenuItemHandlerResult ci_office_information_menu_handler(s32 operation, struct m menu_push_dialog(&g_BioTextMenuDialog); } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = g_ChrBioSlot; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 2; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return (s32) lang_get(groups[data->list.value].name); - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: data->list.groupstartindex = data->list.value == 0 ? 0 : numunlockedchrbios; break; } @@ -1533,7 +1533,7 @@ MenuDialogHandlerResult ci_character_profile_menu_dialog(s32 operation, struct m f32 scale; switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: if (bodynum == BODY_DRCAROLL) { scale = 0.7f; g_Menus[g_MpPlayerNum].menumodel.zoom = -1; @@ -1593,9 +1593,9 @@ MenuDialogHandlerResult ci_character_profile_menu_dialog(s32 operation, struct m g_Menus[g_MpPlayerNum].menumodel.newroty = 0; g_Menus[g_MpPlayerNum].menumodel.rottimer60 = TICKS(60); break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: break; - case MENUOP_TICK: + case MENUOP_ON_TICK: if (bodynum == BODY_DRCAROLL) { static struct modelpartvisibility vis[] = { { MODELPART_DRCAROLL_0001, false }, @@ -1682,24 +1682,24 @@ char *ci_menu_text_misc_bio_name(struct menuitem *item) MenuItemHandlerResult dt_device_list_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = dt_get_num_available(); break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) bgun_get_name(dt_get_weapon_by_device_index(dt_get_index_by_slot(data->list.value))); - case MENUOP_SET: + case MENUOP_CONFIRM: g_DtSlot = data->list.value; menu_push_dialog(&g_DtDetailsMenuDialog); break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = g_DtSlot; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 0; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return 0; - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: data->list.groupstartindex = 0; break; } @@ -1716,7 +1716,7 @@ char *dt_menu_text_name(struct menuitem *item) MenuItemHandlerResult menuhandler_dt_ok_or_resume(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { // @bug: dt_begin() should not be called if training is already in // progress. Doing this resets the training timer. dt_begin(); @@ -1728,7 +1728,7 @@ MenuItemHandlerResult menuhandler_dt_ok_or_resume(s32 operation, struct menuitem MenuItemHandlerResult menuhandler001a6514(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { dt_end(); } @@ -1808,7 +1808,7 @@ struct menudialogdef g_BioProfileMenuDialog = { L_MPMENU_431, // "Character Profile" g_BioProfileMenuItems, ci_character_profile_menu_dialog, - MENUDIALOGFLAG_0002, + MENUDIALOGFLAG_ALLOW_MODELS, NULL, }; @@ -1873,7 +1873,7 @@ struct menudialogdef g_DtListMenuDialog = { MenuDialogHandlerResult dt_training_details_menu_dialog(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: { s32 weaponnum = dt_get_weapon_by_device_index(dt_get_index_by_slot(g_DtSlot)); u16 unused[] = {64250, 38500, 25650, 25700, 12950}; @@ -1920,9 +1920,9 @@ MenuDialogHandlerResult dt_training_details_menu_dialog(s32 operation, struct me g_Menus[g_MpPlayerNum].menumodel.newscale /= 2.5f; } break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: break; - case MENUOP_TICK: + case MENUOP_ON_TICK: if (g_Menus[g_MpPlayerNum].curdialog && g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef) { if (dt_get_weapon_by_device_index(dt_get_index_by_slot(g_DtSlot)) == WEAPON_DISGUISE41) { g_Menus[g_MpPlayerNum].menumodel.newanimnum = ANIM_006A; @@ -1985,7 +1985,7 @@ char *dt_menu_text_time_taken_value(struct menuitem *item) MenuDialogHandlerResult menudialog_device_training_results(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_CLOSE) { + if (operation == MENUOP_ON_CLOSE) { chr_set_stage_flag(NULL, 0x08000000); } @@ -1995,24 +1995,24 @@ MenuDialogHandlerResult menudialog_device_training_results(s32 operation, struct MenuItemHandlerResult ht_holo_list_menu_handler(s32 operation, struct menuitem *item, union handlerdata *data) { switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = ht_get_num_unlocked(); break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: return (s32) ht_get_name(ht_get_index_by_slot(data->list.value)); - case MENUOP_SET: + case MENUOP_CONFIRM: g_HtSlot = data->list.value; menu_push_dialog(&g_HtDetailsMenuDialog); break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = g_HtSlot; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 0; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return 0; - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: data->list.groupstartindex = 0; break; } @@ -2027,7 +2027,7 @@ char *ht_menu_text_name(struct menuitem *item) MenuItemHandlerResult menuhandler001a6a34(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { ht_begin(); menu_save_and_close_all(); } @@ -2037,7 +2037,7 @@ MenuItemHandlerResult menuhandler001a6a34(s32 operation, struct menuitem *item, MenuItemHandlerResult menuhandler001a6a70(s32 operation, struct menuitem *item, union handlerdata *data) { - if (operation == MENUOP_SET) { + if (operation == MENUOP_CONFIRM) { ht_end(); } @@ -2047,10 +2047,10 @@ MenuItemHandlerResult menuhandler001a6a70(s32 operation, struct menuitem *item, MenuDialogHandlerResult menudialog001a6aa4(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: ht_reset(); break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: break; } @@ -2103,7 +2103,7 @@ char *ht_menu_text_time_taken_value(struct menuitem *item) MenuDialogHandlerResult menudialog_firing_range_results(s32 operation, struct menudialogdef *dialogdef, union handlerdata *data) { - if (operation == MENUOP_CLOSE) { + if (operation == MENUOP_ON_CLOSE) { chr_set_stage_flag(NULL, 0x08000000); } @@ -2185,7 +2185,7 @@ struct menudialogdef g_DtDetailsMenuDialog = { (uintptr_t)&dt_menu_text_name, g_DtDetailsMenuItems, dt_training_details_menu_dialog, - MENUDIALOGFLAG_0002 | MENUDIALOGFLAG_STARTSELECTS | MENUDIALOGFLAG_DISABLERESIZE, + MENUDIALOGFLAG_ALLOW_MODELS | MENUDIALOGFLAG_STARTSELECTS | MENUDIALOGFLAG_DISABLERESIZE, NULL, }; @@ -2365,7 +2365,7 @@ struct menudialogdef g_HtDetailsMenuDialog = { (uintptr_t)&ht_menu_text_name, g_HtDetailsMenuItems, menudialog001a6aa4, - MENUDIALOGFLAG_0002 | MENUDIALOGFLAG_STARTSELECTS | MENUDIALOGFLAG_DISABLERESIZE, + MENUDIALOGFLAG_ALLOW_MODELS | MENUDIALOGFLAG_STARTSELECTS | MENUDIALOGFLAG_DISABLERESIZE, NULL, }; @@ -2500,13 +2500,13 @@ MenuItemHandlerResult ci_hangar_information_menu_handler(s32 operation, struct m groups[1].offset = ci_get_num_unlocked_location_bios(); switch (operation) { - case MENUOP_GETOPTIONCOUNT: + case MENUOP_GET_OPTION_COUNT: data->list.value = ci_get_num_unlocked_hangar_bios(); break; - case MENUOP_GETOPTIONTEXT: + case MENUOP_GET_OPTION_TEXT: bio = ci_get_hangar_bio(ci_get_hangar_bio_index_by_slot(data->list.value)); return (s32) lang_get(bio->name); - case MENUOP_SET: + case MENUOP_CONFIRM: g_HangarBioSlot = data->list.value; bioindex = ci_get_hangar_bio_index_by_slot(g_HangarBioSlot); @@ -2516,15 +2516,15 @@ MenuItemHandlerResult ci_hangar_information_menu_handler(s32 operation, struct m menu_push_dialog(&g_HangarVehicleDetailsMenuDialog); } break; - case MENUOP_GETSELECTEDINDEX: + case MENUOP_GET_SELECTED_INDEX: data->list.value = g_HangarBioSlot; break; - case MENUOP_GETOPTGROUPCOUNT: + case MENUOP_GET_OPTGROUP_COUNT: data->list.value = 2; break; - case MENUOP_GETOPTGROUPTEXT: + case MENUOP_GET_OPTGROUP_TEXT: return (s32) lang_get(groups[data->list.value].name); - case MENUOP_GETGROUPSTARTINDEX: + case MENUOP_GET_OPTGROUP_START_INDEX: data->list.groupstartindex = data->list.value == 0 ? 0 : groups[1].offset; break; } @@ -2658,16 +2658,16 @@ MenuDialogHandlerResult ci_hangar_holograph_menu_dialog(s32 operation, struct me }; switch (operation) { - case MENUOP_OPEN: + case MENUOP_ON_OPEN: g_Menus[g_MpPlayerNum].menumodel.currotx = g_Menus[g_MpPlayerNum].menumodel.newrotx = 0; g_Menus[g_MpPlayerNum].menumodel.curroty = g_Menus[g_MpPlayerNum].menumodel.newroty = 0; g_Menus[g_MpPlayerNum].menumodel.curposx = g_Menus[g_MpPlayerNum].menumodel.newposx = 0; g_Menus[g_MpPlayerNum].menumodel.curposy = g_Menus[g_MpPlayerNum].menumodel.newposy = 0; g_Menus[g_MpPlayerNum].menumodel.curscale = 0; break; - case MENUOP_CLOSE: + case MENUOP_ON_CLOSE: break; - case MENUOP_TICK: + case MENUOP_ON_TICK: if (g_Menus[g_MpPlayerNum].curdialog) { #if VERSION >= VERSION_JPN_FINAL if (g_Menus[g_MpPlayerNum].curdialog->definition == dialogdef) { @@ -2812,7 +2812,7 @@ struct menudialogdef g_HangarVehicleHolographMenuDialog = { L_MISC_471, // "Holograph" g_HangarVehicleHolographMenuItems, ci_hangar_holograph_menu_dialog, - MENUDIALOGFLAG_0002 | MENUDIALOGFLAG_DISABLERESIZE, + MENUDIALOGFLAG_ALLOW_MODELS | MENUDIALOGFLAG_DISABLERESIZE, NULL, }; @@ -2821,7 +2821,7 @@ struct menudialogdef g_HangarVehicleDetailsMenuDialog = { (uintptr_t)&bio_menu_text_name, g_HangarDetailsMenuItems, NULL, - MENUDIALOGFLAG_0002 | MENUDIALOGFLAG_DISABLERESIZE, + MENUDIALOGFLAG_ALLOW_MODELS | MENUDIALOGFLAG_DISABLERESIZE, &g_HangarVehicleHolographMenuDialog, }; @@ -2830,7 +2830,7 @@ struct menudialogdef g_HangarLocationDetailsMenuDialog = { (uintptr_t)&bio_menu_text_name, g_HangarDetailsMenuItems, NULL, - MENUDIALOGFLAG_0002 | MENUDIALOGFLAG_DISABLERESIZE, + MENUDIALOGFLAG_ALLOW_MODELS | MENUDIALOGFLAG_DISABLERESIZE, NULL, }; diff --git a/src/include/constants.h b/src/include/constants.h index 8df6da79d..7a0e0ce7a 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -1627,7 +1627,7 @@ #define MENUBG_CONEOPAQUE 9 // 4MB combat simulator #define MENUDIALOGFLAG_CLOSEONSELECT 0x0001 -#define MENUDIALOGFLAG_0002 0x0002 +#define MENUDIALOGFLAG_ALLOW_MODELS 0x0002 #define MENUDIALOGFLAG_STARTSELECTS 0x0004 #define MENUDIALOGFLAG_DISABLEITEMSCROLL 0x0008 #define MENUDIALOGFLAG_MPLOCKABLE 0x0010 @@ -1636,9 +1636,9 @@ #define MENUDIALOGFLAG_DISABLEBANNER 0x0080 #define MENUDIALOGFLAG_DISABLETITLEBAR 0x0100 #define MENUDIALOGFLAG_DISABLERESIZE 0x0200 -#define MENUDIALOGFLAG_0400 0x0400 +#define MENUDIALOGFLAG_NOVERTICALBORDERS 0x0400 #define MENUDIALOGFLAG_DROPOUTONCLOSE 0x0800 -#define MENUDIALOGFLAG_1000 0x1000 +#define MENUDIALOGFLAG_LESSHEIGHT 0x1000 #define MENUDIALOGSTATE_PREOPEN 0 #define MENUDIALOGSTATE_OPENING 1 @@ -1651,34 +1651,34 @@ #define MENUDIALOGTYPE_4 4 #define MENUDIALOGTYPE_WHITE 5 -#define MENUITEMFLAG_NEWCOLUMN 0x00000001 -#define MENUITEMFLAG_00000002 0x00000002 -#define MENUITEMFLAG_SELECTABLE_OPENSDIALOG 0x00000004 -#define MENUITEMFLAG_SELECTABLE_CLOSESDIALOG 0x00000008 -#define MENUITEMFLAG_LESSLEFTPADDING 0x00000010 -#define MENUITEMFLAG_SELECTABLE_CENTRE 0x00000020 -#define MENUITEMFLAG_LIST_WIDE 0x00000040 -#define MENUITEMFLAG_DROPDOWN_BELOW 0x00000080 -#define MENUITEMFLAG_LABEL_ALTCOLOUR 0x00000100 -#define MENUITEMFLAG_SMALLFONT 0x00000200 -#define MENUITEMFLAG_ALWAYSDISABLED 0x00000400 -#define MENUITEMFLAG_MARQUEE_FADEBOTHSIDES 0x00000800 -#define MENUITEMFLAG_SLIDER_FAST 0x00000800 -#define MENUITEMFLAG_ADJUSTWIDTH 0x00001000 -#define MENUITEMFLAG_SLIDER_HIDEVALUE 0x00002000 -#define MENUITEMFLAG_DARKERBG 0x00004000 -#define MENUITEMFLAG_LABEL_HASRIGHTTEXT 0x00008000 -#define MENUITEMFLAG_00010000 0x00010000 -#define MENUITEMFLAG_LOCKABLEMINOR 0x00020000 -#define MENUITEMFLAG_LOCKABLEMAJOR 0x00040000 -#define MENUITEMFLAG_MPWEAPONSLOT 0x00080000 -#define MENUITEMFLAG_SLIDER_ALTSIZE 0x00100000 -#define MENUITEMFLAG_LIST_CUSTOMRENDER 0x00200000 -#define MENUITEMFLAG_BIGFONT 0x00400000 -#define MENUITEMFLAG_LIST_AUTOWIDTH 0x00800000 -#define MENUITEMFLAG_LABEL_CUSTOMCOLOUR 0x01000000 -#define MENUITEMFLAG_LESSHEIGHT 0x02000000 -#define MENUITEMFLAG_CAROUSEL_04000000 0x04000000 +#define MENUITEMFLAG_NEWCOLUMN 0x00000001 +#define MENUITEMFLAG_00000002 0x00000002 // never read +#define MENUITEMFLAG_SELECTABLE_OPENSDIALOG 0x00000004 +#define MENUITEMFLAG_SELECTABLE_CLOSESDIALOG 0x00000008 +#define MENUITEMFLAG_LESSLEFTPADDING 0x00000010 +#define MENUITEMFLAG_SELECTABLE_CENTRE 0x00000020 +#define MENUITEMFLAG_LIST_WIDE 0x00000040 +#define MENUITEMFLAG_DROPDOWN_BELOW 0x00000080 +#define MENUITEMFLAG_LABEL_ALTCOLOUR 0x00000100 +#define MENUITEMFLAG_SMALLFONT 0x00000200 +#define MENUITEMFLAG_ALWAYSDISABLED 0x00000400 +#define MENUITEMFLAG_MARQUEE_FADEBOTHSIDES 0x00000800 +#define MENUITEMFLAG_SLIDER_FAST 0x00000800 +#define MENUITEMFLAG_ADJUSTWIDTH 0x00001000 +#define MENUITEMFLAG_SLIDER_HIDEVALUE 0x00002000 +#define MENUITEMFLAG_DARKERBG 0x00004000 +#define MENUITEMFLAG_LABEL_HASRIGHTTEXT 0x00008000 +#define MENUITEMFLAG_DISABLESCROLL 0x00010000 +#define MENUITEMFLAG_LOCKABLEMINOR 0x00020000 +#define MENUITEMFLAG_LOCKABLEMAJOR 0x00040000 +#define MENUITEMFLAG_MPWEAPONSLOT 0x00080000 +#define MENUITEMFLAG_SLIDER_ALTSIZE 0x00100000 +#define MENUITEMFLAG_LIST_CUSTOMRENDER 0x00200000 +#define MENUITEMFLAG_BIGFONT 0x00400000 +#define MENUITEMFLAG_LIST_AUTOWIDTH 0x00800000 +#define MENUITEMFLAG_LABEL_CUSTOMCOLOUR 0x01000000 +#define MENUITEMFLAG_LESSHEIGHT 0x02000000 +#define MENUITEMFLAG_CAROUSEL_SCROLLWITHOUTFOCUS 0x04000000 #define MENUITEMTYPE_LABEL 0x01 #define MENUITEMTYPE_LIST 0x02 @@ -1726,33 +1726,33 @@ #define MENUMODELTYPE_3 3 #define MENUMODELTYPE_CREDITSLOGO 4 -#define MENUOP_GETOPTIONCOUNT 1 -#define MENUOP_GETOPTGROUPCOUNT 2 -#define MENUOP_GETOPTIONTEXT 3 -#define MENUOP_GETOPTGROUPTEXT 4 -#define MENUOP_GETGROUPSTARTINDEX 5 -#define MENUOP_SET 6 -#define MENUOP_GETSELECTEDINDEX 7 -#define MENUOP_GET 8 -#define MENUOP_GETSLIDER 9 -#define MENUOP_GETSLIDERLABEL 10 -#define MENUOP_11 11 -#define MENUOP_CHECKDISABLED 12 -#define MENUOP_FOCUS 13 -#define MENUOP_GETLISTITEMCHECKBOX 14 -#define MENUOP_CHECKPREFOCUSED 15 -#define MENUOP_LISTITEMFOCUS 16 -#define MENUOP_GETTEXT 17 -#define MENUOP_SETTEXT 18 -#define MENUOP_RENDER 19 -#define MENUOP_GETOPTIONHEIGHT 20 -#define MENUOP_21 21 -#define MENUOP_GETCOLOUR 22 -#define MENUOP_CHECKHIDDEN 24 -#define MENUOP_25 25 -#define MENUOP_OPEN 100 -#define MENUOP_CLOSE 101 -#define MENUOP_TICK 102 +#define MENUOP_GET_OPTION_COUNT 1 +#define MENUOP_GET_OPTGROUP_COUNT 2 +#define MENUOP_GET_OPTION_TEXT 3 +#define MENUOP_GET_OPTGROUP_TEXT 4 +#define MENUOP_GET_OPTGROUP_START_INDEX 5 +#define MENUOP_CONFIRM 6 +#define MENUOP_GET_SELECTED_INDEX 7 +#define MENUOP_IS_CHECKED 8 +#define MENUOP_GET_SLIDER_VALUE 9 +#define MENUOP_GET_SLIDER_LABEL 10 +#define MENUOP_ON_CAROUSEL_TICK 11 +#define MENUOP_IS_DISABLED 12 +#define MENUOP_ON_FOCUS 13 +#define MENUOP_IS_OPTION_CHECKED 14 +#define MENUOP_IS_PREFOCUSED 15 +#define MENUOP_ON_OPTION_FOCUS 16 +#define MENUOP_GET_KEYBOARD_STRING 17 +#define MENUOP_SET_KEYBOARD_STRING 18 +#define MENUOP_RENDER 19 +#define MENUOP_GET_OPTION_HEIGHT 20 +#define MENUOP_IS_CAROUSEL_OPTION_HIDDEN 21 +#define MENUOP_GET_LABEL_COLOURS 22 +#define MENUOP_IS_HIDDEN 24 +#define MENUOP_GET_OPTION_INDEX2 25 +#define MENUOP_ON_OPEN 100 +#define MENUOP_ON_CLOSE 101 +#define MENUOP_ON_TICK 102 #define MENUPLANE_00 0 #define MENUPLANE_01 1