forked from Ports/perfect_dark
Merge pull request #716 from jonaeru/port-net-disablemenu
[port-net] Disable all menus in Perfect Menu except Network Game and Change Agent
This commit is contained in:
2 files changed
+63
-3
No files matched your search
+35
-3
@@ -9,6 +9,7 @@
|
||||
#include "game/mainmenu.h"
|
||||
#include "game/menu.h"
|
||||
#include "game/gamefile.h"
|
||||
#include "game/filelist.h"
|
||||
#include "video.h"
|
||||
#include "input.h"
|
||||
#include "config.h"
|
||||
@@ -17,6 +18,8 @@
|
||||
|
||||
extern MenuItemHandlerResult menuhandlerMainMenuCombatSimulator(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
extern MenuItemHandlerResult menuhandlerMpAdvancedSetup(s32 operation, struct menuitem *item, union handlerdata *data);
|
||||
extern struct menuitem g_MpPlayerSetup234MenuItems[];
|
||||
extern struct menudialogdef g_NetJoinPlayerSetupMenuDialog;
|
||||
|
||||
static s32 g_NetMenuMaxPlayers = NET_MAX_CLIENTS;
|
||||
static s32 g_NetMenuPort = NET_DEFAULT_PORT;
|
||||
@@ -121,7 +124,7 @@ struct menudialogdef g_NetHostMenuDialog = {
|
||||
(uintptr_t)"Host Network Game",
|
||||
g_NetHostMenuItems,
|
||||
NULL,
|
||||
MENUDIALOGFLAG_LITERAL_TEXT,
|
||||
MENUDIALOGFLAG_LITERAL_TEXT | MENUDIALOGFLAG_STARTSELECTS,
|
||||
NULL,
|
||||
};
|
||||
|
||||
@@ -273,6 +276,18 @@ MenuItemHandlerResult menuhandlerJoinStart(s32 operation, struct menuitem *item,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static MenuItemHandlerResult menuhandlerJoinPlayerSetup(s32 operation, struct menuitem *item, union handlerdata *data)
|
||||
{
|
||||
if (operation == MENUOP_SET) {
|
||||
// load MP player file
|
||||
filelistCreate(0, FILETYPE_MPPLAYER);
|
||||
filelistsTick();
|
||||
menuPushDialog(&g_NetJoinPlayerSetupMenuDialog);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct menuitem g_NetJoinMenuItems[] = {
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
@@ -282,6 +297,14 @@ struct menuitem g_NetJoinMenuItems[] = {
|
||||
(uintptr_t)&menutextJoinAddress,
|
||||
menuhandlerJoinAddress,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
0,
|
||||
0,
|
||||
L_MPMENU_028, // "Player Setup"
|
||||
0,
|
||||
menuhandlerJoinPlayerSetup,
|
||||
},
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
0,
|
||||
@@ -314,7 +337,7 @@ struct menudialogdef g_NetJoinMenuDialog = {
|
||||
(uintptr_t)"Join Network Game",
|
||||
g_NetJoinMenuItems,
|
||||
NULL,
|
||||
MENUDIALOGFLAG_LITERAL_TEXT | MENUDIALOGFLAG_STARTSELECTS | MENUDIALOGFLAG_IGNOREBACK,
|
||||
MENUDIALOGFLAG_LITERAL_TEXT | MENUDIALOGFLAG_STARTSELECTS,
|
||||
NULL,
|
||||
};
|
||||
|
||||
@@ -385,6 +408,15 @@ struct menudialogdef g_NetMenuDialog = {
|
||||
(uintptr_t)"Network Game",
|
||||
g_NetMenuItems,
|
||||
NULL,
|
||||
MENUDIALOGFLAG_MPLOCKABLE | MENUDIALOGFLAG_LITERAL_TEXT,
|
||||
MENUDIALOGFLAG_MPLOCKABLE | MENUDIALOGFLAG_LITERAL_TEXT | MENUDIALOGFLAG_STARTSELECTS,
|
||||
NULL,
|
||||
};
|
||||
|
||||
struct menudialogdef g_NetJoinPlayerSetupMenuDialog = {
|
||||
MENUDIALOGTYPE_DEFAULT,
|
||||
L_MPMENU_028, // "Player Setup"
|
||||
g_MpPlayerSetup234MenuItems,
|
||||
NULL,
|
||||
MENUDIALOGFLAG_DROPOUTONCLOSE | MENUDIALOGFLAG_STARTSELECTS,
|
||||
NULL,
|
||||
};
|
||||
@@ -3861,7 +3861,11 @@ struct menudialogdef g_CiOptionsViaPcMenuDialog = {
|
||||
L_OPTIONS_180, // "Options"
|
||||
g_CiOptionsMenuItems,
|
||||
menudialog0010559c,
|
||||
#ifdef PLATFORM_N64
|
||||
0,
|
||||
#else
|
||||
MENUDIALOGFLAG_IGNOREBACK,
|
||||
#endif
|
||||
NULL,
|
||||
};
|
||||
|
||||
@@ -5046,7 +5050,11 @@ struct menuitem g_MainMenuMenuItems[] = {
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
0,
|
||||
#ifdef PLATFORM_N64
|
||||
MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_BIGFONT,
|
||||
#else
|
||||
MENUITEMFLAG_SELECTABLE_CLOSESDIALOG | MENUITEMFLAG_BIGFONT | MENUITEMFLAG_ALWAYSDISABLED,
|
||||
#endif
|
||||
L_MISC_446, // "Carrington Institute"
|
||||
0x00000001,
|
||||
NULL,
|
||||
@@ -5054,7 +5062,11 @@ struct menuitem g_MainMenuMenuItems[] = {
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
0,
|
||||
#ifdef PLATFORM_N64
|
||||
MENUITEMFLAG_BIGFONT,
|
||||
#else
|
||||
MENUITEMFLAG_BIGFONT | MENUITEMFLAG_ALWAYSDISABLED,
|
||||
#endif
|
||||
(uintptr_t)&mainMenuTextLabel,
|
||||
0x00000002,
|
||||
menuhandlerMainMenuSoloMissions,
|
||||
@@ -5062,7 +5074,11 @@ struct menuitem g_MainMenuMenuItems[] = {
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
1,
|
||||
#ifdef PLATFORM_N64
|
||||
MENUITEMFLAG_BIGFONT,
|
||||
#else
|
||||
MENUITEMFLAG_BIGFONT | MENUITEMFLAG_ALWAYSDISABLED,
|
||||
#endif
|
||||
(uintptr_t)&mainMenuTextLabel,
|
||||
0x00000003,
|
||||
menuhandlerMainMenuCombatSimulator,
|
||||
@@ -5070,7 +5086,11 @@ struct menuitem g_MainMenuMenuItems[] = {
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
2,
|
||||
#ifdef PLATFORM_N64
|
||||
MENUITEMFLAG_BIGFONT,
|
||||
#else
|
||||
MENUITEMFLAG_BIGFONT | MENUITEMFLAG_ALWAYSDISABLED,
|
||||
#endif
|
||||
(uintptr_t)&mainMenuTextLabel,
|
||||
0x00000004,
|
||||
menuhandlerMainMenuCooperative,
|
||||
@@ -5078,7 +5098,11 @@ struct menuitem g_MainMenuMenuItems[] = {
|
||||
{
|
||||
MENUITEMTYPE_SELECTABLE,
|
||||
3,
|
||||
#ifdef PLATFORM_N64
|
||||
MENUITEMFLAG_BIGFONT,
|
||||
#else
|
||||
MENUITEMFLAG_BIGFONT | MENUITEMFLAG_ALWAYSDISABLED,
|
||||
#endif
|
||||
(uintptr_t)&mainMenuTextLabel,
|
||||
0x00000005,
|
||||
menuhandlerMainMenuCounterOperative,
|
||||
@@ -5121,7 +5145,11 @@ struct menudialogdef g_CiMenuViaPcMenuDialog = {
|
||||
L_OPTIONS_116, // "Perfect Menu"
|
||||
g_MainMenuMenuItems,
|
||||
menudialogMainMenu,
|
||||
#ifdef PLATFORM_N64
|
||||
MENUDIALOGFLAG_STARTSELECTS,
|
||||
#else
|
||||
MENUDIALOGFLAG_STARTSELECTS | MENUDIALOGFLAG_IGNOREBACK,
|
||||
#endif
|
||||
&g_CiOptionsViaPcMenuDialog,
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user