Name remaining menu constants

This commit is contained in:
Ryan Dwyer 2025-02-07 20:09:34 +10:00
parent cdd3cc2175
commit eeff60ded0
14 changed files with 746 additions and 752 deletions

View File

@ -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;
}

View File

@ -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;
}

View File

@ -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;

View File

@ -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

View File

@ -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;

File diff suppressed because it is too large Load Diff

View File

@ -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

View File

@ -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);
}
}

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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;
}

File diff suppressed because it is too large Load Diff

View File

@ -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,
};

View File

@ -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