From d7246b166c301b2b64e14409b0523b91fdca2e55 Mon Sep 17 00:00:00 2001 From: Ryan Dwyer Date: Fri, 14 Aug 2020 18:57:29 +1000 Subject: [PATCH] Rename MENUOP dialog constants --- src/game/cheats.c | 4 ++-- src/game/endscreen.c | 2 +- src/game/game_0fd660.c | 6 +++--- src/game/game_102240.c | 18 +++++++++--------- src/game/game_107fb0.c | 2 +- src/game/game_10c9c0.c | 4 ++-- src/game/game_179060.c | 14 +++++++------- src/game/game_17f930.c | 4 ++-- src/game/game_1a3340.c | 10 +++++----- src/include/constants.h | 6 +++--- 10 files changed, 35 insertions(+), 35 deletions(-) diff --git a/src/game/cheats.c b/src/game/cheats.c index 17b0d15db..a307df6cb 100644 --- a/src/game/cheats.c +++ b/src/game/cheats.c @@ -533,7 +533,7 @@ glabel cheatMenuHandleDialog // It's calculating it as &func00002148 + 24 rather than ptr + 4. //bool cheatMenuHandleDialog(u32 operation, struct menudialog *dialog, struct menu *menu) //{ -// if (operation == MENUOP_100) { +// if (operation == MENUOP_OPEN) { // func0f14a52c(); // // if (func0f11e78c()) { @@ -564,7 +564,7 @@ glabel cheatMenuHandleDialog //#endif // } // -// if (operation == MENUOP_101) { +// if (operation == MENUOP_CLOSE) { // if (func0f11e78c()) { // savefileSetFlag(SAVEFILEFLAG_USED_TRANSFERPAK); // } diff --git a/src/game/endscreen.c b/src/game/endscreen.c index 21e92199a..0e9b60005 100644 --- a/src/game/endscreen.c +++ b/src/game/endscreen.c @@ -47,7 +47,7 @@ s32 menuhandlerDeclineMission(u32 operation, struct menuitem *item, s32 *value) void menudialogRetryMission(u32 operation, struct menudialog *dialog, struct menuthing **thingptr) { switch (operation) { - case MENUOP_102: + case MENUOP_TICK: { /** * NTSC Final adds this check to make sure the given dialog is diff --git a/src/game/game_0fd660.c b/src/game/game_0fd660.c index 74777887d..241ea8faa 100644 --- a/src/game/game_0fd660.c +++ b/src/game/game_0fd660.c @@ -491,13 +491,13 @@ glabel var7f1b2cd8 bool menudialogMpPickTarget(u32 operation, struct menudialog *dialog, struct menu *menu) { switch (operation) { - case MENUOP_100: + case MENUOP_OPEN: g_PlayersWithControl[g_Vars.currentplayernum] = false; break; - case MENUOP_102: + case MENUOP_TICK: g_PlayersWithControl[g_Vars.currentplayernum] = false; break; - case MENUOP_101: + case MENUOP_CLOSE: g_PlayersWithControl[g_Vars.currentplayernum] = true; break; } diff --git a/src/game/game_102240.c b/src/game/game_102240.c index 741b4c387..b619a7c81 100644 --- a/src/game/game_102240.c +++ b/src/game/game_102240.c @@ -843,14 +843,14 @@ char *soloMenuTitleStageOverview(struct menudialog *dialog) s32 menudialog00103608(u32 operation, struct menudialog *dialog, struct menuthing **thingptr) { switch (operation) { - case MENUOP_100: + case MENUOP_OPEN: g_Menus[g_MpPlayerNum].unk850 = 0; func0f00e980(g_MissionConfig.stagenum, g_Menus[g_MpPlayerNum].unk844, g_Menus[g_MpPlayerNum].unk848, &g_Briefing); break; - case MENUOP_101: + case MENUOP_CLOSE: langClearBank(var8009dfe0[1]); break; } @@ -1447,7 +1447,7 @@ glabel menudialogCoopAntiOptions // It uses offset 0x0a, but 0x08 is a 4 byte pointer. //bool menudialogCoopAntiOptions(u32 operation, struct menudialog *dialog, struct menu *menu) //{ -// if (operation == MENUOP_100) { +// if (operation == MENUOP_OPEN) { // s32 max = getMaxAiBuddies(); // // if (g_Vars.numaibuddies > max) { @@ -1455,7 +1455,7 @@ glabel menudialogCoopAntiOptions // } // } // -// if (operation == MENUOP_102) { +// if (operation == MENUOP_TICK) { // if (g_Menus[g_MpPlayerNum].curframe && // g_Menus[g_MpPlayerNum].curframe->dialog == dialog) { // struct menuframe *curframe = menu->curframe; @@ -2841,9 +2841,9 @@ glabel var7f1b2dfc s32 menudialog0010559c(u32 operation, struct menudialog *dialog, s32 *arg2) { switch (operation) { - case MENUOP_100: + case MENUOP_OPEN: break; - case MENUOP_101: + case MENUOP_CLOSE: if ((g_Vars.unk000458 & 1) && g_Vars.coopplayernum < 0 && g_Vars.antiplayernum < 0) { if (func0f1094e4(&var800a22c0, 1, 0) == 0) { *arg2 = 1; @@ -4153,7 +4153,7 @@ struct menudialog g_SoloAbortShortMenuDialog = { s32 soloMenuDialogPauseStatus(u32 operation, s32 arg1, s32 arg2) { - if (operation == MENUOP_100) { + if (operation == MENUOP_OPEN) { struct objectivething *thing = var8009d0b4; struct objective *objective; s32 iVar3 = 1; @@ -4497,10 +4497,10 @@ s32 menuhandlerMainMenuCounterOperative(u32 operation, struct menuitem *item, s3 bool menudialogMainMenu(u32 operation, struct menudialog *dialog, struct menu *menu) { switch (operation) { - case MENUOP_100: + case MENUOP_OPEN: g_Menus[g_MpPlayerNum].data.main.unke2c = 0; break; - case MENUOP_102: + case MENUOP_TICK: if (g_Menus[g_MpPlayerNum].curframe && g_Menus[g_MpPlayerNum].curframe->dialog == dialog) { g_MissionConfig.iscoop = false; diff --git a/src/game/game_107fb0.c b/src/game/game_107fb0.c index 2eef6524d..515ec5615 100644 --- a/src/game/game_107fb0.c +++ b/src/game/game_107fb0.c @@ -1165,7 +1165,7 @@ glabel func0f108d8c bool menudialog00108e58(u32 operation, struct menudialog *dialog, struct menu *menu) { - if (operation == MENUOP_102) { + if (operation == MENUOP_TICK) { if (g_Menus[g_MpPlayerNum].curframe && g_Menus[g_MpPlayerNum].curframe->dialog == dialog) { func0f109038(0); diff --git a/src/game/game_10c9c0.c b/src/game/game_10c9c0.c index 37e69b096..2927f2ee2 100644 --- a/src/game/game_10c9c0.c +++ b/src/game/game_10c9c0.c @@ -92,7 +92,7 @@ void func0f10cb2c(void) bool menudialog4MbMainMenu(u32 operation, struct menudialog *dialog, struct menu *menu) { - if (operation == MENUOP_100) { + if (operation == MENUOP_OPEN) { g_Vars.unk000494 = 0; g_Vars.unk000495 = 0; g_Vars.unk000496 = 0; @@ -101,7 +101,7 @@ bool menudialog4MbMainMenu(u32 operation, struct menudialog *dialog, struct menu if (g_Menus[g_MpPlayerNum].curframe && g_Menus[g_MpPlayerNum].curframe->dialog == &g_4MbMainMenu && - operation == MENUOP_102) { + operation == MENUOP_TICK) { g_Vars.unk000490 = 2; g_Vars.mpquickteam = MPQUICKTEAM_5; g_Vars.unk00049c = 0; diff --git a/src/game/game_179060.c b/src/game/game_179060.c index 1566449dc..1486da53c 100644 --- a/src/game/game_179060.c +++ b/src/game/game_179060.c @@ -3571,7 +3571,7 @@ s32 menuhandlerMpRestoreHandicapDefaults(u32 operation, struct menuitem *item, s bool menudialogMpReady(u32 operation, struct menudialog *dialog, struct menu *menu) { - if (operation == MENUOP_100) { + if (operation == MENUOP_OPEN) { if (g_MpPlayers[g_MpPlayerNum].saved && g_MpPlayers[g_MpPlayerNum].unk50) { func0f1094e4(&g_MpPlayers[g_MpPlayerNum].saved, 3, g_MpPlayerNum); } @@ -3582,7 +3582,7 @@ bool menudialogMpReady(u32 operation, struct menudialog *dialog, struct menu *me bool menudialogMpSimulant(u32 operation, struct menudialog *dialog, struct menu *menu) { - if (operation == MENUOP_102) { + if (operation == MENUOP_TICK) { if ((u8)g_MpSimulants[g_Menus[g_MpPlayerNum].data.mpsetup.slotindex].base.name[0] == '\0') { menuPopDialog(); } @@ -4294,7 +4294,7 @@ glabel func0f17d378 bool menudialogMpSimulants(u32 operation, struct menudialog *dialog, struct menu *menu) { - if (operation == MENUOP_100) { + if (operation == MENUOP_OPEN) { g_Menus[g_MpPlayerNum].data.mpsetup.slotcount = 0; } @@ -4950,11 +4950,11 @@ glabel var7f1b8228 bool menudialogMpSelectTune(u32 operation, struct menudialog *dialog, struct menu *menu) { - if (operation == MENUOP_100) { + if (operation == MENUOP_OPEN) { var800840e0 = 80; } - if (operation == MENUOP_101) { + if (operation == MENUOP_CLOSE) { var800840e0 = 15; } @@ -5921,7 +5921,7 @@ char *mpMenuTextWeaponSetName(struct menuitem *item) bool menudialogMpGameSetup(u32 operation, struct menudialog *dialog, struct menu *menu) { - if (operation == MENUOP_100) { + if (operation == MENUOP_OPEN) { g_Vars.unk000490 = 1; g_Vars.unk00049c = 1; } @@ -5931,7 +5931,7 @@ bool menudialogMpGameSetup(u32 operation, struct menudialog *dialog, struct menu bool menudialogMpQuickGo(u32 operation, struct menudialog *dialog, struct menu *menu) { - if (operation == MENUOP_100) { + if (operation == MENUOP_OPEN) { g_Vars.unk000490 = 3; } diff --git a/src/game/game_17f930.c b/src/game/game_17f930.c index 52a54787e..20cf062fa 100644 --- a/src/game/game_17f930.c +++ b/src/game/game_17f930.c @@ -75,7 +75,7 @@ const char var7f1b88c0[] = "%d:%02d"; bool menudialogCombatSimulator(u32 operation, struct menudialog *dialog, struct menu *menu) { - if (operation == MENUOP_100) { + if (operation == MENUOP_OPEN) { g_Vars.unk000494 = 0; g_Vars.unk000495 = 0; g_Vars.unk000496 = 0; @@ -84,7 +84,7 @@ bool menudialogCombatSimulator(u32 operation, struct menudialog *dialog, struct if (g_Menus[g_MpPlayerNum].curframe && g_Menus[g_MpPlayerNum].curframe->dialog == &g_CombatSimulatorMenuDialog - && operation == MENUOP_102) { + && operation == MENUOP_TICK) { g_Vars.unk000490 = 2; g_Vars.mpquickteam = MPQUICKTEAM_5; g_Vars.unk00049c = 0; diff --git a/src/game/game_1a3340.c b/src/game/game_1a3340.c index cd91c5042..82999e7c0 100644 --- a/src/game/game_1a3340.c +++ b/src/game/game_1a3340.c @@ -569,7 +569,7 @@ glabel var7f1b9944 s32 frTrainingStatsMenuDialog(u32 operation, u32 arg1, u32 *arg2) { - if (operation == MENUOP_101) { + if (operation == MENUOP_CLOSE) { if (frIsInTraining() == false) { frEndSession(true); } @@ -3255,7 +3255,7 @@ char *dtMenuTextTimeTakenValue(struct menuitem *item) bool menudialogDeviceTrainingResults(u32 operation, struct menudialog *dialog, struct menu *menu) { - if (operation == MENUOP_101) { + if (operation == MENUOP_CLOSE) { chrSetStageFlag(NULL, 0x08000000); } @@ -3317,10 +3317,10 @@ s32 menuhandler001a6a70(u32 operation, struct menuitem *item, s32 *value) bool menudialog001a6aa4(u32 operation, struct menudialog *dialog, struct menu *menu) { switch (operation) { - case MENUOP_100: + case MENUOP_OPEN: func0f1a2198(); break; - case MENUOP_101: + case MENUOP_CLOSE: break; } @@ -3373,7 +3373,7 @@ char *htMenuTextTimeTakenValue(struct menuitem *item) bool menudialogFiringRangeResults(u32 operation, struct menudialog *dialog, struct menu *menu) { - if (operation == MENUOP_101) { + if (operation == MENUOP_CLOSE) { chrSetStageFlag(NULL, 0x08000000); } diff --git a/src/include/constants.h b/src/include/constants.h index 72a7b1c2a..4c28ec982 100644 --- a/src/include/constants.h +++ b/src/include/constants.h @@ -1064,9 +1064,9 @@ #define MENUOP_SETTEXT 18 #define MENUOP_GETCOLOUR 22 #define MENUOP_CHECKHIDDEN 24 -#define MENUOP_100 100 -#define MENUOP_101 101 -#define MENUOP_102 102 +#define MENUOP_OPEN 100 +#define MENUOP_CLOSE 101 +#define MENUOP_TICK 102 #define MENUROOT_ENDSCREEN 1 #define MENUROOT_MAINMENU 2