From f188c290e57c5ef5abc2cc5e6a39a87cfe6c57ba Mon Sep 17 00:00:00 2001 From: TehRealSalt Date: Fri, 9 Aug 2019 04:25:22 -0400 Subject: [PATCH] Start on new menus --- src/d_main.c | 10 +- src/dehacked.c | 6 +- src/f_finale.h | 4 +- src/f_wipe.c | 4 +- src/g_game.c | 5 +- src/g_state.h | 2 +- src/hu_stuff.c | 12 + src/hu_stuff.h | 8 +- src/m_cheat.c | 14 - src/m_menu.c | 2596 +++++++++++------------------------------------- src/m_menu.h | 29 +- src/v_video.c | 119 ++- src/v_video.h | 10 +- 13 files changed, 762 insertions(+), 2057 deletions(-) diff --git a/src/d_main.c b/src/d_main.c index a6bd48e0e..89c082531 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -307,7 +307,7 @@ static void D_Display(void) // set for all later wipedefindex = gamestate; // wipe_xxx_toblack if (gamestate == GS_TITLESCREEN && wipegamestate != GS_INTRO) - wipedefindex = wipe_timeattack_toblack; + wipedefindex = wipe_titlescreen_toblack; else if (gamestate == GS_INTERMISSION) { if (intertype == int_spec) // Special Stage @@ -325,7 +325,7 @@ static void D_Display(void) F_WipeStartScreen(); V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); F_WipeEndScreen(); - F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK, "FADEMAP0", false); + F_RunWipe(wipedefs[wipedefindex], gamestate != GS_MENU, "FADEMAP0", false); } if (gamestate != GS_LEVEL && rendermode != render_none) @@ -360,7 +360,7 @@ static void D_Display(void) HU_Drawer(); break; - case GS_TIMEATTACK: + case GS_MENU: break; case GS_INTRO: @@ -538,7 +538,7 @@ static void D_Display(void) vid.recalc = 0; // FIXME: draw either console or menu, not the two - if (gamestate != GS_TIMEATTACK) + if (gamestate != GS_MENU) CON_Drawer(); M_Drawer(); // menu is drawn even on top of everything @@ -556,7 +556,7 @@ static void D_Display(void) if (rendermode != render_none) { F_WipeEndScreen(); - F_RunWipe(wipedefs[wipedefindex], gamestate != GS_TIMEATTACK, "FADEMAP0", true); + F_RunWipe(wipedefs[wipedefindex], gamestate != GS_MENU, "FADEMAP0", true); } } diff --git a/src/dehacked.c b/src/dehacked.c index be45f3f0f..5aa8f1b20 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -3296,13 +3296,13 @@ static void readwipes(MYFILE *f) else if (fastcmp(pword, "FINAL")) wipeoffset = wipe_titlescreen_final; } - else if (fastncmp(word, "TIMEATTACK_", 11)) + else if (fastncmp(word, "MENU_", 11)) { pword = word + 11; if (fastcmp(pword, "TOBLACK")) - wipeoffset = wipe_timeattack_toblack; + wipeoffset = wipe_menu_toblack; else if (fastcmp(pword, "FINAL")) - wipeoffset = wipe_timeattack_final; + wipeoffset = wipe_menu_final; } else if (fastncmp(word, "CREDITS_", 8)) { diff --git a/src/f_finale.h b/src/f_finale.h index a6fccf888..61c0d7d48 100644 --- a/src/f_finale.h +++ b/src/f_finale.h @@ -85,7 +85,7 @@ enum wipe_voting_toblack, wipe_continuing_toblack, wipe_titlescreen_toblack, - wipe_timeattack_toblack, + wipe_menu_toblack, wipe_credits_toblack, wipe_evaluation_toblack, wipe_gameend_toblack, @@ -102,7 +102,7 @@ enum wipe_voting_final, wipe_continuing_final, wipe_titlescreen_final, - wipe_timeattack_final, + wipe_menu_final, wipe_credits_final, wipe_evaluation_final, wipe_gameend_final, diff --git a/src/f_wipe.c b/src/f_wipe.c index a1107e16f..1ea2ec2fa 100644 --- a/src/f_wipe.c +++ b/src/f_wipe.c @@ -55,7 +55,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = { 0, // wipe_voting_toblack, 0, // wipe_continuing_toblack 0, // wipe_titlescreen_toblack - 0, // wipe_timeattack_toblack + 1, // wipe_menu_toblack 99, // wipe_credits_toblack 0, // wipe_evaluation_toblack 0, // wipe_gameend_toblack @@ -71,7 +71,7 @@ UINT8 wipedefs[NUMWIPEDEFS] = { 0, // wipe_voting_final 0, // wipe_continuing_final 0, // wipe_titlescreen_final - 0, // wipe_timeattack_final + 1, // wipe_menu_final 99, // wipe_credits_final 0, // wipe_evaluation_final 0, // wipe_gameend_final diff --git a/src/g_game.c b/src/g_game.c index e406e29d1..6a509e28b 100644 --- a/src/g_game.c +++ b/src/g_game.c @@ -2412,7 +2412,7 @@ void G_Ticker(boolean run) HU_Ticker(); break; - case GS_TIMEATTACK: + case GS_MENU: break; case GS_INTRO: @@ -3442,8 +3442,7 @@ INT16 G_SometimesGetDifferentGametype(void) // UINT8 G_GetGametypeColor(INT16 gt) { - if (modeattacking // == ATTACKING_RECORD - || gamestate == GS_TIMEATTACK) + if (modeattacking) // == ATTACKING_RECORD return orangemap[0]; if (gt == GT_MATCH) return redmap[0]; diff --git a/src/g_state.h b/src/g_state.h index f9f1babd3..e6aac9c38 100644 --- a/src/g_state.h +++ b/src/g_state.h @@ -27,7 +27,7 @@ typedef enum GS_CONTINUING, // continue screen GS_TITLESCREEN, // title screen - GS_TIMEATTACK, // time attack menu + GS_MENU, // SRB2Kart: menu-only (previously was GS_TIMEATTACK) GS_CREDITS, // credit sequence GS_EVALUATION, // Evaluation at the end of a game. GS_GAMEEND, // game end sequence diff --git a/src/hu_stuff.c b/src/hu_stuff.c index 38324dbd9..cf3cc5872 100644 --- a/src/hu_stuff.c +++ b/src/hu_stuff.c @@ -66,6 +66,7 @@ //------------------------------------------- patch_t *hu_font[HU_FONTSIZE]; patch_t *kart_font[KART_FONTSIZE]; // SRB2kart +patch_t *gamemode_font[AZ_FONTSIZE]; patch_t *tny_font[HU_FONTSIZE]; patch_t *tallnum[10]; // 0-9 patch_t *nightsnum[10]; // 0-9 @@ -237,6 +238,17 @@ void HU_LoadGraphics(void) else kart_font[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX); } + + j = AZ_FONTSTART; // All A to Z font sets + for (i = 0; i < AZ_FONTSIZE; i++, j++) + { + // Gamemode font + sprintf(buffer, "GAMEM%.3d", j); + if (W_CheckNumForName(buffer) == LUMPERROR) + gamemode_font[i] = NULL; + else + gamemode_font[i] = (patch_t *)W_CachePatchName(buffer, PU_HUDGFX); + } // j = LT_FONTSTART; diff --git a/src/hu_stuff.h b/src/hu_stuff.h index be6798a82..2c5fcbb29 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -31,6 +31,11 @@ #define KART_FONTEND 'Z' #define KART_FONTSIZE (KART_FONTEND - KART_FONTSTART + 1) + +#define AZ_FONTSTART 'A' // the first font character +#define AZ_FONTEND 'Z' + +#define AZ_FONTSIZE (AZ_FONTEND - AZ_FONTSTART + 1) // // Level title font @@ -78,7 +83,8 @@ void HU_AddChatText(const char *text, boolean playsound); // set true when entering a chat message extern boolean chat_on; -extern patch_t *hu_font[HU_FONTSIZE], *kart_font[KART_FONTSIZE], *tny_font[HU_FONTSIZE]; // SRB2kart +extern patch_t *hu_font[HU_FONTSIZE], *tny_font[HU_FONTSIZE]; +extern patch_t *kart_font[KART_FONTSIZE], *gamemode_font[AZ_FONTSIZE]; // SRB2kart extern patch_t *tallnum[10]; extern patch_t *pingnum[10]; extern patch_t *pinggfx[5]; diff --git a/src/m_cheat.c b/src/m_cheat.c index e7e877ada..e12dfa590 100644 --- a/src/m_cheat.c +++ b/src/m_cheat.c @@ -58,20 +58,6 @@ typedef struct // ========================================================================== // Cheat responders -/*static UINT8 cheatf_ultimate(void) -{ - if (menuactive && (currentMenu != &MainDef && currentMenu != &SP_LoadDef)) - return 0; // Only on the main menu, or the save select! - - S_StartSound(0, sfx_itemup); - ultimate_selectable = (!ultimate_selectable); - - // If on the save select, move to what is now Ultimate Mode! - if (currentMenu == &SP_LoadDef) - M_ForceSaveSlotSelected(NOSAVESLOT); - return 1; -}*/ - static UINT8 cheatf_warp(void) { UINT8 i; diff --git a/src/m_menu.c b/src/m_menu.c index 166b115d6..342bbf4d5 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -152,6 +152,8 @@ INT16 startmap; // Mario, NiGHTS, or just a plain old normal game? static INT16 itemOn = 1; // menu item skull is on, Hack by Tails 09-18-2002 static INT16 skullAnimCounter = 10; // skull animation counter +static boolean menuwipe = false; // finish wipes between screens + static UINT8 setupcontrolplayer; static INT32 (*setupcontrols)[2]; // pointer to the gamecontrols of the player being edited @@ -185,19 +187,15 @@ menu_t SPauseDef; #define lsheadingheight 16 -// Sky Room -//static void M_CustomLevelSelect(INT32 choice); -//static void M_CustomWarp(INT32 choice); -FUNCNORETURN static ATTRNORETURN void M_UltimateCheat(INT32 choice); -//static void M_LoadGameLevelSelect(INT32 choice); -static void M_GetAllEmeralds(INT32 choice); -static void M_DestroyRobots(INT32 choice); -//static void M_LevelSelectWarp(INT32 choice); -static void M_Credits(INT32 choice); -static void M_PandorasBox(INT32 choice); -static void M_EmblemHints(INT32 choice); +menu_t PY_MainDef; + +// Extra + +static void M_Statistics(INT32 choice); static char *M_GetConditionString(condition_t cond); -menu_t SR_MainDef, SR_UnlockChecklistDef; + +menu_t EX_MainDef, EX_UnlockChecklistDef; +menu_t EX_LevelStatsDef; // Misc. Main Menu #if 0 // Bring this back when we have actual single-player @@ -215,29 +213,22 @@ static void M_ConfirmEnterGame(INT32 choice); static void M_ConfirmTeamScramble(INT32 choice); static void M_ConfirmTeamChange(INT32 choice); static void M_ConfirmSpectateChange(INT32 choice); -//static void M_SecretsMenu(INT32 choice); -//static void M_SetupChoosePlayer(INT32 choice); +static void M_Credits(INT32 choice); static void M_QuitSRB2(INT32 choice); menu_t SP_MainDef, MP_MainDef, OP_MainDef; menu_t MISC_ScrambleTeamDef, MISC_ChangeTeamDef, MISC_ChangeSpectateDef; // Single Player -//static void M_LoadGame(INT32 choice); static void M_TimeAttack(INT32 choice); static boolean M_QuitTimeAttackMenu(void); -//static void M_NightsAttack(INT32 choice); -static void M_Statistics(INT32 choice); static void M_HandleStaffReplay(INT32 choice); static void M_ReplayTimeAttack(INT32 choice); static void M_ChooseTimeAttack(INT32 choice); -//static void M_ChooseNightsAttack(INT32 choice); static void M_ModeAttackRetry(INT32 choice); static void M_ModeAttackEndGame(INT32 choice); static void M_SetGuestReplay(INT32 choice); -//static void M_ChoosePlayer(INT32 choice); -menu_t SP_LevelStatsDef; + static menu_t SP_TimeAttackDef, SP_ReplayDef, SP_GuestReplayDef, SP_GhostDef; -//static menu_t SP_NightsAttackDef, SP_NightsReplayDef, SP_NightsGuestReplayDef, SP_NightsGhostDef; // Multiplayer #ifndef NONET @@ -304,8 +295,8 @@ static patch_t *addonsp[NUM_EXT+5]; #define numaddonsshown 4 // Replay hut -menu_t MISC_ReplayHutDef; -menu_t MISC_ReplayOptionsDef; +menu_t EX_ReplayHutDef; +menu_t OP_ReplayOptionsDef; static void M_HandleReplayHutList(INT32 choice); static void M_DrawReplayHut(void); static void M_DrawReplayStartMenu(void); @@ -324,22 +315,17 @@ static void M_PlaybackQuit(INT32 choice); static UINT8 playback_enterheld = 0; // horrid hack to prevent holding the button from being extremely fucked // Drawing functions +static void M_DrawKartGamemodeMenu(void); static void M_DrawGenericMenu(void); -static void M_DrawGenericBackgroundMenu(void); -static void M_DrawCenteredMenu(void); static void M_DrawAddons(void); -static void M_DrawSkyRoom(void); +static void M_DrawSoundOptions(void); static void M_DrawChecklist(void); -static void M_DrawEmblemHints(void); static void M_DrawPauseMenu(void); static void M_DrawLevelSelectOnly(boolean leftfade, boolean rightfade); static void M_DrawServerMenu(void); static void M_DrawImageDef(void); -//static void M_DrawLoad(void); static void M_DrawLevelStats(void); static void M_DrawTimeAttackMenu(void); -//static void M_DrawNightsAttackMenu(void); -//static void M_DrawSetupChoosePlayerMenu(void); static void M_DrawControl(void); static void M_DrawVideoMenu(void); static void M_DrawHUDOptions(void); @@ -361,7 +347,6 @@ static void M_DrawSetupMultiPlayerMenu(void); #ifndef NONET static boolean M_CancelConnect(void); #endif -static boolean M_ExitPandorasBox(void); static boolean M_QuitMultiPlayerMenu(void); static void M_HandleAddons(INT32 choice); static void M_HandleSoundTest(INT32 choice); @@ -472,97 +457,36 @@ static consvar_t cv_dummystaff = {"dummystaff", "0", CV_HIDEN|CV_CALL, dummystaf // --------- static menuitem_t MainMenu[] = { - {IT_SUBMENU|IT_STRING, NULL, "Extras", &SR_MainDef, 76}, - //{IT_CALL |IT_STRING, NULL, "1 Player", M_SinglePlayerMenu, 84}, - {IT_CALL |IT_STRING, NULL, "Time Attack", M_TimeAttack, 84}, - {IT_SUBMENU|IT_STRING, NULL, "Multiplayer", &MP_MainDef, 92}, - {IT_CALL |IT_STRING, NULL, "Options", M_Options, 100}, - {IT_CALL |IT_STRING, NULL, "Addons", M_Addons, 108}, - {IT_CALL |IT_STRING, NULL, "Quit Game", M_QuitSRB2, 116}, + {IT_SUBMENU|IT_STRING, NULL, "Play", &PY_MainDef, 48}, + {IT_SUBMENU|IT_STRING, NULL, "Extra", &EX_MainDef, 80}, + {IT_CALL|IT_STRING, NULL, "Options", M_Options, 112}, + {IT_CALL|IT_STRING, NULL, "Quit", M_QuitSRB2, 160}, }; typedef enum { - secrets = 0, - singleplr, - multiplr, + play = 0, + extra, options, - addons, - quitdoom + quitkart } main_e; -static menuitem_t MISC_AddonsMenu[] = +static menuitem_t PlayMenu[] = { - {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleAddons, 0}, // dummy menuitem for the control func + {IT_CALL|IT_STRING, NULL, "Local Play", M_TimeAttack, 64}, + {IT_SUBMENU|IT_STRING, NULL, "Online", &MP_MainDef, 96}, + + {IT_SUBMENU|IT_STRING, NULL, "Back", &MainDef, 160}, }; -static menuitem_t MISC_ReplayHutMenu[] = -{ - {IT_KEYHANDLER|IT_NOTHING, NULL, "", M_HandleReplayHutList, 0}, // Dummy menuitem for the replay list - {IT_NOTHING, NULL, "", NULL, 0}, // Dummy for handling wrapping to the top of the menu.. -}; - -static menuitem_t MISC_ReplayStartMenu[] = -{ - {IT_CALL |IT_STRING, NULL, "Load Addons and Watch", M_HutStartReplay, 0}, - {IT_CALL |IT_STRING, NULL, "Watch Without Addons", M_HutStartReplay, 10}, - {IT_CALL |IT_STRING, NULL, "Watch Replay", M_HutStartReplay, 10}, - {IT_SUBMENU |IT_STRING, NULL, "Back", &MISC_ReplayHutDef, 30}, -}; - -static menuitem_t MISC_ReplayOptionsMenu[] = -{ - {IT_CVAR|IT_STRING, NULL, "Record Replays", &cv_recordmultiplayerdemos, 0}, - {IT_CVAR|IT_STRING, NULL, "Sync Check Interval", &cv_netdemosyncquality, 10}, -}; - -static menuitem_t PlaybackMenu[] = -{ - {IT_CALL | IT_STRING, "M_PHIDE", "Hide Menu", M_SelectableClearMenus, 0}, - - {IT_CALL | IT_STRING, "M_PREW", "Rewind", M_PlaybackRewind, 20}, - {IT_CALL | IT_STRING, "M_PPAUSE", "Pause", M_PlaybackPause, 36}, - {IT_CALL | IT_STRING, "M_PFFWD", "Fast-Forward", M_PlaybackFastForward, 52}, - {IT_CALL | IT_STRING, "M_PSTEPB", "Backup Frame", M_PlaybackRewind, 20}, - {IT_CALL | IT_STRING, "M_PRESUM", "Resume", M_PlaybackPause, 36}, - {IT_CALL | IT_STRING, "M_PFADV", "Advance Frame", M_PlaybackAdvance, 52}, - - {IT_ARROWS | IT_STRING, "M_PVIEWS", "View Count", M_PlaybackSetViews, 72}, - {IT_ARROWS | IT_STRING, "M_PNVIEW", "Viewpoint", M_PlaybackAdjustView, 88}, - {IT_ARROWS | IT_STRING, "M_PNVIEW", "Viewpoint 2", M_PlaybackAdjustView, 104}, - {IT_ARROWS | IT_STRING, "M_PNVIEW", "Viewpoint 3", M_PlaybackAdjustView, 120}, - {IT_ARROWS | IT_STRING, "M_PNVIEW", "Viewpoint 4", M_PlaybackAdjustView, 136}, - - //{IT_CALL | IT_STRING, "M_POPTS", "More Options...", M_ReplayHut, 156}, - //{IT_CALL | IT_STRING, "M_PEXIT", "Stop Playback", M_PlaybackQuit, 172}, - {IT_CALL | IT_STRING, "M_PEXIT", "Stop Playback", M_PlaybackQuit, 156}, -}; -typedef enum -{ - playback_hide, - playback_rewind, - playback_pause, - playback_fastforward, - playback_backframe, - playback_resume, - playback_advanceframe, - playback_viewcount, - playback_view1, - playback_view2, - playback_view3, - playback_view4, - //playback_moreoptions, - playback_quit -} playback_e; - // --------------------------------- // Pause Menu Mode Attacking Edition // --------------------------------- static menuitem_t MAPauseMenu[] = { - {IT_CALL | IT_STRING, NULL, "Continue", M_SelectableClearMenus,48}, - {IT_CALL | IT_STRING, NULL, "Retry", M_ModeAttackRetry, 56}, - {IT_CALL | IT_STRING, NULL, "Abort", M_ModeAttackEndGame, 64}, + {IT_CALL|IT_STRING, NULL, "Continue", M_SelectableClearMenus, 48}, + {IT_CALL|IT_STRING, NULL, "Retry", M_ModeAttackRetry, 56}, + {IT_CALL|IT_STRING, NULL, "Abort", M_ModeAttackEndGame, 64}, }; typedef enum @@ -628,11 +552,6 @@ typedef enum // --------------------- static menuitem_t SPauseMenu[] = { - // Pandora's Box will be shifted up if both options are available - {IT_CALL | IT_STRING, NULL, "Pandora's Box...", M_PandorasBox, 16}, - {IT_CALL | IT_STRING, NULL, "Medal Hints...", M_EmblemHints, 24}, - //{IT_CALL | IT_STRING, NULL, "Level Select...", M_LoadGameLevelSelect, 32}, - {IT_CALL | IT_STRING, NULL, "Continue", M_SelectableClearMenus,48}, {IT_CALL | IT_STRING, NULL, "Retry", M_Retry, 56}, {IT_CALL | IT_STRING, NULL, "Options", M_Options, 64}, @@ -643,10 +562,6 @@ static menuitem_t SPauseMenu[] = typedef enum { - spause_pandora = 0, - spause_hints, - //spause_levelselect, - spause_continue, spause_retry, spause_options, @@ -654,6 +569,160 @@ typedef enum spause_quit } spause_e; +// Playback +static menuitem_t PlaybackMenu[] = +{ + {IT_CALL | IT_STRING, "M_PHIDE", "Hide Menu", M_SelectableClearMenus, 0}, + + {IT_CALL | IT_STRING, "M_PREW", "Rewind", M_PlaybackRewind, 20}, + {IT_CALL | IT_STRING, "M_PPAUSE", "Pause", M_PlaybackPause, 36}, + {IT_CALL | IT_STRING, "M_PFFWD", "Fast-Forward", M_PlaybackFastForward, 52}, + {IT_CALL | IT_STRING, "M_PSTEPB", "Backup Frame", M_PlaybackRewind, 20}, + {IT_CALL | IT_STRING, "M_PRESUM", "Resume", M_PlaybackPause, 36}, + {IT_CALL | IT_STRING, "M_PFADV", "Advance Frame", M_PlaybackAdvance, 52}, + + {IT_ARROWS | IT_STRING, "M_PVIEWS", "View Count", M_PlaybackSetViews, 72}, + {IT_ARROWS | IT_STRING, "M_PNVIEW", "Viewpoint", M_PlaybackAdjustView, 88}, + {IT_ARROWS | IT_STRING, "M_PNVIEW", "Viewpoint 2", M_PlaybackAdjustView, 104}, + {IT_ARROWS | IT_STRING, "M_PNVIEW", "Viewpoint 3", M_PlaybackAdjustView, 120}, + {IT_ARROWS | IT_STRING, "M_PNVIEW", "Viewpoint 4", M_PlaybackAdjustView, 136}, + + //{IT_CALL | IT_STRING, "M_POPTS", "More Options...", M_ReplayHut, 156}, + //{IT_CALL | IT_STRING, "M_PEXIT", "Stop Playback", M_PlaybackQuit, 172}, + {IT_CALL | IT_STRING, "M_PEXIT", "Stop Playback", M_PlaybackQuit, 156}, +}; + +typedef enum +{ + playback_hide, + playback_rewind, + playback_pause, + playback_fastforward, + playback_backframe, + playback_resume, + playback_advanceframe, + playback_viewcount, + playback_view1, + playback_view2, + playback_view3, + playback_view4, + //playback_moreoptions, + playback_quit +} playback_e; + +// PLAY + +// Single Player Time Attack +static menuitem_t SP_TimeAttackMenu[] = +{ + {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Name", &cv_playername, 0}, + {IT_STRING|IT_CVAR, NULL, "Character", &cv_chooseskin, 13}, + {IT_STRING|IT_CVAR, NULL, "Color", &cv_playercolor, 26}, + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, + + {IT_DISABLED, NULL, "Guest...", &SP_GuestReplayDef, 98}, + {IT_DISABLED, NULL, "Replay...", &SP_ReplayDef, 108}, + {IT_WHITESTRING|IT_SUBMENU, NULL, "Ghosts...", &SP_GhostDef, 118}, + {IT_WHITESTRING|IT_CALL|IT_CALL_NOTMODIFIED, NULL, "Start", M_ChooseTimeAttack, 130}, +}; + +enum +{ + taname, + taplayer, + tacolor, + talevel, + + taguest, + tareplay, + taghost, + tastart +}; + +static menuitem_t SP_ReplayMenu[] = +{ + {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Time", M_ReplayTimeAttack, 90}, + {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Lap", M_ReplayTimeAttack, 98}, + + {IT_WHITESTRING|IT_CALL, NULL, "Replay Last", M_ReplayTimeAttack, 106}, + {IT_WHITESTRING|IT_CALL, NULL, "Replay Guest", M_ReplayTimeAttack, 114}, + {IT_WHITESTRING|IT_KEYHANDLER, NULL, "Replay Staff",M_HandleStaffReplay,122}, + + {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 130} +}; + + +static menuitem_t SP_GuestReplayMenu[] = +{ + {IT_WHITESTRING|IT_CALL, NULL, "Save Best Time as Guest", M_SetGuestReplay, 94}, + {IT_WHITESTRING|IT_CALL, NULL, "Save Best Lap as Guest", M_SetGuestReplay,102}, + {IT_WHITESTRING|IT_CALL, NULL, "Save Last as Guest", M_SetGuestReplay,110}, + + {IT_WHITESTRING|IT_CALL, NULL, "Delete Guest Replay", M_SetGuestReplay,120}, + + {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 130} +}; + + +static menuitem_t SP_GhostMenu[] = +{ + {IT_STRING|IT_CVAR, NULL, "Best Time", &cv_ghost_besttime, 88}, + {IT_STRING|IT_CVAR, NULL, "Best Lap", &cv_ghost_bestlap, 96}, + {IT_STRING|IT_CVAR, NULL, "Last", &cv_ghost_last, 104}, + {IT_DISABLED, NULL, "Guest", &cv_ghost_guest, 112}, + {IT_DISABLED, NULL, "Staff Attack",&cv_ghost_staff, 120}, + + {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 130} +}; + +// EXTRAS + +static menuitem_t EX_MainMenu[] = +{ + {IT_STRING|IT_SUBMENU, NULL, "Unlocks", &EX_UnlockChecklistDef, 32}, + {IT_STRING|IT_CALL|IT_CALL_NOTMODIFIED, NULL, "Stats", M_Statistics, 64}, + {IT_STRING|IT_CALL, NULL, "Addons", M_Addons, 96}, + {IT_STRING|IT_CALL, NULL, "Replays", M_ReplayHut, 128}, + {IT_STRING|IT_SUBMENU, NULL, "Back", &MainDef, 160}, +}; + +static menuitem_t EX_UnlockChecklistMenu[] = +{ + {IT_SUBMENU|IT_STRING, NULL, "Back", &EX_MainDef, 200}, +}; + +static menuitem_t EX_LevelStatsMenu[] = +{ + {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelStats, '\0'}, // dummy menuitem for the control func +}; + +static menuitem_t EX_AddonsMenu[] = +{ + {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleAddons, 0}, // dummy menuitem for the control func +}; + +static menuitem_t EX_ReplayHutMenu[] = +{ + {IT_KEYHANDLER|IT_NOTHING, NULL, "", M_HandleReplayHutList, 0}, // Dummy menuitem for the replay list + {IT_NOTHING, NULL, "", NULL, 0}, // Dummy for handling wrapping to the top of the menu.. +}; + +static menuitem_t EX_ReplayStartMenu[] = +{ + {IT_CALL |IT_STRING, NULL, "Load Addons and Watch", M_HutStartReplay, 0}, + {IT_CALL |IT_STRING, NULL, "Watch Without Addons", M_HutStartReplay, 10}, + {IT_CALL |IT_STRING, NULL, "Watch Replay", M_HutStartReplay, 10}, + {IT_SUBMENU |IT_STRING, NULL, "Back", &EX_ReplayHutDef, 30}, +}; + +// OPTIONS + +static menuitem_t OP_ReplayOptionsMenu[] = +{ + {IT_CVAR|IT_STRING, NULL, "Record Replays", &cv_recordmultiplayerdemos, 0}, + {IT_CVAR|IT_STRING, NULL, "Sync Check Interval", &cv_netdemosyncquality, 10}, +}; + // ----------------- // Misc menu options // ----------------- @@ -703,244 +772,12 @@ static menuitem_t MISC_HelpMenu[] = {IT_KEYHANDLER | IT_NOTHING, NULL, "MANUAL99", M_HandleImageDef, 0}, }; -// -------------------------------- -// Sky Room and all of its submenus -// -------------------------------- -// Prefix: SR_ - -// Pause Menu Pandora's Box Options -static menuitem_t SR_PandorasBox[] = -{ - {IT_STRING | IT_CVAR, NULL, "Rings", &cv_dummyrings, 20}, - {IT_STRING | IT_CVAR, NULL, "Lives", &cv_dummylives, 30}, - {IT_STRING | IT_CVAR, NULL, "Continues", &cv_dummycontinues, 40}, - - {IT_STRING | IT_CVAR, NULL, "Gravity", &cv_gravity, 60}, - {IT_STRING | IT_CVAR, NULL, "Throw Rings", &cv_ringslinger, 70}, - - {IT_STRING | IT_CALL, NULL, "Get All Emeralds", M_GetAllEmeralds, 90}, - {IT_STRING | IT_CALL, NULL, "Destroy All Robots", M_DestroyRobots, 100}, - - {IT_STRING | IT_CALL, NULL, "Ultimate Cheat", M_UltimateCheat, 130}, -}; - -// Sky Room Custom Unlocks -static menuitem_t SR_MainMenu[] = -{ - {IT_STRING|IT_SUBMENU, NULL, "Unlockables", &SR_UnlockChecklistDef, 100}, - {IT_CALL|IT_STRING|IT_CALL_NOTMODIFIED, NULL, "Statistics", M_Statistics, 108}, - {IT_CALL|IT_STRING, NULL, "Replay Hut", M_ReplayHut, 116}, - {IT_DISABLED, NULL, "", NULL, 0}, // Custom1 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom2 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom3 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom4 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom5 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom6 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom7 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom8 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom9 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom10 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom11 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom12 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom13 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom14 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom15 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom16 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom17 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom18 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom19 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom20 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom21 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom22 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom23 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom24 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom25 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom26 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom27 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom28 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom29 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom30 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom31 - {IT_DISABLED, NULL, "", NULL, 0}, // Custom32 - -}; - -/*static menuitem_t SR_LevelSelectMenu[] = -{ - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 130}, -};*/ - -static menuitem_t SR_UnlockChecklistMenu[] = -{ - {IT_SUBMENU | IT_STRING, NULL, "NEXT", &MainDef, 192}, -}; - -static menuitem_t SR_EmblemHintMenu[] = -{ - {IT_STRING|IT_CVAR, NULL, "Medal Radar", &cv_itemfinder, 10}, - {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SPauseDef, 20} -}; - // -------------------------------- // 1 Player and all of its submenus // -------------------------------- // Prefix: SP_ -// Single Player Main -static menuitem_t SP_MainMenu[] = -{ - //{IT_CALL | IT_STRING, NULL, "Start Game", M_LoadGame, 92}, - {IT_SECRET, NULL, "Record Attack", M_TimeAttack, 100}, - //{IT_SECRET, NULL, "NiGHTS Mode", M_NightsAttack, 108}, - {IT_CALL | IT_STRING | IT_CALL_NOTMODIFIED, NULL, "Statistics", M_Statistics, 108}, -}; -enum -{ - //sploadgame, - sprecordattack, - //spnightsmode, - spstatistics -}; - -// Single Player Load Game -/*static menuitem_t SP_LoadGameMenu[] = -{ - {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLoadSave, '\0'}, // dummy menuitem for the control func -}; - -// Single Player Level Select -static menuitem_t SP_LevelSelectMenu[] = -{ - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 130}, -};*/ - -// Single Player Time Attack -static menuitem_t SP_TimeAttackMenu[] = -{ - {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Name", &cv_playername, 0}, - {IT_STRING|IT_CVAR, NULL, "Character", &cv_chooseskin, 13}, - {IT_STRING|IT_CVAR, NULL, "Color", &cv_playercolor, 26}, - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, - - {IT_DISABLED, NULL, "Guest...", &SP_GuestReplayDef, 98}, - {IT_DISABLED, NULL, "Replay...", &SP_ReplayDef, 108}, - {IT_WHITESTRING|IT_SUBMENU, NULL, "Ghosts...", &SP_GhostDef, 118}, - {IT_WHITESTRING|IT_CALL|IT_CALL_NOTMODIFIED, NULL, "Start", M_ChooseTimeAttack, 130}, -}; - -enum -{ - taname, - taplayer, - tacolor, - talevel, - - taguest, - tareplay, - taghost, - tastart -}; - -static menuitem_t SP_ReplayMenu[] = -{ - {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Time", M_ReplayTimeAttack, 90}, - {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Lap", M_ReplayTimeAttack, 98}, - - {IT_WHITESTRING|IT_CALL, NULL, "Replay Last", M_ReplayTimeAttack, 106}, - {IT_WHITESTRING|IT_CALL, NULL, "Replay Guest", M_ReplayTimeAttack, 114}, - {IT_WHITESTRING|IT_KEYHANDLER, NULL, "Replay Staff",M_HandleStaffReplay,122}, - - {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 130} -}; - -/*static menuitem_t SP_NightsReplayMenu[] = -{ - {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Score", M_ReplayTimeAttack, 0}, - {IT_WHITESTRING|IT_CALL, NULL, "Replay Best Time", M_ReplayTimeAttack,16}, - - {IT_WHITESTRING|IT_CALL, NULL, "Replay Last", M_ReplayTimeAttack,21}, - {IT_WHITESTRING|IT_CALL, NULL, "Replay Guest", M_ReplayTimeAttack,29}, - {IT_WHITESTRING|IT_KEYHANDLER, NULL, "Replay Staff",M_HandleStaffReplay,37}, - - {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_NightsAttackDef, 50} -};*/ - -static menuitem_t SP_GuestReplayMenu[] = -{ - {IT_WHITESTRING|IT_CALL, NULL, "Save Best Time as Guest", M_SetGuestReplay, 94}, - {IT_WHITESTRING|IT_CALL, NULL, "Save Best Lap as Guest", M_SetGuestReplay,102}, - {IT_WHITESTRING|IT_CALL, NULL, "Save Last as Guest", M_SetGuestReplay,110}, - - {IT_WHITESTRING|IT_CALL, NULL, "Delete Guest Replay", M_SetGuestReplay,120}, - - {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 130} -}; - -/*static menuitem_t SP_NightsGuestReplayMenu[] = -{ - {IT_WHITESTRING|IT_CALL, NULL, "Save Best Score as Guest", M_SetGuestReplay, 8}, - {IT_WHITESTRING|IT_CALL, NULL, "Save Best Time as Guest", M_SetGuestReplay,16}, - {IT_WHITESTRING|IT_CALL, NULL, "Save Last as Guest", M_SetGuestReplay,24}, - - {IT_WHITESTRING|IT_CALL, NULL, "Delete Guest Replay", M_SetGuestReplay,37}, - - {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_NightsAttackDef, 50} -};*/ - -static menuitem_t SP_GhostMenu[] = -{ - {IT_STRING|IT_CVAR, NULL, "Best Time", &cv_ghost_besttime, 88}, - {IT_STRING|IT_CVAR, NULL, "Best Lap", &cv_ghost_bestlap, 96}, - {IT_STRING|IT_CVAR, NULL, "Last", &cv_ghost_last, 104}, - {IT_DISABLED, NULL, "Guest", &cv_ghost_guest, 112}, - {IT_DISABLED, NULL, "Staff Attack",&cv_ghost_staff, 120}, - - {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_TimeAttackDef, 130} -}; - -/*static menuitem_t SP_NightsGhostMenu[] = -{ - {IT_STRING|IT_CVAR, NULL, "Best Score", &cv_ghost_bestscore, 0}, - {IT_STRING|IT_CVAR, NULL, "Best Time", &cv_ghost_besttime, 8}, - {IT_STRING|IT_CVAR, NULL, "Last", &cv_ghost_last, 16}, - - {IT_STRING|IT_CVAR, NULL, "Guest", &cv_ghost_guest, 29}, - {IT_STRING|IT_CVAR, NULL, "Staff Attack",&cv_ghost_staff, 37}, - - {IT_WHITESTRING|IT_SUBMENU, NULL, "Back", &SP_NightsAttackDef, 50} -};*/ - -// Single Player Nights Attack -/*static menuitem_t SP_NightsAttackMenu[] = -{ - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 44}, - {IT_STRING|IT_CVAR, NULL, "Show Records For", &cv_dummymares, 54}, - - {IT_DISABLED, NULL, "Guest Option...", &SP_NightsGuestReplayDef, 108}, - {IT_DISABLED, NULL, "Replay...", &SP_NightsReplayDef, 118}, - {IT_DISABLED, NULL, "Ghosts...", &SP_NightsGhostDef, 128}, - {IT_WHITESTRING|IT_CALL|IT_CALL_NOTMODIFIED, NULL, "Start", M_ChooseNightsAttack, 138}, -};*/ - -enum -{ - nalevel, - narecords, - - naguest, - nareplay, - naghost, - nastart -}; - -// Statistics -static menuitem_t SP_LevelStatsMenu[] = -{ - {IT_KEYHANDLER | IT_NOTHING, NULL, "", M_HandleLevelStats, '\0'}, // dummy menuitem for the control func -}; // A rare case. // External files modify this menu, so we can't call it static. @@ -1363,7 +1200,7 @@ static menuitem_t OP_DataOptionsMenu[] = { {IT_STRING | IT_CALL, NULL, "Screenshot Options...", M_ScreenshotOptions, 10}, {IT_STRING | IT_CALL, NULL, "Add-on Options...", M_AddonsOptions, 20}, - {IT_STRING | IT_SUBMENU, NULL, "Replay Options...", &MISC_ReplayOptionsDef, 30}, + {IT_STRING | IT_SUBMENU, NULL, "Replay Options...", &OP_ReplayOptionsDef, 30}, {IT_STRING | IT_SUBMENU, NULL, "Erase Data...", &OP_EraseDataDef, 50}, }; @@ -1602,55 +1439,8 @@ static menuitem_t OP_MonitorToggleMenu[] = // ========================================================================== // Main Menu and related -menu_t MainDef = CENTERMENUSTYLE(NULL, MainMenu, NULL, 72); - -menu_t MISC_AddonsDef = -{ - NULL, - sizeof (MISC_AddonsMenu)/sizeof (menuitem_t), - &OP_DataOptionsDef, - MISC_AddonsMenu, - M_DrawAddons, - 50, 28, - 0, - NULL -}; - -menu_t MISC_ReplayHutDef = -{ - NULL, - sizeof (MISC_ReplayHutMenu)/sizeof (menuitem_t), - NULL, - MISC_ReplayHutMenu, - M_DrawReplayHut, - 30, 80, - 0, - M_QuitReplayHut -}; - -menu_t MISC_ReplayOptionsDef = -{ - "M_REPOPT", - sizeof (MISC_ReplayOptionsMenu)/sizeof (menuitem_t), - &OP_DataOptionsDef, - MISC_ReplayOptionsMenu, - M_DrawGenericMenu, - 27, 40, - 0, - NULL -}; - -menu_t MISC_ReplayStartDef = -{ - NULL, - sizeof (MISC_ReplayStartMenu)/sizeof (menuitem_t), - &MISC_ReplayHutDef, - MISC_ReplayStartMenu, - M_DrawReplayStartMenu, - 30, 90, - 0, - NULL -}; +menu_t MainDef = KARTGAMEMODEMENU(NULL, MainMenu, NULL); +menu_t PY_MainDef = KARTGAMEMODEMENU(NULL, PlayMenu, &MainDef); menu_t PlaybackMenuDef = { NULL, @@ -1668,257 +1458,16 @@ menu_t MAPauseDef = PAUSEMENUSTYLE(MAPauseMenu, 40, 72); menu_t SPauseDef = PAUSEMENUSTYLE(SPauseMenu, 40, 72); menu_t MPauseDef = PAUSEMENUSTYLE(MPauseMenu, 40, 72); -// Misc Main Menu +// MISC menus + menu_t MISC_ScrambleTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ScrambleTeamMenu, &MPauseDef, 27, 40); menu_t MISC_ChangeTeamDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeTeamMenu, &MPauseDef, 27, 40); menu_t MISC_ChangeSpectateDef = DEFAULTMENUSTYLE(NULL, MISC_ChangeSpectateMenu, &MPauseDef, 27, 40); menu_t MISC_ChangeLevelDef = MAPICONMENUSTYLE(NULL, MISC_ChangeLevelMenu, &MPauseDef); menu_t MISC_HelpDef = IMAGEDEF(MISC_HelpMenu); -// -// M_GetGametypeColor -// -// Pretty and consistent ^u^ -// See also G_GetGametypeColor. -// +// PLAY MENU -static INT32 highlightflags, recommendedflags, warningflags; - -inline static void M_GetGametypeColor(void) -{ - INT16 gt; - - warningflags = V_REDMAP; - recommendedflags = V_GREENMAP; - - if (cons_menuhighlight.value) - { - highlightflags = cons_menuhighlight.value; - if (highlightflags == V_REDMAP) - { - warningflags = V_ORANGEMAP; - return; - } - if (highlightflags == V_GREENMAP) - { - recommendedflags = V_SKYMAP; - return; - } - return; - } - - warningflags = V_REDMAP; - recommendedflags = V_GREENMAP; - - if (modeattacking // == ATTACKING_RECORD - || gamestate == GS_TIMEATTACK) - { - highlightflags = V_ORANGEMAP; - return; - } - - if (currentMenu->drawroutine == M_DrawServerMenu) - gt = cv_newgametype.value; - else if (!Playing()) - { - highlightflags = V_YELLOWMAP; - return; - } - else - gt = gametype; - - if (gt == GT_MATCH) - { - highlightflags = V_REDMAP; - warningflags = V_ORANGEMAP; - return; - } - if (gt == GT_RACE) - { - highlightflags = V_SKYMAP; - return; - } - - highlightflags = V_YELLOWMAP; // FALLBACK -} - -// excuse me but I'm extremely lazy: -INT32 HU_GetHighlightColor(void) -{ - M_GetGametypeColor(); // update flag colour reguardless of the menu being opened or not. - return highlightflags; -} - -// Sky Room -menu_t SR_PandoraDef = -{ - "M_PANDRA", - sizeof (SR_PandorasBox)/sizeof (menuitem_t), - &SPauseDef, - SR_PandorasBox, - M_DrawGenericMenu, - 60, 40, - 0, - M_ExitPandorasBox -}; -menu_t SR_MainDef = CENTERMENUSTYLE(NULL, SR_MainMenu, &MainDef, 72); - -//menu_t SR_LevelSelectDef = MAPICONMENUSTYLE(NULL, SR_LevelSelectMenu, &SR_MainDef); - -menu_t SR_UnlockChecklistDef = -{ - NULL, - 1, - &SR_MainDef, - SR_UnlockChecklistMenu, - M_DrawChecklist, - 280, 185, - 0, - NULL -}; -menu_t SR_EmblemHintDef = -{ - NULL, - sizeof (SR_EmblemHintMenu)/sizeof (menuitem_t), - &SPauseDef, - SR_EmblemHintMenu, - M_DrawEmblemHints, - 60, 150, - 0, - NULL -}; - -// Single Player -menu_t SP_MainDef = CENTERMENUSTYLE(NULL, SP_MainMenu, &MainDef, 72); -/*menu_t SP_LoadDef = -{ - "M_PICKG", - 1, - &SP_MainDef, - SP_LoadGameMenu, - M_DrawLoad, - 68, 46, - 0, - NULL -}; -menu_t SP_LevelSelectDef = MAPICONMENUSTYLE(NULL, SP_LevelSelectMenu, &SP_LoadDef);*/ - -menu_t SP_LevelStatsDef = -{ - "M_STATS", - 1, - &SR_MainDef, - SP_LevelStatsMenu, - M_DrawLevelStats, - 280, 185, - 0, - NULL -}; - -static menu_t SP_TimeAttackDef = -{ - "M_ATTACK", - sizeof (SP_TimeAttackMenu)/sizeof (menuitem_t), - &MainDef, // Doesn't matter. - SP_TimeAttackMenu, - M_DrawTimeAttackMenu, - 34, 40, - 0, - M_QuitTimeAttackMenu -}; -static menu_t SP_ReplayDef = -{ - "M_ATTACK", - sizeof(SP_ReplayMenu)/sizeof(menuitem_t), - &SP_TimeAttackDef, - SP_ReplayMenu, - M_DrawTimeAttackMenu, - 34, 40, - 0, - NULL -}; -static menu_t SP_GuestReplayDef = -{ - "M_ATTACK", - sizeof(SP_GuestReplayMenu)/sizeof(menuitem_t), - &SP_TimeAttackDef, - SP_GuestReplayMenu, - M_DrawTimeAttackMenu, - 34, 40, - 0, - NULL -}; -static menu_t SP_GhostDef = -{ - "M_ATTACK", - sizeof(SP_GhostMenu)/sizeof(menuitem_t), - &SP_TimeAttackDef, - SP_GhostMenu, - M_DrawTimeAttackMenu, - 34, 40, - 0, - NULL -}; - -/*static menu_t SP_NightsAttackDef = -{ - "M_NIGHTS", - sizeof (SP_NightsAttackMenu)/sizeof (menuitem_t), - &MainDef, // Doesn't matter. - SP_NightsAttackMenu, - M_DrawNightsAttackMenu, - 32, 40, - 0, - NULL -}; -static menu_t SP_NightsReplayDef = -{ - "M_NIGHTS", - sizeof(SP_NightsReplayMenu)/sizeof(menuitem_t), - &SP_NightsAttackDef, - SP_NightsReplayMenu, - M_DrawNightsAttackMenu, - 32, 120, - 0, - NULL -}; -static menu_t SP_NightsGuestReplayDef = -{ - "M_NIGHTS", - sizeof(SP_NightsGuestReplayMenu)/sizeof(menuitem_t), - &SP_NightsAttackDef, - SP_NightsGuestReplayMenu, - M_DrawNightsAttackMenu, - 32, 120, - 0, - NULL -}; -static menu_t SP_NightsGhostDef = -{ - "M_NIGHTS", - sizeof(SP_NightsGhostMenu)/sizeof(menuitem_t), - &SP_NightsAttackDef, - SP_NightsGhostMenu, - M_DrawNightsAttackMenu, - 32, 120, - 0, - NULL -};*/ - - -/*menu_t SP_PlayerDef = -{ - "M_PICKP", - sizeof (PlayerMenu)/sizeof (menuitem_t),//player_end, - &SP_MainDef, - PlayerMenu, - M_DrawSetupChoosePlayerMenu, - 24, 32, - 0, - NULL -};*/ - -// Multiplayer menu_t MP_MainDef = { "M_MULTI", @@ -1975,6 +1524,120 @@ menu_t MP_PlayerSetupDef = M_QuitMultiPlayerMenu }; + +// TIME ATTACK + +static menu_t SP_TimeAttackDef = +{ + "M_ATTACK", + sizeof (SP_TimeAttackMenu)/sizeof (menuitem_t), + &PY_MainDef, + SP_TimeAttackMenu, + M_DrawTimeAttackMenu, + 34, 40, + 0, + M_QuitTimeAttackMenu +}; + +static menu_t SP_ReplayDef = +{ + NULL, + sizeof(SP_ReplayMenu)/sizeof(menuitem_t), + &EX_MainDef, + SP_ReplayMenu, + M_DrawTimeAttackMenu, + 34, 40, + 0, + NULL +}; + +static menu_t SP_GuestReplayDef = +{ + "M_ATTACK", + sizeof(SP_GuestReplayMenu)/sizeof(menuitem_t), + &SP_TimeAttackDef, + SP_GuestReplayMenu, + M_DrawTimeAttackMenu, + 34, 40, + 0, + NULL +}; + +static menu_t SP_GhostDef = +{ + "M_ATTACK", + sizeof(SP_GhostMenu)/sizeof(menuitem_t), + &SP_TimeAttackDef, + SP_GhostMenu, + M_DrawTimeAttackMenu, + 34, 40, + 0, + NULL +}; + +// EXTRAS MENU +menu_t EX_MainDef = KARTGAMEMODEMENU(NULL, EX_MainMenu, &MainDef); + +menu_t EX_UnlockChecklistDef = +{ + NULL, + 1, + &EX_MainDef, + EX_UnlockChecklistMenu, + M_DrawChecklist, + 280, 185, + 0, + NULL +}; + +menu_t EX_LevelStatsDef = +{ + NULL, + 1, + &EX_MainDef, + EX_LevelStatsMenu, + M_DrawLevelStats, + 280, 185, + 0, + NULL +}; + +menu_t EX_AddonsDef = +{ + NULL, + sizeof (EX_AddonsMenu)/sizeof (menuitem_t), + &EX_MainDef, + EX_AddonsMenu, + M_DrawAddons, + 50, 28, + 0, + NULL +}; + +menu_t EX_ReplayHutDef = +{ + NULL, + sizeof (EX_ReplayHutMenu)/sizeof (menuitem_t), + &EX_MainDef, + EX_ReplayHutMenu, + M_DrawReplayHut, + 30, 80, + 0, + M_QuitReplayHut +}; + +menu_t EX_ReplayStartDef = +{ + NULL, + sizeof (EX_ReplayStartMenu)/sizeof (menuitem_t), + &EX_ReplayHutDef, + EX_ReplayStartMenu, + M_DrawReplayStartMenu, + 30, 90, + 0, + NULL +}; + // Options menu_t OP_MainDef = { @@ -2036,7 +1699,7 @@ menu_t OP_SoundOptionsDef = sizeof (OP_SoundOptionsMenu)/sizeof (menuitem_t), &OP_MainDef, OP_SoundOptionsMenu, - M_DrawSkyRoom, + M_DrawSoundOptions, 30, 30, 0, NULL @@ -2110,6 +1773,91 @@ menu_t OP_ScreenshotOptionsDef = DEFAULTMENUSTYLE("M_SCSHOT", OP_ScreenshotOptio menu_t OP_AddonsOptionsDef = DEFAULTMENUSTYLE("M_ADDONS", OP_AddonsOptionsMenu, &OP_DataOptionsDef, 30, 30); menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 30, 30); +menu_t OP_ReplayOptionsDef = +{ + "M_REPOPT", + sizeof (OP_ReplayOptionsMenu)/sizeof (menuitem_t), + &OP_DataOptionsDef, + OP_ReplayOptionsMenu, + M_DrawGenericMenu, + 27, 40, + 0, + NULL +}; + +// +// M_GetGametypeColor +// +// Pretty and consistent ^u^ +// See also G_GetGametypeColor. +// + +static INT32 highlightflags, recommendedflags, warningflags; + +inline static void M_GetGametypeColor(void) +{ + INT16 gt; + + warningflags = V_REDMAP; + recommendedflags = V_GREENMAP; + + if (cons_menuhighlight.value) + { + highlightflags = cons_menuhighlight.value; + if (highlightflags == V_REDMAP) + { + warningflags = V_ORANGEMAP; + return; + } + if (highlightflags == V_GREENMAP) + { + recommendedflags = V_SKYMAP; + return; + } + return; + } + + warningflags = V_REDMAP; + recommendedflags = V_GREENMAP; + + if (modeattacking) // == ATTACKING_RECORD + { + highlightflags = V_ORANGEMAP; + return; + } + + if (currentMenu->drawroutine == M_DrawServerMenu) + gt = cv_newgametype.value; + else if (!Playing()) + { + highlightflags = V_YELLOWMAP; + return; + } + else + gt = gametype; + + if (gt == GT_MATCH) + { + highlightflags = V_REDMAP; + warningflags = V_ORANGEMAP; + return; + } + if (gt == GT_RACE) + { + highlightflags = V_SKYMAP; + return; + } + + highlightflags = V_YELLOWMAP; // FALLBACK +} + +// excuse me but I'm extremely lazy: +INT32 HU_GetHighlightColor(void) +{ + M_GetGametypeColor(); // update flag colour reguardless of the menu being opened or not. + return highlightflags; +} + // ========================================================================== // CVAR ONCHANGE EVENTS GO HERE // ========================================================================== @@ -2738,7 +2486,7 @@ boolean M_Responder(event_t *ev) if (currentMenu->menuitems[itemOn].status == IT_MSGHANDLER) { - if (currentMenu->menuitems[itemOn].alphaKey != MM_EVENTHANDLER) + if (currentMenu->menuitems[itemOn].mvar1 != MM_EVENTHANDLER) { if (ch == ' ' || ch == 'n' || ch == 'y' || ch == KEY_ESCAPE || ch == KEY_ENTER) { @@ -2898,14 +2646,7 @@ boolean M_Responder(event_t *ev) multiplayer = false; } - if (currentMenu == &SP_TimeAttackDef) //|| currentMenu == &SP_NightsAttackDef - { - // D_StartTitle does its own wipe, since GS_TIMEATTACK is now a complete gamestate. - menuactive = false; - D_StartTitle(); - } - else - M_SetupNextMenu(currentMenu->prevMenu); + M_SetupNextMenu(currentMenu->prevMenu); } else M_ClearMenus(true); @@ -2916,7 +2657,7 @@ boolean M_Responder(event_t *ev) if ((currentMenu->menuitems[itemOn].status) == IT_CONTROL) { // detach any keys associated with the game control - G_ClearControlKeys(setupcontrols, currentMenu->menuitems[itemOn].alphaKey); + G_ClearControlKeys(setupcontrols, currentMenu->menuitems[itemOn].mvar1); S_StartSound(NULL, sfx_shldls); return true; } @@ -2961,11 +2702,18 @@ void M_Drawer(void) if (currentMenu == &MessageDef) menuactive = true; + if (menuwipe) + F_WipeStartScreen(); + if (menuactive) { - // now that's more readable with a faded background (yeah like Quake...) - if (!WipeInAction && currentMenu != &PlaybackMenuDef) // Replay playback has its own background - V_DrawFadeScreen(0xFF00, 16); + if (gamestate == GS_MENU) // draw BG + { + V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("WEIRDRES", PU_CACHE), NULL); + V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUBG", PU_CACHE), NULL); + } + else if (!WipeInAction && currentMenu != &PlaybackMenuDef) // Replay playback has its own background + V_DrawFadeScreen(0xFF00, 16); // now that's more readable with a faded background (yeah like Quake...) if (currentMenu->drawroutine) { @@ -2994,6 +2742,13 @@ void M_Drawer(void) } } + if (menuwipe) + { + F_WipeEndScreen(); + F_RunWipe(wipedefs[wipe_menu_final], false, "FADEMAP0", true); + menuwipe = false; + } + // focus lost notification goes on top of everything, even the former everything if (window_notinfocus && cv_showfocuslost.value) { @@ -3017,6 +2772,17 @@ void M_StartControlPanel(void) return; } + if (gamestate == GS_TITLESCREEN) // Set up menu state + { + G_SetGamestate(GS_MENU); + + gameaction = ga_nothing; + paused = false; + CON_ToggleOff(); + + S_ChangeMusicInternal("menu", true); + } + menuactive = true; if (demo.playback) @@ -3025,11 +2791,8 @@ void M_StartControlPanel(void) } else if (!Playing()) { - // Secret menu! - //MainMenu[secrets].status = (M_AnySecretUnlocked()) ? (IT_STRING | IT_CALL) : (IT_DISABLED); - currentMenu = &MainDef; - itemOn = singleplr; + itemOn = 0; } else if (modeattacking) { @@ -3038,17 +2801,12 @@ void M_StartControlPanel(void) } else if (!(netgame || multiplayer)) // Single Player { - if (gamestate != GS_LEVEL /*|| ultimatemode*/) // intermission, so gray out stuff. - { - SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA)) ? (IT_GRAYEDOUT) : (IT_DISABLED); + if (gamestate != GS_LEVEL) // intermission, so gray out stuff. SPauseMenu[spause_retry].status = IT_GRAYEDOUT; - } else { //INT32 numlives = 2; - SPauseMenu[spause_pandora].status = (M_SecretUnlocked(SECRET_PANDORA)) ? (IT_STRING | IT_CALL) : (IT_DISABLED); - /*if (&players[consoleplayer]) { numlives = players[consoleplayer].lives; @@ -3064,19 +2822,6 @@ void M_StartControlPanel(void) SPauseMenu[spause_retry].status = (IT_STRING | IT_CALL); } - // We can always use level select though. :33 - //SPauseMenu[spause_levelselect].status = (gamecomplete) ? (IT_STRING | IT_CALL) : (IT_DISABLED); - - // And emblem hints. - SPauseMenu[spause_hints].status = (M_SecretUnlocked(SECRET_EMBLEMHINTS)) ? (IT_STRING | IT_CALL) : (IT_DISABLED); - - // Shift up Pandora's Box if both pandora and levelselect are active - /*if (SPauseMenu[spause_pandora].status != (IT_DISABLED) - && SPauseMenu[spause_levelselect].status != (IT_DISABLED)) - SPauseMenu[spause_pandora].alphaKey = 24; - else - SPauseMenu[spause_pandora].alphaKey = 32;*/ - currentMenu = &SPauseDef; itemOn = spause_continue; } @@ -3098,11 +2843,11 @@ void M_StartControlPanel(void) MISC_ChangeTeamMenu[0].status = IT_DISABLED; MISC_ChangeSpectateMenu[0].status = IT_DISABLED; // Reset these in case splitscreen messes things up - MPauseMenu[mpause_switchteam].alphaKey = 48; - MPauseMenu[mpause_switchspectate].alphaKey = 48; - MPauseMenu[mpause_options].alphaKey = 64; - MPauseMenu[mpause_title].alphaKey = 80; - MPauseMenu[mpause_quit].alphaKey = 88; + MPauseMenu[mpause_switchteam].mvar1 = 48; + MPauseMenu[mpause_switchspectate].mvar1 = 48; + MPauseMenu[mpause_options].mvar1 = 64; + MPauseMenu[mpause_title].mvar1 = 80; + MPauseMenu[mpause_quit].mvar1 = 88; Dummymenuplayer_OnChange(); if ((server || IsPlayerAdmin(consoleplayer))) @@ -3123,18 +2868,18 @@ void M_StartControlPanel(void) if (G_GametypeHasTeams()) { MPauseMenu[mpause_switchteam].status = IT_STRING | IT_SUBMENU; - MPauseMenu[mpause_switchteam].alphaKey += ((splitscreen+1) * 8); - MPauseMenu[mpause_options].alphaKey += 8; - MPauseMenu[mpause_title].alphaKey += 8; - MPauseMenu[mpause_quit].alphaKey += 8; + MPauseMenu[mpause_switchteam].mvar1 += ((splitscreen+1) * 8); + MPauseMenu[mpause_options].mvar1 += 8; + MPauseMenu[mpause_title].mvar1 += 8; + MPauseMenu[mpause_quit].mvar1 += 8; } else if (G_GametypeHasSpectators()) { MPauseMenu[mpause_switchspectate].status = IT_STRING | IT_SUBMENU; - MPauseMenu[mpause_switchspectate].alphaKey += ((splitscreen+1) * 8); - MPauseMenu[mpause_options].alphaKey += 8; - MPauseMenu[mpause_title].alphaKey += 8; - MPauseMenu[mpause_quit].alphaKey += 8; + MPauseMenu[mpause_switchspectate].mvar1 += ((splitscreen+1) * 8); + MPauseMenu[mpause_options].mvar1 += 8; + MPauseMenu[mpause_title].mvar1 += 8; + MPauseMenu[mpause_quit].mvar1 += 8; } } @@ -3142,16 +2887,16 @@ void M_StartControlPanel(void) { MPauseMenu[mpause_psetupsplit3].status = IT_STRING | IT_CALL; - MPauseMenu[mpause_options].alphaKey += 8; - MPauseMenu[mpause_title].alphaKey += 8; - MPauseMenu[mpause_quit].alphaKey += 8; + MPauseMenu[mpause_options].mvar1 += 8; + MPauseMenu[mpause_title].mvar1 += 8; + MPauseMenu[mpause_quit].mvar1 += 8; if (splitscreen > 2) { MPauseMenu[mpause_psetupsplit4].status = IT_STRING | IT_CALL; - MPauseMenu[mpause_options].alphaKey += 8; - MPauseMenu[mpause_title].alphaKey += 8; - MPauseMenu[mpause_quit].alphaKey += 8; + MPauseMenu[mpause_options].mvar1 += 8; + MPauseMenu[mpause_title].mvar1 += 8; + MPauseMenu[mpause_quit].mvar1 += 8; } } } @@ -3203,6 +2948,10 @@ void M_ClearMenus(boolean callexitmenufunc) if (currentMenu == &MessageDef) // Oh sod off! currentMenu = &MainDef; // Not like it matters + + if (gamestate == GS_MENU) // Back to title screen + D_StartTitle(); + menuactive = false; } @@ -3213,12 +2962,22 @@ void M_SetupNextMenu(menu_t *menudef) { INT16 i; + if (gamestate == GS_MENU) + { + menuwipe = true; + F_WipeStartScreen(); + V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); + F_WipeEndScreen(); + F_RunWipe(wipedefs[wipe_menu_toblack], false, "FADEMAP0", false); + } + if (currentMenu->quitroutine) { // If you're going from a menu to itself, why are you running the quitroutine? You're not quitting it! -SH if (currentMenu != menudef && !currentMenu->quitroutine()) return; // we can't quit this menu (also used to set parameter from the menu) } + currentMenu = menudef; itemOn = currentMenu->lastOn; @@ -3331,7 +3090,7 @@ void M_Init(void) PlayerMenu[i].status = (i == 0 ? IT_CALL : IT_DISABLED); PlayerMenu[i].patch = PlayerMenu[i].text = NULL; PlayerMenu[i].itemaction = M_ChoosePlayer; - PlayerMenu[i].alphaKey = 0; + PlayerMenu[i].mvar1 = 0; } #ifdef HWRENDER @@ -3360,7 +3119,7 @@ void M_InitCharacterTables(void) PlayerMenu[i].status = (i < 4 ? IT_CALL : IT_DISABLED); PlayerMenu[i].patch = PlayerMenu[i].text = NULL; PlayerMenu[i].itemaction = M_ChoosePlayer; - PlayerMenu[i].alphaKey = 0; + PlayerMenu[i].mvar1 = 0; } // Setup description table @@ -3665,6 +3424,27 @@ static void M_DrawMenuTitle(void) } } +static void M_DrawKartGamemodeMenu(void) +{ + INT32 i; + + V_DrawFixedPatch(0, 0, FRACUNIT, 0, W_CachePatchName("MENUHINT", PU_CACHE), NULL); + V_DrawCenteredThinString(BASEVIDWIDTH/2, 12, V_ALLOWLOWERCASE|V_6WIDTHSPACE, "Configure your controls, settings, and preferences."); + + V_DrawFixedPatch(172<numitems; i++) + { + switch (currentMenu->menuitems[i].status & IT_DISPLAY) + { + case IT_STRING: + V_DrawRightAlignedGamemodeString(170, currentMenu->menuitems[i].mvar1, 0, currentMenu->menuitems[i].text, + (i == itemOn) ? SKINCOLOR_PLAGUE : SKINCOLOR_PIGEON); + break; + } + } +} + static void M_DrawGenericMenu(void) { INT32 x, y, w, i, cursory = 0; @@ -3700,7 +3480,7 @@ static void M_DrawGenericMenu(void) /* FALLTHRU */ case IT_NOTHING: case IT_DYBIGSPACE: - y = currentMenu->y+currentMenu->menuitems[i].alphaKey;//+= LINEHEIGHT; + y = currentMenu->y+currentMenu->menuitems[i].mvar1;//+= LINEHEIGHT; break; case IT_BIGSLIDER: M_DrawThermo(x, y, (consvar_t *)currentMenu->menuitems[i].itemaction); @@ -3708,8 +3488,8 @@ static void M_DrawGenericMenu(void) break; case IT_STRING: case IT_WHITESTRING: - if (currentMenu->menuitems[i].alphaKey) - y = currentMenu->y+currentMenu->menuitems[i].alphaKey; + if (currentMenu->menuitems[i].mvar1) + y = currentMenu->y+currentMenu->menuitems[i].mvar1; if (i == itemOn) cursory = y; @@ -3791,23 +3571,23 @@ static void M_DrawGenericMenu(void) y += LINEHEIGHT; break; case IT_TRANSTEXT: - if (currentMenu->menuitems[i].alphaKey) - y = currentMenu->y+currentMenu->menuitems[i].alphaKey; + if (currentMenu->menuitems[i].mvar1) + y = currentMenu->y+currentMenu->menuitems[i].mvar1; /* FALLTHRU */ case IT_TRANSTEXT2: V_DrawString(x, y, V_TRANSLUCENT, currentMenu->menuitems[i].text); y += SMALLLINEHEIGHT; break; case IT_QUESTIONMARKS: - if (currentMenu->menuitems[i].alphaKey) - y = currentMenu->y+currentMenu->menuitems[i].alphaKey; + if (currentMenu->menuitems[i].mvar1) + y = currentMenu->y+currentMenu->menuitems[i].mvar1; V_DrawString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); y += SMALLLINEHEIGHT; break; case IT_HEADERTEXT: // draws 16 pixels to the left, in yellow text - if (currentMenu->menuitems[i].alphaKey) - y = currentMenu->y+currentMenu->menuitems[i].alphaKey; + if (currentMenu->menuitems[i].mvar1) + y = currentMenu->y+currentMenu->menuitems[i].mvar1; V_DrawString(x-16, y, highlightflags, currentMenu->menuitems[i].text); y += SMALLLINEHEIGHT; @@ -3830,12 +3610,6 @@ static void M_DrawGenericMenu(void) } } -static void M_DrawGenericBackgroundMenu(void) -{ - V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); - M_DrawGenericMenu(); -} - static void M_DrawPauseMenu(void) { #if 0 @@ -3992,124 +3766,6 @@ static void M_DrawPauseMenu(void) M_DrawGenericMenu(); } -static void M_DrawCenteredMenu(void) -{ - INT32 x, y, i, cursory = 0; - - // DRAW MENU - x = currentMenu->x; - y = currentMenu->y; - - // draw title (or big pic) - M_DrawMenuTitle(); - - for (i = 0; i < currentMenu->numitems; i++) - { - if (i == itemOn) - cursory = y; - switch (currentMenu->menuitems[i].status & IT_DISPLAY) - { - case IT_PATCH: - if (currentMenu->menuitems[i].patch && currentMenu->menuitems[i].patch[0]) - { - if (currentMenu->menuitems[i].status & IT_CENTER) - { - patch_t *p; - p = W_CachePatchName(currentMenu->menuitems[i].patch, PU_CACHE); - V_DrawScaledPatch((BASEVIDWIDTH - SHORT(p->width))/2, y, 0, p); - } - else - { - V_DrawScaledPatch(x, y, 0, - W_CachePatchName(currentMenu->menuitems[i].patch, PU_CACHE)); - } - } - /* FALLTHRU */ - case IT_NOTHING: - case IT_DYBIGSPACE: - y += LINEHEIGHT; - break; - case IT_BIGSLIDER: - M_DrawThermo(x, y, (consvar_t *)currentMenu->menuitems[i].itemaction); - y += LINEHEIGHT; - break; - case IT_STRING: - case IT_WHITESTRING: - if (currentMenu->menuitems[i].alphaKey) - y = currentMenu->y+currentMenu->menuitems[i].alphaKey; - if (i == itemOn) - cursory = y; - - if ((currentMenu->menuitems[i].status & IT_DISPLAY)==IT_STRING) - V_DrawCenteredString(x, y, 0, currentMenu->menuitems[i].text); - else - V_DrawCenteredString(x, y, highlightflags, currentMenu->menuitems[i].text); - - // Cvar specific handling - switch(currentMenu->menuitems[i].status & IT_TYPE) - case IT_CVAR: - { - consvar_t *cv = (consvar_t *)currentMenu->menuitems[i].itemaction; - switch(currentMenu->menuitems[i].status & IT_CVARTYPE) - { - case IT_CV_SLIDER: - M_DrawSlider(x, y, cv, (i == itemOn)); - case IT_CV_NOPRINT: // color use this - break; - case IT_CV_STRING: - M_DrawTextBox(x, y + 4, MAXSTRINGLENGTH, 1); - V_DrawString(x + 8, y + 12, V_ALLOWLOWERCASE, cv->string); - if (skullAnimCounter < 4 && i == itemOn) - V_DrawCharacter(x + 8 + V_StringWidth(cv->string, 0), y + 12, - '_' | 0x80, false); - y += 16; - break; - default: - V_DrawString(BASEVIDWIDTH - x - V_StringWidth(cv->string, 0), y, - ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? warningflags : highlightflags), cv->string); - break; - } - break; - } - y += STRINGHEIGHT; - break; - case IT_STRING2: - V_DrawCenteredString(x, y, 0, currentMenu->menuitems[i].text); - /* FALLTHRU */ - case IT_DYLITLSPACE: - y += SMALLLINEHEIGHT; - break; - case IT_QUESTIONMARKS: - if (currentMenu->menuitems[i].alphaKey) - y = currentMenu->y+currentMenu->menuitems[i].alphaKey; - - V_DrawCenteredString(x, y, V_TRANSLUCENT|V_OLDSPACING, M_CreateSecretMenuOption(currentMenu->menuitems[i].text)); - y += SMALLLINEHEIGHT; - break; - case IT_GRAYPATCH: - if (currentMenu->menuitems[i].patch && currentMenu->menuitems[i].patch[0]) - V_DrawMappedPatch(x, y, 0, - W_CachePatchName(currentMenu->menuitems[i].patch,PU_CACHE), graymap); - y += LINEHEIGHT; - break; - } - } - - // DRAW THE SKULL CURSOR - if (((currentMenu->menuitems[itemOn].status & IT_DISPLAY) == IT_PATCH) - || ((currentMenu->menuitems[itemOn].status & IT_DISPLAY) == IT_NOTHING)) - { - V_DrawScaledPatch(x + SKULLXOFF, cursory - 5, 0, - W_CachePatchName("M_CURSOR", PU_CACHE)); - } - else - { - V_DrawScaledPatch(x - V_StringWidth(currentMenu->menuitems[itemOn].text, 0)/2 - 24, cursory, 0, - W_CachePatchName("M_CURSOR", PU_CACHE)); - V_DrawCenteredString(x, cursory, highlightflags, currentMenu->menuitems[itemOn].text); - } -} - // // M_StringHeight // @@ -4184,7 +3840,7 @@ boolean M_CanShowLevelInList(INT32 mapnum, INT32 gt) { // Random map! if (mapnum == -1) - return (gamestate != GS_TIMEATTACK && !modeattacking); + return (currentMenu != &SP_TimeAttackDef && !modeattacking); // Does the map exist? if (!mapheaderinfo[mapnum]) @@ -4374,7 +4030,7 @@ void M_StartMessage(const char *string, void *routine, MessageDef.prevMenu = currentMenu; MessageDef.menuitems[0].text = message; - MessageDef.menuitems[0].alphaKey = (UINT8)itemtype; + MessageDef.menuitems[0].mvar1 = (UINT8)itemtype; if (!routine && itemtype != MM_NOTHING) itemtype = MM_NOTHING; switch (itemtype) { @@ -4436,8 +4092,8 @@ static void M_DrawMessageMenu(void) mlines = currentMenu->lastOn>>8; max = (INT16)((UINT8)(currentMenu->lastOn & 0xFF)*8); - // hack: draw RA background in RA menus - if (gamestate == GS_TIMEATTACK) + // hack: draw background in menus + if (gamestate == GS_MENU) V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); M_DrawTextBox(currentMenu->x, y - 8, (max+7)>>3, mlines); @@ -4520,7 +4176,7 @@ static void M_DrawImageDef(void) V_DrawSmallScaledPatch(0,0,0,patch); } - if (currentMenu->menuitems[itemOn].alphaKey) + if (currentMenu->menuitems[itemOn].mvar1) { V_DrawString(2,BASEVIDHEIGHT-10, V_YELLOWMAP, va("%d", (itemOn<<1)-1)); // intentionally not highlightflags, unlike below V_DrawRightAlignedString(BASEVIDWIDTH-2,BASEVIDHEIGHT-10, V_YELLOWMAP, va("%d", itemOn<<1)); // ditto @@ -4653,8 +4309,8 @@ static void M_Addons(INT32 choice) addonsp[NUM_EXT+3] = W_CachePatchName("M_FSRCH", PU_STATIC); addonsp[NUM_EXT+4] = W_CachePatchName("M_FSAVE", PU_STATIC); - MISC_AddonsDef.prevMenu = currentMenu; - M_SetupNextMenu(&MISC_AddonsDef); + EX_AddonsDef.prevMenu = currentMenu; + M_SetupNextMenu(&EX_AddonsDef); } #define width 4 @@ -4724,7 +4380,7 @@ static char *M_AddonsHeaderPath(void) } #define UNEXIST S_StartSound(NULL, sfx_s26d);\ - M_SetupNextMenu(MISC_AddonsDef.prevMenu);\ + M_SetupNextMenu(EX_AddonsDef.prevMenu);\ M_StartMessage(va("\x82%s\x80\nThis folder no longer exists!\nAborting to main menu.\n\n(Press a key)\n", M_AddonsHeaderPath()),NULL,MM_NOTHING) #define CLEARNAME Z_Free(refreshdirname);\ @@ -5116,13 +4772,11 @@ static void M_HandleAddons(INT32 choice) default: break; } + if (exitmenu) { closefilemenu(true); - // Secret menu! - //MainMenu[secrets].status = (M_AnySecretUnlocked()) ? (IT_STRING | IT_CALL) : (IT_DISABLED); - if (currentMenu->prevMenu) M_SetupNextMenu(currentMenu->prevMenu); else @@ -5176,6 +4830,7 @@ void M_ReplayHut(INT32 choice) snprintf(menupath, 1024, "%s"PATHSEP"replay"PATHSEP"online"PATHSEP, srb2home); menupathindex[(menudepthleft = menudepth-1)] = strlen(menupath); } + if (!preparefilemenu(false, true)) { M_StartMessage("No replays found.\n\n(Press a key)\n", NULL, MM_NOTHING); @@ -5183,19 +4838,15 @@ void M_ReplayHut(INT32 choice) } else if (!demo.inreplayhut) dir_on[menudepthleft] = 0; + demo.inreplayhut = true; replayScrollTitle = 0; replayScrollDelay = TICRATE; replayScrollDir = 1; PrepReplayList(); - - menuactive = true; - M_SetupNextMenu(&MISC_ReplayHutDef); - G_SetGamestate(GS_TIMEATTACK); + M_SetupNextMenu(&EX_ReplayHutDef); demo.rewinding = false; - - S_ChangeMusicInternal("replst", true); } static void M_HandleReplayHutList(INT32 choice) @@ -5275,7 +4926,7 @@ static void M_HandleReplayHutList(INT32 choice) default: // We can't just use M_SetupNextMenu because that'll run ReplayDef's quitroutine and boot us back to the title screen! currentMenu->lastOn = itemOn; - currentMenu = &MISC_ReplayStartDef; + currentMenu = &EX_ReplayStartDef; replayScrollTitle = 0; replayScrollDelay = TICRATE; replayScrollDir = 1; @@ -5283,20 +4934,20 @@ static void M_HandleReplayHutList(INT32 choice) { case DFILE_ERROR_CANNOTLOAD: // Only show "Watch Replay Without Addons" - MISC_ReplayStartMenu[0].status = IT_DISABLED; - MISC_ReplayStartMenu[1].status = IT_CALL|IT_STRING; - //MISC_ReplayStartMenu[1].alphaKey = 0; - MISC_ReplayStartMenu[2].status = IT_DISABLED; + EX_ReplayStartMenu[0].status = IT_DISABLED; + EX_ReplayStartMenu[1].status = IT_CALL|IT_STRING; + //EX_ReplayStartMenu[1].mvar1 = 0; + EX_ReplayStartMenu[2].status = IT_DISABLED; itemOn = 1; break; case DFILE_ERROR_NOTLOADED: case DFILE_ERROR_INCOMPLETEOUTOFORDER: // Show "Load Addons and Watch Replay" and "Watch Replay Without Addons" - MISC_ReplayStartMenu[0].status = IT_CALL|IT_STRING; - MISC_ReplayStartMenu[1].status = IT_CALL|IT_STRING; - //MISC_ReplayStartMenu[1].alphaKey = 10; - MISC_ReplayStartMenu[2].status = IT_DISABLED; + EX_ReplayStartMenu[0].status = IT_CALL|IT_STRING; + EX_ReplayStartMenu[1].status = IT_CALL|IT_STRING; + //EX_ReplayStartMenu[1].mvar1 = 10; + EX_ReplayStartMenu[2].status = IT_DISABLED; itemOn = 0; break; @@ -5304,10 +4955,10 @@ static void M_HandleReplayHutList(INT32 choice) case DFILE_ERROR_OUTOFORDER: default: // Show "Watch Replay" - MISC_ReplayStartMenu[0].status = IT_DISABLED; - MISC_ReplayStartMenu[1].status = IT_DISABLED; - MISC_ReplayStartMenu[2].status = IT_CALL|IT_STRING; - //MISC_ReplayStartMenu[2].alphaKey = 0; + EX_ReplayStartMenu[0].status = IT_DISABLED; + EX_ReplayStartMenu[1].status = IT_DISABLED; + EX_ReplayStartMenu[2].status = IT_CALL|IT_STRING; + //EX_ReplayStartMenu[2].mvar1 = 0; itemOn = 2; break; } @@ -5444,8 +5095,6 @@ static void M_DrawReplayHut(void) static UINT16 replayhutmenuy = 0; - V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); - if (cv_vhseffect.value) V_DrawVhsEffect(false); @@ -5469,8 +5118,8 @@ static void M_DrawReplayHut(void) { INT32 maxy; // Scroll menu items if needed - cursory = y + currentMenu->menuitems[replaylistitem].alphaKey + dir_on[menudepthleft]*10; - maxy = y + currentMenu->menuitems[replaylistitem].alphaKey + sizedirmenu*10; + cursory = y + currentMenu->menuitems[replaylistitem].mvar1 + dir_on[menudepthleft]*10; + maxy = y + currentMenu->menuitems[replaylistitem].mvar1 + sizedirmenu*10; if (cursory > maxy - 20) cursory = maxy - 20; @@ -5488,7 +5137,7 @@ static void M_DrawReplayHut(void) // Draw static menu items for (i = 0; i < replaylistitem; i++) { - INT32 localy = y + currentMenu->menuitems[i].alphaKey; + INT32 localy = y + currentMenu->menuitems[i].mvar1; if (localy < 65) continue; @@ -5502,7 +5151,7 @@ static void M_DrawReplayHut(void) V_DrawString(x, localy, V_SNAPTOTOP|V_SNAPTOLEFT|highlightflags, currentMenu->menuitems[i].text); } - y += currentMenu->menuitems[replaylistitem].alphaKey; + y += currentMenu->menuitems[replaylistitem].mvar1; for (i = 0; i < (INT16)sizedirmenu; i++) { @@ -5560,7 +5209,7 @@ static void M_DrawReplayHut(void) } // Draw scrollbar - y = sizedirmenu*10 + currentMenu->menuitems[replaylistitem].alphaKey + 30; + y = sizedirmenu*10 + currentMenu->menuitems[replaylistitem].mvar1 + 30; if (y > SCALEDVIEWHEIGHT-80) { V_DrawFill(BASEVIDWIDTH-4, 75, 4, SCALEDVIEWHEIGHT-80, V_SNAPTOTOP|V_SNAPTORIGHT|159); @@ -5586,7 +5235,7 @@ static void M_DrawReplayStartMenu(void) const char *warning; UINT8 i; - M_DrawGenericBackgroundMenu(); + M_DrawGenericMenu(); #define STARTY 62-(replayScrollTitle>>1) // Draw rankings beyond first @@ -5689,16 +5338,17 @@ static void M_DrawReplayStartMenu(void) static boolean M_QuitReplayHut(void) { - // D_StartTitle does its own wipe, since GS_TIMEATTACK is now a complete gamestate. - menuactive = false; - D_StartTitle(); - if (demolist) Z_Free(demolist); demolist = NULL; demo.inreplayhut = false; + if (currentMenu->prevMenu) + M_SetupNextMenu(currentMenu->prevMenu); + else + M_ClearMenus(true); + return true; } @@ -5747,9 +5397,9 @@ static void M_DrawPlaybackMenu(void) for (i = playback_viewcount; i <= playback_view4; i++) PlaybackMenu[i].status = IT_DISABLED; - //PlaybackMenu[playback_moreoptions].alphaKey = 72; - //PlaybackMenu[playback_quit].alphaKey = 88; - PlaybackMenu[playback_quit].alphaKey = 72; + //PlaybackMenu[playback_moreoptions].mvar1 = 72; + //PlaybackMenu[playback_quit].mvar1 = 88; + PlaybackMenu[playback_quit].mvar1 = 72; //currentMenu->x = BASEVIDWIDTH/2 - 52; currentMenu->x = BASEVIDWIDTH/2 - 44; @@ -5763,9 +5413,9 @@ static void M_DrawPlaybackMenu(void) for (i = splitscreen+1; i < 4; i++) PlaybackMenu[playback_view1+i].status = IT_DISABLED; - //PlaybackMenu[playback_moreoptions].alphaKey = 156; - //PlaybackMenu[playback_quit].alphaKey = 172; - PlaybackMenu[playback_quit].alphaKey = 156; + //PlaybackMenu[playback_moreoptions].mvar1 = 156; + //PlaybackMenu[playback_quit].mvar1 = 172; + PlaybackMenu[playback_quit].mvar1 = 156; //currentMenu->x = BASEVIDWIDTH/2 - 94; currentMenu->x = BASEVIDWIDTH/2 - 88; @@ -5804,13 +5454,13 @@ static void M_DrawPlaybackMenu(void) icon = W_CachePatchName("PLAYRANK", PU_CACHE); // temp if ((i == playback_fastforward && cv_playbackspeed.value > 1) || (i == playback_rewind && demo.rewinding)) - V_DrawMappedPatch(currentMenu->x + currentMenu->menuitems[i].alphaKey, currentMenu->y, V_SNAPTOTOP, icon, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_JAWZ, GTC_MENUCACHE)); + V_DrawMappedPatch(currentMenu->x + currentMenu->menuitems[i].mvar1, currentMenu->y, V_SNAPTOTOP, icon, R_GetTranslationColormap(TC_RAINBOW, SKINCOLOR_JAWZ, GTC_MENUCACHE)); else - V_DrawMappedPatch(currentMenu->x + currentMenu->menuitems[i].alphaKey, currentMenu->y, V_SNAPTOTOP, icon, (i == itemOn) ? activemap : inactivemap); + V_DrawMappedPatch(currentMenu->x + currentMenu->menuitems[i].mvar1, currentMenu->y, V_SNAPTOTOP, icon, (i == itemOn) ? activemap : inactivemap); if (i == itemOn) { - V_DrawCharacter(currentMenu->x + currentMenu->menuitems[i].alphaKey + 4, currentMenu->y + 14, + V_DrawCharacter(currentMenu->x + currentMenu->menuitems[i].mvar1 + 4, currentMenu->y + 14, '\x1A' | V_SNAPTOTOP|highlightflags, false); V_DrawCenteredString(BASEVIDWIDTH/2, currentMenu->y + 18, V_SNAPTOTOP|V_ALLOWLOWERCASE, currentMenu->menuitems[i].text); @@ -5946,34 +5596,11 @@ static void M_PlaybackQuit(INT32 choice) if (demo.inreplayhut) M_ReplayHut(choice); else if (modeattacking) - { M_EndModeAttackRun(); - S_ChangeMusicInternal("racent", true); - } else D_StartTitle(); } -static void M_PandorasBox(INT32 choice) -{ - (void)choice; - CV_StealthSetValue(&cv_dummyrings, max(players[consoleplayer].health - 1, 0)); - CV_StealthSetValue(&cv_dummylives, players[consoleplayer].lives); - CV_StealthSetValue(&cv_dummycontinues, players[consoleplayer].continues); - M_SetupNextMenu(&SR_PandoraDef); -} - -static boolean M_ExitPandorasBox(void) -{ - if (cv_dummyrings.value != max(players[consoleplayer].health - 1, 0)) - COM_ImmedExecute(va("setrings %d", cv_dummyrings.value)); - if (cv_dummylives.value != players[consoleplayer].lives) - COM_ImmedExecute(va("setlives %d", cv_dummylives.value)); - if (cv_dummycontinues.value != players[consoleplayer].continues) - COM_ImmedExecute(va("setcontinues %d", cv_dummycontinues.value)); - return true; -} - static void M_ChangeLevel(INT32 choice) { char mapname[6]; @@ -6130,69 +5757,6 @@ static void M_SelectableClearMenus(INT32 choice) M_ClearMenus(true); } -// ====== -// CHEATS -// ====== - -static void M_UltimateCheat(INT32 choice) -{ - (void)choice; - I_Quit(); -} - -static void M_GetAllEmeralds(INT32 choice) -{ - (void)choice; - - emeralds = ((EMERALD7)*2)-1; - M_StartMessage(M_GetText("You now have all 7 emeralds.\nUse them wisely.\nWith great power comes great ring drain.\n"),NULL,MM_NOTHING); - - G_SetGameModified(multiplayer, true); -} - -static void M_DestroyRobotsResponse(INT32 ch) -{ - if (ch != 'y' && ch != KEY_ENTER) - return; - - // Destroy all robots - P_DestroyRobots(); - - G_SetGameModified(multiplayer, true); -} - -static void M_DestroyRobots(INT32 choice) -{ - (void)choice; - - M_StartMessage(M_GetText("Do you want to destroy all\nrobots in the current level?\n\n(Press 'Y' to confirm)\n"),M_DestroyRobotsResponse,MM_YESNO); -} - -/*static void M_LevelSelectWarp(INT32 choice) -{ - boolean fromloadgame = (currentMenu == &SP_LevelSelectDef); - - (void)choice; - - if (W_CheckNumForName(G_BuildMapName(cv_nextmap.value)) == LUMPERROR) - { -// CONS_Alert(CONS_WARNING, "Internal game map '%s' not found\n", G_BuildMapName(cv_nextmap.value)); - return; - } - - startmap = (INT16)(cv_nextmap.value); - - fromlevelselect = true; - - if (fromloadgame) - G_LoadGame((UINT32)cursaveslot, startmap); - else - { - cursaveslot = -1; - M_SetupChoosePlayer(0); - } -}*/ - // ======== // SKY ROOM // ======== @@ -6308,57 +5872,7 @@ static void M_DrawChecklist(void) } #undef NUMCHECKLIST -#define NUMHINTS 5 -static void M_EmblemHints(INT32 choice) -{ - (void)choice; - SR_EmblemHintMenu[0].status = (M_SecretUnlocked(SECRET_ITEMFINDER)) ? (IT_CVAR|IT_STRING) : (IT_SECRET); - M_SetupNextMenu(&SR_EmblemHintDef); - itemOn = 1; // always start on back. -} - -static void M_DrawEmblemHints(void) -{ - INT32 i, j = 0; - UINT32 collected = 0; - emblem_t *emblem; - const char *hint; - - for (i = 0; i < numemblems; i++) - { - emblem = &emblemlocations[i]; - if (emblem->level != gamemap || emblem->type > ET_SKIN) - continue; - - if (emblem->collected) - { - collected = recommendedflags; - V_DrawMappedPatch(12, 12+(28*j), 0, W_CachePatchName(M_GetEmblemPatch(emblem), PU_CACHE), - R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(emblem), GTC_MENUCACHE)); - } - else - { - collected = 0; - V_DrawScaledPatch(12, 12+(28*j), 0, W_CachePatchName("NEEDIT", PU_CACHE)); - } - - if (emblem->hint[0]) - hint = emblem->hint; - else - hint = M_GetText("No hints available."); - hint = V_WordWrap(40, BASEVIDWIDTH-12, 0, hint); - V_DrawString(40, 8+(28*j), V_RETURN8|V_ALLOWLOWERCASE|collected, hint); - - if (++j >= NUMHINTS) - break; - } - if (!j) - V_DrawCenteredString(160, 48, highlightflags, "No hidden medals on this map."); - - M_DrawGenericMenu(); -} - -static void M_DrawSkyRoom(void) +static void M_DrawSoundOptions(void) { INT32 i, y = 0; INT32 lengthstring = 0; @@ -6368,17 +5882,17 @@ static void M_DrawSkyRoom(void) if (currentMenu == &OP_SoundOptionsDef) { V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, - currentMenu->y+currentMenu->menuitems[0].alphaKey, + currentMenu->y+currentMenu->menuitems[0].mvar1, (sound_disabled ? warningflags : highlightflags), (sound_disabled ? "OFF" : "ON")); V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, - currentMenu->y+currentMenu->menuitems[2].alphaKey, + currentMenu->y+currentMenu->menuitems[2].mvar1, (digital_disabled ? warningflags : highlightflags), (digital_disabled ? "OFF" : "ON")); /*V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, - currentMenu->y+currentMenu->menuitems[5].alphaKey, + currentMenu->y+currentMenu->menuitems[5].mvar1, (midi_disabled ? warningflags : highlightflags), (midi_disabled ? "OFF" : "ON"));*/ @@ -6394,7 +5908,7 @@ static void M_DrawSkyRoom(void) { if (currentMenu->menuitems[i].itemaction == M_HandleSoundTest) { - y = currentMenu->menuitems[i].alphaKey; + y = currentMenu->menuitems[i].mvar1; break; } } @@ -6413,9 +5927,9 @@ static void M_DrawSkyRoom(void) if (lengthstring) { - V_DrawCharacter(BASEVIDWIDTH - currentMenu->x - 10 - lengthstring - (skullAnimCounter/5), currentMenu->y+currentMenu->menuitems[itemOn].alphaKey, + V_DrawCharacter(BASEVIDWIDTH - currentMenu->x - 10 - lengthstring - (skullAnimCounter/5), currentMenu->y+currentMenu->menuitems[itemOn].mvar1, '\x1C' | highlightflags, false); // left arrow - V_DrawCharacter(BASEVIDWIDTH - currentMenu->x + 2 + (skullAnimCounter/5), currentMenu->y+currentMenu->menuitems[itemOn].alphaKey, + V_DrawCharacter(BASEVIDWIDTH - currentMenu->x + 2 + (skullAnimCounter/5), currentMenu->y+currentMenu->menuitems[itemOn].mvar1, '\x1D' | highlightflags, false); // right arrow } } @@ -6453,6 +5967,7 @@ static void M_HandleSoundTest(INT32 choice) default: break; } + if (exitmenu) { if (currentMenu->prevMenu) @@ -6462,109 +5977,6 @@ static void M_HandleSoundTest(INT32 choice) } } -// Entering secrets menu -/*static void M_SecretsMenu(INT32 choice) -{ - INT32 i, j, ul; - UINT8 done[MAXUNLOCKABLES]; - UINT16 curheight; - - (void)choice; - - // Clear all before starting - for (i = 1; i < MAXUNLOCKABLES+1; ++i) - SR_MainMenu[i].status = IT_DISABLED; - - memset(skyRoomMenuTranslations, 0, sizeof(skyRoomMenuTranslations)); - memset(done, 0, sizeof(done)); - - for (i = 1; i < MAXUNLOCKABLES+1; ++i) - { - curheight = UINT16_MAX; - ul = -1; - - // Autosort unlockables - for (j = 0; j < MAXUNLOCKABLES; ++j) - { - if (!unlockables[j].height || done[j] || unlockables[j].type < 0) - continue; - - if (unlockables[j].height < curheight) - { - curheight = unlockables[j].height; - ul = j; - } - } - if (ul < 0) - break; - - done[ul] = true; - - skyRoomMenuTranslations[i-1] = (UINT8)ul; - SR_MainMenu[i].text = unlockables[ul].name; - SR_MainMenu[i].alphaKey = (UINT8)unlockables[ul].height; - - if (unlockables[ul].type == SECRET_HEADER) - { - SR_MainMenu[i].status = IT_HEADER; - continue; - } - - SR_MainMenu[i].status = IT_SECRET; - - if (unlockables[ul].unlocked) - { - switch (unlockables[ul].type) - { - case SECRET_LEVELSELECT: - SR_MainMenu[i].status = IT_STRING|IT_CALL; - SR_MainMenu[i].itemaction = M_CustomLevelSelect; - break; - case SECRET_WARP: - SR_MainMenu[i].status = IT_STRING|IT_CALL; - SR_MainMenu[i].itemaction = M_CustomWarp; - break; - case SECRET_CREDITS: - SR_MainMenu[i].status = IT_STRING|IT_CALL; - SR_MainMenu[i].itemaction = M_Credits; - break; - case SECRET_SOUNDTEST: - SR_MainMenu[i].status = IT_STRING|IT_KEYHANDLER; - SR_MainMenu[i].itemaction = M_HandleSoundTest; - default: - break; - } - } - } - - M_SetupNextMenu(&SR_MainDef); -}*/ - -// ================== -// NEW GAME FUNCTIONS -// ================== - -/*INT32 ultimate_selectable = false; - -static void M_NewGame(void) -{ - fromlevelselect = false; - - startmap = spstage_start; - CV_SetValue(&cv_newgametype, GT_RACE); // SRB2kart - - M_SetupChoosePlayer(0); -}*/ - -/*static void M_CustomWarp(INT32 choice) -{ - INT32 ul = skyRoomMenuTranslations[choice-1]; - - startmap = (INT16)(unlockables[ul].variable); - - M_SetupChoosePlayer(0); -}*/ - static void M_Credits(INT32 choice) { (void)choice; @@ -6573,23 +5985,6 @@ static void M_Credits(INT32 choice) F_StartCredits(); } -/*static void M_CustomLevelSelect(INT32 choice) -{ - INT32 ul = skyRoomMenuTranslations[choice-1]; - - SR_LevelSelectDef.prevMenu = currentMenu; - levellistmode = LLM_LEVELSELECT; - maplistoption = (UINT8)(unlockables[ul].variable); - if (M_CountLevelsToShowInList() == 0) - { - M_StartMessage(M_GetText("No selectable levels found.\n"),NULL,MM_NOTHING); - return; - } - - M_PrepareLevelSelect(); - M_SetupNextMenu(&SR_LevelSelectDef); -}*/ - // ================== // SINGLE PLAYER MENU // ================== @@ -6607,651 +6002,6 @@ static void M_SinglePlayerMenu(INT32 choice) } #endif -/*static void M_LoadGameLevelSelect(INT32 choice) -{ - (void)choice; - levellistmode = LLM_LEVELSELECT; - maplistoption = 1; - if (M_CountLevelsToShowInList() == 0) - { - M_StartMessage(M_GetText("No selectable levels found.\n"),NULL,MM_NOTHING); - return; - } - - SP_LevelSelectDef.prevMenu = currentMenu; - - M_PrepareLevelSelect(); - M_SetupNextMenu(&SP_LevelSelectDef); -}*/ - -// ============== -// LOAD GAME MENU -// ============== - -/*static INT32 saveSlotSelected = 0; -static short menumovedir = 0; - -static void M_DrawLoadGameData(void) -{ - INT32 ecks; - INT32 i; - - ecks = SP_LoadDef.x + 24; - M_DrawTextBox(SP_LoadDef.x-12,144, 24, 4); - - if (saveSlotSelected == NOSAVESLOT) // last slot is play without saving - { - if (ultimate_selectable) - { - V_DrawCenteredString(ecks + 68, 144, V_ORANGEMAP, "ULTIMATE MODE"); - V_DrawCenteredString(ecks + 68, 156, 0, "NO RINGS, NO ONE-UPS,"); - V_DrawCenteredString(ecks + 68, 164, 0, "NO CONTINUES, ONE LIFE,"); - V_DrawCenteredString(ecks + 68, 172, 0, "FINAL DESTINATION."); - } - else - { - V_DrawCenteredString(ecks + 68, 144, V_ORANGEMAP, "PLAY WITHOUT SAVING"); - V_DrawCenteredString(ecks + 68, 156, 0, "THIS GAME WILL NOT BE"); - V_DrawCenteredString(ecks + 68, 164, 0, "SAVED, BUT YOU CAN STILL"); - V_DrawCenteredString(ecks + 68, 172, 0, "GET MEDALS AND SECRETS."); - } - return; - } - - if (savegameinfo[saveSlotSelected].lives == -42) // Empty - { - V_DrawCenteredString(ecks + 68, 160, 0, "NO DATA"); - return; - } - - if (savegameinfo[saveSlotSelected].lives == -666) // savegame is bad - { - V_DrawCenteredString(ecks + 68, 144, warningflags, "CORRUPT SAVE FILE"); - V_DrawCenteredString(ecks + 68, 156, 0, "THIS SAVE FILE"); - V_DrawCenteredString(ecks + 68, 164, 0, "CAN NOT BE LOADED."); - V_DrawCenteredString(ecks + 68, 172, 0, "DELETE USING BACKSPACE."); - return; - } - - // Draw the back sprite, it looks ugly if we don't - V_DrawScaledPatch(SP_LoadDef.x, 144+8, 0, livesback); - if (savegameinfo[saveSlotSelected].skincolor == 0) - V_DrawScaledPatch(SP_LoadDef.x,144+8,0,W_CachePatchName(skins[savegameinfo[saveSlotSelected].skinnum].face, PU_CACHE)); - else - { - UINT8 *colormap = R_GetTranslationColormap(savegameinfo[saveSlotSelected].skinnum, savegameinfo[saveSlotSelected].skincolor, GTC_MENUCACHE); - V_DrawMappedPatch(SP_LoadDef.x,144+8,0,W_CachePatchName(skins[savegameinfo[saveSlotSelected].skinnum].face, PU_CACHE), colormap); - } - - V_DrawString(ecks + 12, 152, 0, savegameinfo[saveSlotSelected].playername); - -#ifdef SAVEGAMES_OTHERVERSIONS - if (savegameinfo[saveSlotSelected].gamemap & 16384) - V_DrawCenteredString(ecks + 68, 144, warningflags, "OUTDATED SAVE FILE!"); -#endif - - if (savegameinfo[saveSlotSelected].gamemap & 8192) - V_DrawString(ecks + 12, 160, recommendedflags, "CLEAR!"); - else - V_DrawString(ecks + 12, 160, 0, va("%s", savegameinfo[saveSlotSelected].levelname)); - - // Use the big face pic for lives, duh. :3 - V_DrawScaledPatch(ecks + 12, 175, 0, W_CachePatchName("STLIVEX", PU_HUDGFX)); - V_DrawTallNum(ecks + 40, 172, 0, savegameinfo[saveSlotSelected].lives); - - // Absolute ridiculousness, condensed into another function. - V_DrawContinueIcon(ecks + 58, 182, 0, savegameinfo[saveSlotSelected].skinnum, savegameinfo[saveSlotSelected].skincolor); - V_DrawScaledPatch(ecks + 68, 175, 0, W_CachePatchName("STLIVEX", PU_HUDGFX)); - V_DrawTallNum(ecks + 96, 172, 0, savegameinfo[saveSlotSelected].continues); - - for (i = 0; i < 7; ++i) - { - if (savegameinfo[saveSlotSelected].numemeralds & (1 << i)) - V_DrawScaledPatch(ecks + 104 + (i * 8), 172, 0, tinyemeraldpics[i]); - } -} - -#define LOADBARHEIGHT SP_LoadDef.y + (LINEHEIGHT * (j+1)) + ymod -#define CURSORHEIGHT SP_LoadDef.y + (LINEHEIGHT*3) - 1 -static void M_DrawLoad(void) -{ - INT32 i, j; - INT32 ymod = 0, offset = 0; - - M_DrawMenuTitle(); - - if (menumovedir != 0) //movement illusion - { - ymod = (-(LINEHEIGHT/4))*menumovedir; - offset = ((menumovedir > 0) ? -1 : 1); - } - - V_DrawCenteredString(BASEVIDWIDTH/2, 40, 0, "Press backspace to delete a save."); - - for (i = MAXSAVEGAMES + saveSlotSelected - 2 + offset, j = 0;i <= MAXSAVEGAMES + saveSlotSelected + 2 + offset; i++, j++) - { - if ((menumovedir < 0 && j == 4) || (menumovedir > 0 && j == 0)) - continue; //this helps give the illusion of movement - - M_DrawSaveLoadBorder(SP_LoadDef.x, LOADBARHEIGHT); - - if ((i%MAXSAVEGAMES) == NOSAVESLOT) // play without saving - { - if (ultimate_selectable) - V_DrawCenteredString(SP_LoadDef.x+92, LOADBARHEIGHT - 1, V_ORANGEMAP, "ULTIMATE MODE"); - else - V_DrawCenteredString(SP_LoadDef.x+92, LOADBARHEIGHT - 1, V_ORANGEMAP, "PLAY WITHOUT SAVING"); - continue; - } - - if (savegameinfo[i%MAXSAVEGAMES].lives == -42) - V_DrawString(SP_LoadDef.x-6, LOADBARHEIGHT - 1, V_TRANSLUCENT, "NO DATA"); - else if (savegameinfo[i%MAXSAVEGAMES].lives == -666) - V_DrawString(SP_LoadDef.x-6, LOADBARHEIGHT - 1, warningflags, "CORRUPT SAVE FILE"); - else if (savegameinfo[i%MAXSAVEGAMES].gamemap & 8192) - V_DrawString(SP_LoadDef.x-6, LOADBARHEIGHT - 1, recommendedflags, "CLEAR!"); - else - V_DrawString(SP_LoadDef.x-6, LOADBARHEIGHT - 1, 0, va("%s", savegameinfo[i%MAXSAVEGAMES].levelname)); - - //Draw the save slot number on the right side - V_DrawRightAlignedString(SP_LoadDef.x+192, LOADBARHEIGHT - 1, 0, va("%d",(i%MAXSAVEGAMES) + 1)); - } - - //Draw cursors on both sides. - V_DrawScaledPatch( 32, CURSORHEIGHT, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); - V_DrawScaledPatch(274, CURSORHEIGHT, 0, W_CachePatchName("M_CURSOR", PU_CACHE)); - - M_DrawLoadGameData(); - - //finishing the movement illusion - if (menumovedir) - menumovedir += ((menumovedir > 0) ? 1 : -1); - if (abs(menumovedir) > 3) - menumovedir = 0; -} -#undef LOADBARHEIGHT -#undef CURSORHEIGHT - -// -// User wants to load this game -// -static void M_LoadSelect(INT32 choice) -{ - (void)choice; - - if (saveSlotSelected == NOSAVESLOT) //last slot is play without saving - { - M_NewGame(); - cursaveslot = -1; - return; - } - - if (!FIL_ReadFileOK(va(savegamename, saveSlotSelected))) - { - // This slot is empty, so start a new game here. - M_NewGame(); - } - else if (savegameinfo[saveSlotSelected].gamemap & 8192) // Completed - M_LoadGameLevelSelect(saveSlotSelected + 1); - else - G_LoadGame((UINT32)saveSlotSelected, 0); - - cursaveslot = saveSlotSelected; -} - -#define VERSIONSIZE 16 -#define BADSAVE { savegameinfo[slot].lives = -666; Z_Free(savebuffer); return; } -#define CHECKPOS if (save_p >= end_p) BADSAVE -// Reads the save file to list lives, level, player, etc. -// Tails 05-29-2003 -static void M_ReadSavegameInfo(UINT32 slot) -{ - size_t length; - char savename[255]; - UINT8 *savebuffer; - UINT8 *end_p; // buffer end point, don't read past here - UINT8 *save_p; - INT32 fake; // Dummy variable - char temp[sizeof(timeattackfolder)]; - char vcheck[VERSIONSIZE]; -#ifdef SAVEGAMES_OTHERVERSIONS - boolean oldversion = false; -#endif - - sprintf(savename, savegamename, slot); - - length = FIL_ReadFile(savename, &savebuffer); - if (length == 0) - { - savegameinfo[slot].lives = -42; - return; - } - - end_p = savebuffer + length; - - // skip the description field - save_p = savebuffer; - - // Version check - memset(vcheck, 0, sizeof (vcheck)); - sprintf(vcheck, "version %d", VERSION); - if (strcmp((const char *)save_p, (const char *)vcheck)) - { -#ifdef SAVEGAMES_OTHERVERSIONS - oldversion = true; -#else - BADSAVE // Incompatible versions? -#endif - } - save_p += VERSIONSIZE; - - // dearchive all the modifications - // P_UnArchiveMisc() - - CHECKPOS - fake = READINT16(save_p); - - if (((fake-1) & 8191) >= NUMMAPS) BADSAVE - - if(!mapheaderinfo[(fake-1) & 8191]) - { - savegameinfo[slot].levelname[0] = '\0'; - savegameinfo[slot].actnum = 0; - } - else - { - strcpy(savegameinfo[slot].levelname, mapheaderinfo[(fake-1) & 8191]->lvlttl); - savegameinfo[slot].actnum = 0; //mapheaderinfo[(fake-1) & 8191]->actnum - } - -#ifdef SAVEGAMES_OTHERVERSIONS - if (oldversion) - { - if (fake == 24) //meh, let's count old Clear! saves too - fake |= 8192; - fake |= 16384; // marker for outdated version - } -#endif - savegameinfo[slot].gamemap = fake; - - CHECKPOS - fake = READUINT16(save_p)-357; // emeralds - - savegameinfo[slot].numemeralds = (UINT8)fake; - - CHECKPOS - READSTRINGN(save_p, temp, sizeof(temp)); // mod it belongs to - - if (strcmp(temp, timeattackfolder)) BADSAVE - - // P_UnArchivePlayer() - CHECKPOS - savegameinfo[slot].skincolor = READUINT8(save_p); - CHECKPOS - savegameinfo[slot].skinnum = READUINT8(save_p); - - CHECKPOS - (void)READINT32(save_p); // Score - - CHECKPOS - savegameinfo[slot].lives = READINT32(save_p); // lives - CHECKPOS - savegameinfo[slot].continues = READINT32(save_p); // continues - - if (fake & (1<<10)) - { - CHECKPOS - savegameinfo[slot].botskin = READUINT8(save_p); - if (savegameinfo[slot].botskin-1 >= numskins) - savegameinfo[slot].botskin = 0; - CHECKPOS - savegameinfo[slot].botcolor = READUINT8(save_p); // because why not. - } - else - savegameinfo[slot].botskin = 0; - - if (savegameinfo[slot].botskin) - snprintf(savegameinfo[slot].playername, 36, "%s & %s", - skins[savegameinfo[slot].skinnum].realname, - skins[savegameinfo[slot].botskin-1].realname); - else - strcpy(savegameinfo[slot].playername, skins[savegameinfo[slot].skinnum].realname); - - savegameinfo[slot].playername[31] = 0; - - // File end marker check - CHECKPOS - if (READUINT8(save_p) != 0x1d) BADSAVE; - - // done - Z_Free(savebuffer); -} -#undef CHECKPOS -#undef BADSAVE - -// -// M_ReadSaveStrings -// read the strings from the savegame files -// and put it in savegamestrings global variable -// -static void M_ReadSaveStrings(void) -{ - FILE *handle; - UINT32 i; - char name[256]; - - for (i = 0; i < MAXSAVEGAMES; i++) - { - snprintf(name, sizeof name, savegamename, i); - name[sizeof name - 1] = '\0'; - - handle = fopen(name, "rb"); - if (handle == NULL) - { - savegameinfo[i].lives = -42; - continue; - } - fclose(handle); - M_ReadSavegameInfo(i); - } -} - -// -// User wants to delete this game -// -static void M_SaveGameDeleteResponse(INT32 ch) -{ - char name[256]; - - if (ch != 'y' && ch != KEY_ENTER) - return; - - // delete savegame - snprintf(name, sizeof name, savegamename, saveSlotSelected); - name[sizeof name - 1] = '\0'; - remove(name); - - // Refresh savegame menu info - M_ReadSaveStrings(); -} - -static void M_HandleLoadSave(INT32 choice) -{ - boolean exitmenu = false; // exit to previous menu - - switch (choice) - { - case KEY_DOWNARROW: - S_StartSound(NULL, sfx_menu1); - ++saveSlotSelected; - if (saveSlotSelected >= MAXSAVEGAMES) - saveSlotSelected -= MAXSAVEGAMES; - menumovedir = 1; - break; - - case KEY_UPARROW: - S_StartSound(NULL, sfx_menu1); - --saveSlotSelected; - if (saveSlotSelected < 0) - saveSlotSelected += MAXSAVEGAMES; - menumovedir = -1; - break; - - case KEY_ENTER: - S_StartSound(NULL, sfx_menu1); - if (savegameinfo[saveSlotSelected].lives != -666) // don't allow loading of "bad saves" - M_LoadSelect(saveSlotSelected); - break; - - case KEY_ESCAPE: - exitmenu = true; - break; - - case KEY_BACKSPACE: - S_StartSound(NULL, sfx_menu1); - // Don't allow people to 'delete' "Play without Saving." - // Nor allow people to 'delete' slots with no saves in them. - if (saveSlotSelected != NOSAVESLOT && savegameinfo[saveSlotSelected].lives != -42) - M_StartMessage(M_GetText("Are you sure you want to delete\nthis save game?\n\n(Press 'Y' to confirm)\n"),M_SaveGameDeleteResponse,MM_YESNO); - break; - } - if (exitmenu) - { - if (currentMenu->prevMenu) - M_SetupNextMenu(currentMenu->prevMenu); - else - M_ClearMenus(true); - } -} - -// -// Selected from SRB2 menu -// -static void M_LoadGame(INT32 choice) -{ - (void)choice; - - M_ReadSaveStrings(); - M_SetupNextMenu(&SP_LoadDef); -} - -// -// Used by cheats to force the save menu to a specific spot. -// -void M_ForceSaveSlotSelected(INT32 sslot) -{ - // Already there? Out of bounds? Whatever, then! - if (sslot == saveSlotSelected || sslot >= MAXSAVEGAMES) - return; - - // Figure out whether to display up movement or down movement - menumovedir = (saveSlotSelected - sslot) > 0 ? -1 : 1; - if (abs(saveSlotSelected - sslot) > (MAXSAVEGAMES>>1)) - menumovedir *= -1; - - saveSlotSelected = sslot; -} - -// ================ -// CHARACTER SELECT -// ================ - -static void M_SetupChoosePlayer(INT32 choice) -{ - (void)choice; - - if (mapheaderinfo[startmap-1] && mapheaderinfo[startmap-1]->forcecharacter[0] != '\0') - { - M_ChoosePlayer(0); //oh for crying out loud just get STARTED, it doesn't matter! - return; - } - - if (Playing() == false) - { - S_StopMusic(); - S_ChangeMusicInternal("chrsel", true); - } - - SP_PlayerDef.prevMenu = currentMenu; - M_SetupNextMenu(&SP_PlayerDef); - char_scroll = itemOn*128*FRACUNIT; // finish scrolling the menu - Z_Free(char_notes); - char_notes = NULL; -} - -// Draw the choose player setup menu, had some fun with player anim -static void M_DrawSetupChoosePlayerMenu(void) -{ - const INT32 my = 24; - patch_t *patch; - INT32 i, o, j; - char *picname; - - // Black BG - V_DrawFill(0, 0, BASEVIDWIDTH, BASEVIDHEIGHT, 31); - //V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); - - // Character select profile images!1 - M_DrawTextBox(0, my, 16, 20); - - if (abs(itemOn*128*FRACUNIT - char_scroll) > 256*FRACUNIT) - char_scroll = itemOn*128*FRACUNIT; - else if (itemOn*128*FRACUNIT - char_scroll > 128*FRACUNIT) - char_scroll += 48*FRACUNIT; - else if (itemOn*128*FRACUNIT - char_scroll < -128*FRACUNIT) - char_scroll -= 48*FRACUNIT; - else if (itemOn*128*FRACUNIT > char_scroll+16*FRACUNIT) - char_scroll += 16*FRACUNIT; - else if (itemOn*128*FRACUNIT < char_scroll-16*FRACUNIT) - char_scroll -= 16*FRACUNIT; - else // close enough. - char_scroll = itemOn*128*FRACUNIT; // just be exact now. - i = (char_scroll+16*FRACUNIT)/(128*FRACUNIT); - o = ((char_scroll/FRACUNIT)+16)%128; - - // prev character - if (i-1 >= 0 && PlayerMenu[i-1].status != IT_DISABLED - && o < 32) - { - picname = description[i-1].picname; - if (picname[0] == '\0') - { - picname = strtok(Z_StrDup(description[i-1].skinname), "&"); - for (j = 0; j < numskins; j++) - if (stricmp(skins[j].name, picname) == 0) - { - Z_Free(picname); - picname = skins[j].charsel; - break; - } - if (j == numskins) // AAAAAAAAAA - picname = skins[0].charsel; - } - patch = W_CachePatchName(picname, PU_CACHE); - if (SHORT(patch->width) >= 256) - V_DrawCroppedPatch(8<height) - 64 + o*2, SHORT(patch->width), SHORT(patch->height)); - else - V_DrawCroppedPatch(8<height) - 32 + o, SHORT(patch->width), SHORT(patch->height)); - W_UnlockCachedPatch(patch); - } - - // next character - if (i+1 < currentMenu->numitems && PlayerMenu[i+1].status != IT_DISABLED - && o < 128) - { - picname = description[i+1].picname; - if (picname[0] == '\0') - { - picname = strtok(Z_StrDup(description[i+1].skinname), "&"); - for (j = 0; j < numskins; j++) - if (stricmp(skins[j].name, picname) == 0) - { - Z_Free(picname); - picname = skins[j].charsel; - break; - } - if (j == numskins) // AAAAAAAAAA - picname = skins[0].charsel; - } - patch = W_CachePatchName(picname, PU_CACHE); - if (SHORT(patch->width) >= 256) - V_DrawCroppedPatch(8<width), o*2); - else - V_DrawCroppedPatch(8<width), o); - W_UnlockCachedPatch(patch); - } - - // current character - if (i < currentMenu->numitems && PlayerMenu[i].status != IT_DISABLED) - { - picname = description[i].picname; - if (picname[0] == '\0') - { - picname = strtok(Z_StrDup(description[i].skinname), "&"); - for (j = 0; j < numskins; j++) - if (stricmp(skins[j].name, picname) == 0) - { - Z_Free(picname); - picname = skins[j].charsel; - break; - } - if (j == numskins) // AAAAAAAAAA - picname = skins[0].charsel; - } - patch = W_CachePatchName(picname, PU_CACHE); - if (o >= 0 && o <= 32) - { - if (SHORT(patch->width) >= 256) - V_DrawSmallScaledPatch(8, my + 40 - o, 0, patch); - else - V_DrawScaledPatch(8, my + 40 - o, 0, patch); - } - else - { - if (SHORT(patch->width) >= 256) - V_DrawCroppedPatch(8<width), SHORT(patch->height)); - else - V_DrawCroppedPatch(8<width), SHORT(patch->height)); - } - W_UnlockCachedPatch(patch); - } - - // draw title (or big pic) - M_DrawMenuTitle(); - - // Character description - M_DrawTextBox(136, my, 21, 20); - if (!char_notes) - char_notes = V_WordWrap(0, 21*8, V_ALLOWLOWERCASE, description[itemOn].notes); - V_DrawString(146, my + 9, V_RETURN8|V_ALLOWLOWERCASE, char_notes); -} - -// Chose the player you want to use Tails 03-02-2002 -static void M_ChoosePlayer(INT32 choice) -{ - char *skin1,*skin2; - INT32 skinnum; - //boolean ultmode = (ultimate_selectable && SP_PlayerDef.prevMenu == &SP_LoadDef && saveSlotSelected == NOSAVESLOT); - - // skip this if forcecharacter - if (mapheaderinfo[startmap-1] && mapheaderinfo[startmap-1]->forcecharacter[0] == '\0') - { - // M_SetupChoosePlayer didn't call us directly, that means we've been properly set up. - char_scroll = itemOn*128*FRACUNIT; // finish scrolling the menu - M_DrawSetupChoosePlayerMenu(); // draw the finally selected character one last time for the fadeout - } - M_ClearMenus(true); - - skin1 = strtok(description[choice].skinname, "&"); - skin2 = strtok(NULL, "&"); - - if (skin2) { - // this character has a second skin - skinnum = R_SkinAvailable(skin1); - botskin = (UINT8)(R_SkinAvailable(skin2)+1); - botingame = true; - - botcolor = skins[botskin-1].prefcolor; - - // undo the strtok - description[choice].skinname[strlen(skin1)] = '&'; - } else { - skinnum = R_SkinAvailable(description[choice].skinname); - botingame = false; - botskin = 0; - botcolor = 0; - } - - if (startmap != spstage_start) - cursaveslot = -1; - - lastmapsaved = 0; - gamecomplete = false; - - G_DeferedInitNew(false, G_BuildMapName(startmap), (UINT8)skinnum, 0, fromlevelselect); - COM_BufAddText("dummyconsvar 1\n"); // G_DeferedInitNew doesn't do this -}*/ - // =============== // STATISTICS MENU // =============== @@ -7289,7 +6039,7 @@ static void M_Statistics(INT32 choice) if (statsMax < 0) statsMax = 0; - M_SetupNextMenu(&SP_LevelStatsDef); + M_SetupNextMenu(&EX_LevelStatsDef); } static void M_DrawStatsMaps(int location) @@ -7488,9 +6238,7 @@ void M_DrawTimeAttackMenu(void) INT32 i, x, y, cursory = 0; UINT16 dispstatus; - //S_ChangeMusicInternal("racent", true); // Eww, but needed for when user hits escape during demo playback - - V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); + S_ChangeMusicInternal("menu", true); // Eww, but needed for when user hits escape during demo playback M_DrawMenuTitle(); if (currentMenu == &SP_TimeAttackDef) @@ -7514,7 +6262,7 @@ void M_DrawTimeAttackMenu(void) if (dispstatus != IT_STRING && dispstatus != IT_WHITESTRING) continue; - y = currentMenu->y+currentMenu->menuitems[i].alphaKey; + y = currentMenu->y+currentMenu->menuitems[i].mvar1; if (i == itemOn) cursory = y; @@ -7645,7 +6393,7 @@ void M_DrawTimeAttackMenu(void) for (i = 0; i < 4; ++i) { - y = currentMenu->y+SP_TimeAttackMenu[i].alphaKey; + y = currentMenu->y+SP_TimeAttackMenu[i].mvar1; V_DrawString(x, y, V_TRANSLUCENT, SP_TimeAttackMenu[i].text); ncv = (consvar_t *)SP_TimeAttackMenu[i].itemaction; if (SP_TimeAttackMenu[i].status & IT_CV_STRING) @@ -7689,16 +6437,12 @@ static void M_TimeAttack(INT32 choice) M_PrepareLevelSelect(); M_SetupNextMenu(&SP_TimeAttackDef); - G_SetGamestate(GS_TIMEATTACK); - if (cv_nextmap.value) Nextmap_OnChange(); else CV_AddValue(&cv_nextmap, 1); itemOn = tastart; // "Start" is selected. - - S_ChangeMusicInternal("racent", true); } static boolean M_QuitTimeAttackMenu(void) @@ -7708,161 +6452,6 @@ static boolean M_QuitTimeAttackMenu(void) return true; } -// Drawing function for Nights Attack -/*void M_DrawNightsAttackMenu(void) -{ - patch_t *PictureOfLevel; - lumpnum_t lumpnum; - char beststr[40]; - - S_ChangeMusicInternal("racent", true); // Eww, but needed for when user hits escape during demo playback - - V_DrawPatchFill(W_CachePatchName("SRB2BACK", PU_CACHE)); - - // draw menu (everything else goes on top of it) - M_DrawGenericMenu(); - - // A 160x100 image of the level as entry MAPxxP - lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(cv_nextmap.value))); - - if (lumpnum != LUMPERROR) - PictureOfLevel = W_CachePatchNum(lumpnum, PU_CACHE); - else - PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); - - V_DrawSmallScaledPatch(90, 28, 0, PictureOfLevel); - - // Level record list - if (cv_nextmap.value) - { - emblem_t *em; - INT32 yHeight; - - UINT8 bestoverall = G_GetBestNightsGrade(cv_nextmap.value, 0); - UINT8 bestgrade = G_GetBestNightsGrade(cv_nextmap.value, cv_dummymares.value); - UINT32 bestscore = G_GetBestNightsScore(cv_nextmap.value, cv_dummymares.value); - tic_t besttime = G_GetBestNightsTime(cv_nextmap.value, cv_dummymares.value); - - if (P_HasGrades(cv_nextmap.value, 0)) - V_DrawScaledPatch(200, 28 + 8, 0, ngradeletters[bestoverall]); - - if (currentMenu == &SP_NightsAttackDef) - { - if (P_HasGrades(cv_nextmap.value, cv_dummymares.value)) - { - V_DrawString(160-88, 112, highlightflags, "BEST GRADE:"); - V_DrawSmallScaledPatch(160 + 86 - (ngradeletters[bestgrade]->width/2), - 112 + 8 - (ngradeletters[bestgrade]->height/2), - 0, ngradeletters[bestgrade]); - } - - if (!bestscore) - sprintf(beststr, "(none)"); - else - sprintf(beststr, "%u", bestscore); - - V_DrawString(160 - 88, 122, highlightflags, "BEST SCORE:"); - V_DrawRightAlignedString(160 + 88, 122, V_ALLOWLOWERCASE, beststr); - - if (besttime == UINT32_MAX) - sprintf(beststr, "(none)"); - else - sprintf(beststr, "%i:%02i.%02i", G_TicsToMinutes(besttime, true), - G_TicsToSeconds(besttime), - G_TicsToCentiseconds(besttime)); - - V_DrawString(160-88, 132, highlightflags, "BEST TIME:"); - V_DrawRightAlignedString(160+88, 132, V_ALLOWLOWERCASE, beststr); - - if (cv_dummymares.value == 0) { - // Draw record emblems. - em = M_GetLevelEmblems(cv_nextmap.value); - while (em) - { - switch (em->type) - { - case ET_NGRADE: yHeight = 112; break; - case ET_NTIME: yHeight = 132; break; - default: - goto skipThisOne; - } - - if (em->collected) - V_DrawSmallMappedPatch(160+88, yHeight, 0, W_CachePatchName(M_GetEmblemPatch(em), PU_CACHE), - R_GetTranslationColormap(TC_DEFAULT, M_GetEmblemColor(em), GTC_MENUCACHE)); - else - V_DrawSmallScaledPatch(160+88, yHeight, 0, W_CachePatchName("NEEDIT", PU_CACHE)); - - skipThisOne: - em = M_GetLevelEmblems(-1); - } - } - } - // ALWAYS DRAW level name even when not on this menu! - else - { - consvar_t *ncv; - INT32 x = SP_NightsAttackDef.x; - INT32 y = SP_NightsAttackDef.y; - - ncv = (consvar_t *)SP_NightsAttackMenu[0].itemaction; - V_DrawString(x, y + SP_NightsAttackMenu[0].alphaKey, V_TRANSLUCENT, SP_NightsAttackMenu[0].text); - V_DrawString(BASEVIDWIDTH - x - V_StringWidth(ncv->string, 0), - y + SP_NightsAttackMenu[0].alphaKey, highlightflags|V_TRANSLUCENT, ncv->string); - } - } -}*/ - -// Going to Nights Attack menu... -/*static void M_NightsAttack(INT32 choice) -{ - (void)choice; - - memset(skins_cons_t, 0, sizeof (skins_cons_t)); - - levellistmode = LLM_NIGHTSATTACK; // Don't be dependent on cv_newgametype - - if (M_CountLevelsToShowInList() == 0) - { - M_StartMessage(M_GetText("No NiGHTS-attackable levels found.\n"),NULL,MM_NOTHING); - return; - } - - // This is really just to make sure Sonic is the played character, just in case - M_PatchSkinNameTable(); - - M_PrepareLevelSelect(); - M_SetupNextMenu(&SP_NightsAttackDef); - Nextmap_OnChange(); - - itemOn = nastart; // "Start" is selected. - - G_SetGamestate(GS_TIMEATTACK); - S_ChangeMusicInternal("racent", true); -}*/ - -// Player has selected the "START" from the nights attack screen -/*static void M_ChooseNightsAttack(INT32 choice) -{ - char nameofdemo[256]; - (void)choice; - emeralds = 0; - M_ClearMenus(true); - modeattacking = ATTACKING_NIGHTS; - - I_mkdir(va("%s"PATHSEP"replay", srb2home), 0755); - I_mkdir(va("%s"PATHSEP"replay"PATHSEP"%s", srb2home, timeattackfolder), 0755); - - snprintf(nameofdemo, sizeof nameofdemo, "replay"PATHSEP"%s"PATHSEP"%s-last", timeattackfolder, G_BuildMapName(cv_nextmap.value)); - - if (!cv_autorecord.value) - remove(va("%s"PATHSEP"%s.lmp", srb2home, nameofdemo)); - else - G_RecordDemo(nameofdemo); - - G_DeferedInitNew(false, G_BuildMapName(cv_nextmap.value), 0, 0, false); -}*/ - // Player has selected the "START" from the time attack screen static void M_ChooseTimeAttack(INT32 choice) { @@ -8104,21 +6693,29 @@ static void M_ModeAttackEndGame(INT32 choice) if (gamestate == GS_LEVEL || gamestate == GS_INTERMISSION || gamestate == GS_VOTING) Command_ExitGame_f(); + G_SetGamestate(GS_MENU); + + gameaction = ga_nothing; + paused = false; + CON_ToggleOff(); + + S_ChangeMusicInternal("menu", true); + M_StartControlPanel(); + switch(modeattacking) { - default: - case ATTACKING_RECORD: - currentMenu = &SP_TimeAttackDef; - break; - /*case ATTACKING_NIGHTS: - currentMenu = &SP_NightsAttackDef; - break;*/ + default: + case ATTACKING_RECORD: + currentMenu = &SP_TimeAttackDef; + break; + /*case ATTACKING_NIGHTS: + currentMenu = &SP_NightsAttackDef; + break;*/ } itemOn = currentMenu->lastOn; - G_SetGamestate(GS_TIMEATTACK); + modeattacking = ATTACKING_NONE; - S_ChangeMusicInternal("racent", true); // Update replay availability. CV_AddValue(&cv_nextmap, 1); CV_AddValue(&cv_nextmap, -1); @@ -8271,14 +6868,14 @@ static void M_DrawConnectMenu(void) // Room name if (ms_RoomId < 0) - V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + MP_ConnectMenu[mp_connect_room].alphaKey, + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + MP_ConnectMenu[mp_connect_room].mvar1, highlightflags, (itemOn == mp_connect_room) ? "" : ""); else - V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + MP_ServerMenu[mp_server_room].alphaKey, + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + MP_ServerMenu[mp_server_room].mvar1, highlightflags, room_list[menuRoomIndex].name); #undef mp_server_room } @@ -8815,17 +7412,17 @@ static void M_DrawMPMainMenu(void) #if MAXPLAYERS != 16 Update the maxplayers label... #endif - V_DrawRightAlignedString(BASEVIDWIDTH-x, y+MP_MainMenu[4].alphaKey, + V_DrawRightAlignedString(BASEVIDWIDTH-x, y+MP_MainMenu[4].mvar1, ((itemOn == 4) ? highlightflags : 0), "(2-16 players)"); #endif - V_DrawRightAlignedString(BASEVIDWIDTH-x, y+MP_MainMenu[5].alphaKey, + V_DrawRightAlignedString(BASEVIDWIDTH-x, y+MP_MainMenu[5].mvar1, ((itemOn == 5) ? highlightflags : 0), "(2-4 players)" ); #ifndef NONET - y += MP_MainMenu[8].alphaKey; + y += MP_MainMenu[8].mvar1; V_DrawFill(x+5, y+4+5, /*16*8 + 6,*/ BASEVIDWIDTH - 2*(x+5), 8+6, 159); @@ -9591,7 +8188,7 @@ static void M_EraseDataResponse(INT32 ch) // Delete the data if (erasecontext == 2) { - // SRB2Kart: This actually needs to be done FIRST, so that you don't immediately regain playtime/matches secrets + // SRB2Kart: This actually needs to be done FIRST, so that you don't immediately regain playtime/matches extras totalplaytime = 0; matchesplayed = 0; F_StartIntro(); @@ -9612,7 +8209,7 @@ static void M_EraseData(INT32 choice) if (choice == 0) eschoice = M_GetText("Record Attack data"); else if (choice == 1) - eschoice = M_GetText("Secrets data"); + eschoice = M_GetText("Extras data"); else eschoice = M_GetText("ALL game data"); @@ -10098,8 +8695,8 @@ static void M_DrawControl(void) if (currentMenu->menuitems[i].status == IT_CONTROL) { V_DrawString(x, y, ((i == itemOn) ? highlightflags : 0), currentMenu->menuitems[i].text); - keys[0] = setupcontrols[currentMenu->menuitems[i].alphaKey][0]; - keys[1] = setupcontrols[currentMenu->menuitems[i].alphaKey][1]; + keys[0] = setupcontrols[currentMenu->menuitems[i].mvar1][0]; + keys[1] = setupcontrols[currentMenu->menuitems[i].mvar1][1]; tmp[0] ='\0'; if (keys[0] == KEY_NULL && keys[1] == KEY_NULL) @@ -10244,7 +8841,7 @@ static void M_ChangeControl(INT32 choice) // If you change the below message, then change the size of this buffer! static char tmp[68]; - controltochange = currentMenu->menuitems[choice].alphaKey; + controltochange = currentMenu->menuitems[choice].mvar1; sprintf(tmp, M_GetText("Hit the new key for\n%s\nESC for Cancel"), currentMenu->menuitems[choice].text); strlcpy(controltochangetext, currentMenu->menuitems[choice].text, 33); @@ -10441,7 +9038,7 @@ static void M_DrawVideoMenu(void) { M_DrawGenericMenu(); - V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + OP_VideoOptionsMenu[0].alphaKey, + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + OP_VideoOptionsMenu[0].mvar1, (SCR_IsAspectCorrect(vid.width, vid.height) ? recommendedflags : highlightflags), va("%dx%d", vid.width, vid.height)); } @@ -10696,23 +9293,23 @@ static void M_DrawMonitorToggles(void) } #ifdef ITEMTOGGLEBOTTOMRIGHT - if (currentMenu->menuitems[thisitem].alphaKey == 255) + if (currentMenu->menuitems[thisitem].mvar1 == 255) { V_DrawScaledPatch(x, y, V_TRANSLUCENT, W_CachePatchName("K_ISBG", PU_CACHE)); continue; } #endif - if (currentMenu->menuitems[thisitem].alphaKey == 0) + if (currentMenu->menuitems[thisitem].mvar1 == 0) { V_DrawScaledPatch(x, y, 0, W_CachePatchName("K_ISBG", PU_CACHE)); V_DrawScaledPatch(x, y, 0, W_CachePatchName("K_ISTOGL", PU_CACHE)); continue; } - cv = kartitemcvs[currentMenu->menuitems[thisitem].alphaKey-1]; + cv = kartitemcvs[currentMenu->menuitems[thisitem].mvar1-1]; translucent = (cv->value ? 0 : V_TRANSLUCENT); - switch (currentMenu->menuitems[thisitem].alphaKey) + switch (currentMenu->menuitems[thisitem].mvar1) { case KRITEM_DUALJAWZ: drawnum = 2; @@ -10741,11 +9338,11 @@ static void M_DrawMonitorToggles(void) if (drawnum != 0) { V_DrawScaledPatch(x, y, 0, W_CachePatchName("K_ISMUL", PU_CACHE)); - V_DrawScaledPatch(x, y, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[thisitem].alphaKey, true), PU_CACHE)); + V_DrawScaledPatch(x, y, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[thisitem].mvar1, true), PU_CACHE)); V_DrawString(x+24, y+31, V_ALLOWLOWERCASE|translucent, va("x%d", drawnum)); } else - V_DrawScaledPatch(x, y, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[thisitem].alphaKey, true), PU_CACHE)); + V_DrawScaledPatch(x, y, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[thisitem].mvar1, true), PU_CACHE)); y += spacing; } @@ -10756,7 +9353,7 @@ static void M_DrawMonitorToggles(void) { #ifdef ITEMTOGGLEBOTTOMRIGHT - if (currentMenu->menuitems[itemOn].alphaKey == 255) + if (currentMenu->menuitems[itemOn].mvar1 == 255) { V_DrawScaledPatch(onx-1, ony-2, V_TRANSLUCENT, W_CachePatchName("K_ITBG", PU_CACHE)); if (shitsfree) @@ -10771,17 +9368,17 @@ static void M_DrawMonitorToggles(void) } else #endif - if (currentMenu->menuitems[itemOn].alphaKey == 0) + if (currentMenu->menuitems[itemOn].mvar1 == 0) { V_DrawScaledPatch(onx-1, ony-2, 0, W_CachePatchName("K_ITBG", PU_CACHE)); V_DrawScaledPatch(onx-1, ony-2, 0, W_CachePatchName("K_ITTOGL", PU_CACHE)); } else { - cv = kartitemcvs[currentMenu->menuitems[itemOn].alphaKey-1]; + cv = kartitemcvs[currentMenu->menuitems[itemOn].mvar1-1]; translucent = (cv->value ? 0 : V_TRANSLUCENT); - switch (currentMenu->menuitems[itemOn].alphaKey) + switch (currentMenu->menuitems[itemOn].mvar1) { case KRITEM_DUALJAWZ: drawnum = 2; @@ -10806,12 +9403,12 @@ static void M_DrawMonitorToggles(void) if (drawnum != 0) { V_DrawScaledPatch(onx-1, ony-2, 0, W_CachePatchName("K_ITMUL", PU_CACHE)); - V_DrawScaledPatch(onx-1, ony-2, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[itemOn].alphaKey, false), PU_CACHE)); + V_DrawScaledPatch(onx-1, ony-2, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[itemOn].mvar1, false), PU_CACHE)); V_DrawScaledPatch(onx+27, ony+39, translucent, W_CachePatchName("K_ITX", PU_CACHE)); V_DrawKartString(onx+37, ony+34, translucent, va("%d", drawnum)); } else - V_DrawScaledPatch(onx-1, ony-2, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[itemOn].alphaKey, false), PU_CACHE)); + V_DrawScaledPatch(onx-1, ony-2, translucent, W_CachePatchName(K_GetItemPatch(currentMenu->menuitems[itemOn].mvar1, false), PU_CACHE)); } } @@ -10877,7 +9474,7 @@ static void M_HandleMonitorToggles(INT32 choice) case KEY_ENTER: #ifdef ITEMTOGGLEBOTTOMRIGHT - if (currentMenu->menuitems[itemOn].alphaKey == 255) + if (currentMenu->menuitems[itemOn].mvar1 == 255) { //S_StartSound(NULL, sfx_s26d); if (!shitsfree) @@ -10888,7 +9485,7 @@ static void M_HandleMonitorToggles(INT32 choice) } else #endif - if (currentMenu->menuitems[itemOn].alphaKey == 0) + if (currentMenu->menuitems[itemOn].mvar1 == 0) { INT32 v = cv_sneaker.value; S_StartSound(NULL, sfx_s1b4); @@ -10901,7 +9498,7 @@ static void M_HandleMonitorToggles(INT32 choice) else { S_StartSound(NULL, sfx_s1ba); - CV_AddValue(kartitemcvs[currentMenu->menuitems[itemOn].alphaKey-1], 1); + CV_AddValue(kartitemcvs[currentMenu->menuitems[itemOn].mvar1-1], 1); } break; @@ -11006,11 +9603,11 @@ static void M_OGL_DrawFogMenu(void) my = currentMenu->y; M_DrawGenericMenu(); // use generic drawer for cursor, items and title V_DrawString(BASEVIDWIDTH - mx - V_StringWidth(cv_grfogcolor.string, 0), - my + currentMenu->menuitems[FOG_COLOR_ITEM].alphaKey, highlightflags, cv_grfogcolor.string); + my + currentMenu->menuitems[FOG_COLOR_ITEM].mvar1, highlightflags, cv_grfogcolor.string); // blink cursor on FOG_COLOR_ITEM if selected if (itemOn == FOG_COLOR_ITEM && skullAnimCounter < 4) V_DrawCharacter(BASEVIDWIDTH - mx, - my + currentMenu->menuitems[FOG_COLOR_ITEM].alphaKey, '_' | 0x80,false); + my + currentMenu->menuitems[FOG_COLOR_ITEM].mvar1, '_' | 0x80,false); } // ===================== @@ -11023,7 +9620,7 @@ static void M_OGL_DrawColorMenu(void) mx = currentMenu->x; my = currentMenu->y; M_DrawGenericMenu(); // use generic drawer for cursor, items and title - V_DrawString(mx, my + currentMenu->menuitems[0].alphaKey - 10, + V_DrawString(mx, my + currentMenu->menuitems[0].mvar1 - 10, highlightflags, "Gamma correction"); } @@ -11075,6 +9672,7 @@ static void M_HandleFogColor(INT32 choice) } break; } + if (exitmenu) { if (currentMenu->prevMenu) diff --git a/src/m_menu.h b/src/m_menu.h index 62c852e4d..c2451b56f 100644 --- a/src/m_menu.h +++ b/src/m_menu.h @@ -150,8 +150,8 @@ typedef struct menuitem_s // FIXME: should be itemaction_t void *itemaction; - // hotkey in menu or y of the item - UINT8 alphaKey; + // extra variables + UINT8 mvar1; } menuitem_t; extern menuitem_t PlayerMenu[MAXSKINS]; @@ -244,6 +244,19 @@ void M_SetPlaybackMenuPointer(void); INT32 HU_GetHighlightColor(void); // These defines make it a little easier to make menus +#define KARTGAMEMODEMENU(header, source, prev)\ +{\ + header,\ + sizeof(source)/sizeof(menuitem_t),\ + prev,\ + source,\ + M_DrawGenericMenu,\ + M_DrawKartGamemodeMenu,\ + 0, 0,\ + 0,\ + NULL\ +} + #define DEFAULTMENUSTYLE(header, source, prev, x, y)\ {\ header,\ @@ -268,18 +281,6 @@ INT32 HU_GetHighlightColor(void); NULL\ } -#define CENTERMENUSTYLE(header, source, prev, y)\ -{\ - header,\ - sizeof(source)/sizeof(menuitem_t),\ - prev,\ - source,\ - M_DrawCenteredMenu,\ - BASEVIDWIDTH/2, y,\ - 0,\ - NULL\ -} - #define MAPICONMENUSTYLE(header, source, prev)\ {\ header,\ diff --git a/src/v_video.c b/src/v_video.c index 1b1d03baa..8cb0751f7 100644 --- a/src/v_video.c +++ b/src/v_video.c @@ -1608,6 +1608,18 @@ void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string) } } +void V_DrawCenteredString(INT32 x, INT32 y, INT32 option, const char *string) +{ + x -= V_StringWidth(string, option)/2; + V_DrawString(x, y, option, string); +} + +void V_DrawRightAlignedString(INT32 x, INT32 y, INT32 option, const char *string) +{ + x -= V_StringWidth(string, option); + V_DrawString(x, y, option, string); +} + // SRB2kart void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string) { @@ -1709,20 +1721,79 @@ void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string) cx += w; } } + +void V_DrawGamemodeString(INT32 x, INT32 y, INT32 option, const char *string, UINT8 color) +{ + INT32 w, c, cx = x, cy = y, dupx, dupy, scrwidth, left = 0; + const char *ch = string; + const UINT8 *colormap = NULL; + + option &= ~V_FLIP; + + if (option & V_NOSCALESTART) + { + dupx = vid.dupx; + dupy = vid.dupy; + scrwidth = vid.width; + } + else + { + dupx = dupy = 1; + scrwidth = vid.width/vid.dupx; + left = (scrwidth - BASEVIDWIDTH)/2; + } + + colormap = R_GetTranslationColormap(TC_DEFAULT, color, GTC_MENUCACHE); + + for (;;ch++) + { + if (!*ch) + break; + + if (*ch == '\n') + { + cx = x; + cy += 34*dupy; + + continue; + } + + c = toupper(*ch) - AZ_FONTSTART; + + // character does not exist or is a space + if (c < 0 || c >= AZ_FONTSIZE || !gamemode_font[c]) + continue; + + w = (SHORT(gamemode_font[c]->width) - 2) * dupx; + + if (cx > scrwidth) + break; + + if (cx+left + w < 0) //left boundary check + { + cx += w; + continue; + } + + V_DrawFixedPatch(cx<= AZ_FONTSIZE || !gamemode_font[c]) + continue; + else + w += SHORT(gamemode_font[c]->width) - 2; + } + + return w; +} + boolean *heatshifter = NULL; INT32 lastheight = 0; INT32 heatindex[MAXSPLITSCREENPLAYERS] = {0, 0, 0, 0}; diff --git a/src/v_video.h b/src/v_video.h index a48fed4d3..3c2ee8478 100644 --- a/src/v_video.h +++ b/src/v_video.h @@ -175,10 +175,15 @@ char *V_WordWrap(INT32 x, INT32 w, INT32 option, const char *string); // draw a string using the hu_font void V_DrawString(INT32 x, INT32 y, INT32 option, const char *string); -void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string); // SRB2kart void V_DrawCenteredString(INT32 x, INT32 y, INT32 option, const char *string); void V_DrawRightAlignedString(INT32 x, INT32 y, INT32 option, const char *string); +// SRB2kart +void V_DrawKartString(INT32 x, INT32 y, INT32 option, const char *string); +void V_DrawGamemodeString(INT32 x, INT32 y, INT32 option, const char *string, UINT8 color); +void V_DrawCenteredGamemodeString(INT32 x, INT32 y, INT32 option, const char *string, UINT8 color); +void V_DrawRightAlignedGamemodeString(INT32 x, INT32 y, INT32 option, const char *string, UINT8 color); + // draw a string using the hu_font, 0.5x scale void V_DrawSmallString(INT32 x, INT32 y, INT32 option, const char *string); void V_DrawRightAlignedSmallString(INT32 x, INT32 y, INT32 option, const char *string); @@ -212,6 +217,9 @@ INT32 V_SmallStringWidth(const char *string, INT32 option); // Find string width from tny_font chars INT32 V_ThinStringWidth(const char *string, INT32 option); +// SRB2Kart +INT32 V_GamemodeStringWidth(const char *string, INT32 option); + void V_DoPostProcessor(INT32 view, postimg_t type, INT32 param); void V_DrawPatchFill(patch_t *pat);