diff --git a/src/d_main.c b/src/d_main.c index 6455c328..1d78c10c 100644 --- a/src/d_main.c +++ b/src/d_main.c @@ -125,10 +125,12 @@ INT32 postimgparam3; postimg_t postimgtype4 = postimg_none; INT32 postimgparam4; #ifdef _XBOX -boolean nomidimusic = true, nosound = true; +boolean nomidimusic = false; +boolean nosound = true; boolean nodigimusic = true; #else -boolean nomidimusic = false, nosound = false; +boolean nomidimusic = false; +boolean nosound = false; boolean nodigimusic = false; // No fmod-based music #endif @@ -1326,7 +1328,7 @@ void D_SRB2Main(void) if (dedicated) { nosound = true; - nomidimusic = nodigimusic = true; + /*nomidimusic = */nodigimusic = true; } else { @@ -1335,17 +1337,17 @@ void D_SRB2Main(void) if (M_CheckParm("-nosound")) nosound = true; if (M_CheckParm("-nomusic")) // combines -nomidimusic and -nodigmusic - nomidimusic = nodigimusic = true; + /*nomidimusic = */nodigimusic = true; else { - if (M_CheckParm("-nomidimusic")) - nomidimusic = true; ; // WARNING: DOS version initmusic in I_StartupSound + /*if (M_CheckParm("-nomidimusic")) + nomidimusic = true; ; // WARNING: DOS version initmusic in I_StartupSound*/ if (M_CheckParm("-nodigmusic")) nodigimusic = true; // WARNING: DOS version initmusic in I_StartupSound } I_StartupSound(); I_InitMusic(); - S_Init(cv_soundvolume.value, cv_digmusicvolume.value, cv_midimusicvolume.value); + S_Init(cv_soundvolume.value, cv_digmusicvolume.value);//, cv_midimusicvolume.value); CONS_Printf("ST_Init(): Init status bar.\n"); ST_Init(); diff --git a/src/d_netcmd.c b/src/d_netcmd.c index 2229c11e..05639bad 100644 --- a/src/d_netcmd.c +++ b/src/d_netcmd.c @@ -866,7 +866,7 @@ void D_RegisterClientCommands(void) // s_sound.c CV_RegisterVar(&cv_soundvolume); CV_RegisterVar(&cv_digmusicvolume); - CV_RegisterVar(&cv_midimusicvolume); + //CV_RegisterVar(&cv_midimusicvolume); CV_RegisterVar(&cv_numChannels); // i_cdmus.c @@ -4731,7 +4731,7 @@ static void Command_RestartAudio_f(void) I_SetSfxVolume(cv_soundvolume.value); I_SetDigMusicVolume(cv_digmusicvolume.value); - I_SetMIDIMusicVolume(cv_midimusicvolume.value); + //I_SetMIDIMusicVolume(cv_midimusicvolume.value); if (Playing()) // Gotta make sure the player is in a level P_RestoreMusic(&players[consoleplayer]); diff --git a/src/hu_stuff.h b/src/hu_stuff.h index 451cc8d8..1f4bc519 100644 --- a/src/hu_stuff.h +++ b/src/hu_stuff.h @@ -21,7 +21,7 @@ //------------------------------------ // heads up font //------------------------------------ -#define HU_FONTSTART '\x1E' // the first font character +#define HU_FONTSTART '\x19' // the first font character #define HU_FONTEND '~' #define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1) diff --git a/src/k_kart.c b/src/k_kart.c index 5348dc13..0c827370 100644 --- a/src/k_kart.c +++ b/src/k_kart.c @@ -2014,20 +2014,24 @@ void K_DriftDustHandling(mobj_t *spawner) if (spawner->player) { - angle_t playerangle; - - if (spawner->player->speed < 5<player->cmd.forwardmove < 0) + if (spawner->player->pflags & PF_SKIDDOWN) { - playerangle = spawner->angle+ANGLE_180; + anglediff = abs(spawner->angle - spawner->player->frameangle); + if (leveltime % 6 == 0) + S_StartSound(spawner, sfx_screec); // repeated here because it doesn't always happen to be within the range when this is the case } else { - playerangle = spawner->angle; + angle_t playerangle = spawner->angle; + + if (spawner->player->speed < 5<player->cmd.forwardmove < 0) + playerangle += ANGLE_180; + + anglediff = abs(playerangle - R_PointToAngle2(0, 0, spawner->player->rmomx, spawner->player->rmomy)); } - anglediff = abs(playerangle - R_PointToAngle2(0, 0, spawner->player->rmomx, spawner->player->rmomy)); } else { @@ -3746,7 +3750,9 @@ void K_MoveKartPlayer(player_t *player, boolean onground) else if (player->kartstuff[k_boostcharge] > 50) { player->powers[pw_nocontrol] = 40; - S_StartSound(player->mo, sfx_slip); + //S_StartSound(player->mo, sfx_kc34); + S_StartSound(player->mo, sfx_s3k83); + player->pflags |= PF_SKIDDOWN; // cheeky pflag reuse } player->kartstuff[k_boostcharge] = 0; @@ -4891,6 +4897,7 @@ static void K_drawKartMinimap(void) INT32 i = 0; INT32 x, y; INT32 minimaptrans, splitflags = (splitscreen ? 0 : V_SNAPTORIGHT); + boolean dop1later = false; // Draw the HUD only when playing in a level. // hu_stuff needs this, unlike st_stuff. @@ -4942,37 +4949,39 @@ static void K_drawKartMinimap(void) x -= SHORT(AutomapPic->leftoffset); y -= SHORT(AutomapPic->topoffset); - // Player's tiny icons on the Automap. - for (i = 0; i < MAXPLAYERS; i++) + // Player's tiny icons on the Automap. (drawn opposite direction so player 1 is drawn last in splitscreen) + for (i = MAXPLAYERS-1; i >= 0; i--) { - if (i == displayplayer && !splitscreen) - continue; // Do displayplayer later - if (players[i].mo && !players[i].spectator) + if (!playeringame[i]) + continue; + if (!players[i].mo || players[i].spectator) + continue; + + if (!splitscreen && i == displayplayer) { - if (G_BattleGametype() && players[i].kartstuff[k_balloon] <= 0) - continue; - - if (players[i].kartstuff[k_hyudorotimer] > 0) - { - if ((players[i].kartstuff[k_hyudorotimer] < 1*TICRATE/2 - || players[i].kartstuff[k_hyudorotimer] > hyudorotime-(1*TICRATE/2)) - && !(leveltime & 1)) - ; - else - continue; - } - - K_drawKartMinimapHead(&players[i], x, y, splitflags, AutomapPic); + dop1later = true; // Do displayplayer later + continue; } + + if (G_BattleGametype() && players[i].kartstuff[k_balloon] <= 0) + continue; + if (players[i].kartstuff[k_hyudorotimer] > 0) + { + if (!((players[i].kartstuff[k_hyudorotimer] < 1*TICRATE/2 + || players[i].kartstuff[k_hyudorotimer] > hyudorotime-(1*TICRATE/2)) + && !(leveltime & 1))) + continue; + } + + K_drawKartMinimapHead(&players[i], x, y, splitflags, AutomapPic); } - if (splitscreen) - return; // Don't need this for splits + if (!dop1later) + return; // Don't need this splitflags &= ~V_HUDTRANSHALF; splitflags |= V_HUDTRANS; - if (stplyr->mo && !stplyr->spectator) - K_drawKartMinimapHead(stplyr, x, y, splitflags, AutomapPic); + K_drawKartMinimapHead(stplyr, x, y, splitflags, AutomapPic); } static void K_drawBattleFullscreen(void) diff --git a/src/m_menu.c b/src/m_menu.c index 3b16c678..7aeadb26 100644 --- a/src/m_menu.c +++ b/src/m_menu.c @@ -259,13 +259,8 @@ static menu_t SP_TimeAttackDef, SP_ReplayDef, SP_GuestReplayDef, SP_GhostDef; #ifndef NONET static void M_StartServerMenu(INT32 choice); static void M_ConnectMenu(INT32 choice); -static void M_ConnectIPMenu(INT32 choice); #endif static void M_StartSplitServerMenu(INT32 choice); -#ifndef NOFOURPLAYER -static void M_Start3PServerMenu(INT32 choice); -static void M_Start4PServerMenu(INT32 choice); -#endif static void M_StartServer(INT32 choice); #ifndef NONET static void M_Refresh(INT32 choice); @@ -284,11 +279,9 @@ static void M_SetupMultiPlayer4(INT32 choice); // Controls menu_t OP_ControlsDef, /*OP_ControlListDef,*/ OP_MoveControlsDef; menu_t /*OP_MPControlsDef, OP_CameraControlsDef, OP_MiscControlsDef,*/ OP_CustomControlsDef, OP_SpectateControlsDef; -menu_t OP_P1ControlsDef, OP_P2ControlsDef; menu_t OP_MouseOptionsDef, OP_Mouse2OptionsDef; menu_t OP_Joystick1Def, OP_Joystick2Def; #ifndef NOFOURPLAYER -menu_t OP_P3ControlsDef, OP_P4ControlsDef; menu_t OP_Joystick3Def, OP_Joystick4Def; #endif static void M_VideoModeMenu(INT32 choice); @@ -313,9 +306,9 @@ menu_t OP_VideoOptionsDef, OP_VideoModeDef; menu_t OP_OpenGLOptionsDef, OP_OpenGLFogDef, OP_OpenGLColorDef; #endif menu_t OP_SoundOptionsDef; -static void M_ToggleSFX(void); -static void M_ToggleDigital(void); -static void M_ToggleMIDI(void); +static void M_ToggleSFX(INT32 choice); +static void M_ToggleDigital(INT32 choice); +//static void M_ToggleMIDI(INT32 choice); static void M_RestartAudio(void); //Misc @@ -335,7 +328,7 @@ static void M_DrawChecklist(void); static void M_DrawEmblemHints(void); static void M_DrawPauseMenu(void); static void M_DrawServerMenu(void); -static void M_DrawLevelSelectMenu(void); +static void M_DrawSplitServerMenu(void); static void M_DrawImageDef(void); static void M_DrawLoad(void); static void M_DrawLevelStats(void); @@ -344,6 +337,7 @@ 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_DrawVideoMode(void); //static void M_DrawMonitorToggles(void); #ifdef HWRENDER @@ -352,7 +346,7 @@ static void M_OGL_DrawColorMenu(void); #endif #ifndef NONET static void M_DrawConnectMenu(void); -static void M_DrawConnectIPMenu(void); +static void M_DrawMPMainMenu(void); static void M_DrawRoomMenu(void); #endif static void M_DrawJoystick(void); @@ -447,6 +441,12 @@ consvar_t cv_ghost_staff = {"ghost_staff", "Show", CV_SAVE, ghost2_cons_ //Console variables used solely in the menu system. //todo: add a way to use non-console variables in the menu // or make these consvars legitimate like color or skin. +#ifndef NOFOURPLAYER +static void Dummysplitplayers_OnChange(void); +static CV_PossibleValue_t dummysplitplayers_cons_t[] = {{2, "Two"}, {3, "Three"}, {4, "Four"}, {0, NULL}}; +static consvar_t cv_dummysplitplayers = {"dummysplitplayers", "Two", CV_HIDEN|CV_CALL, dummysplitplayers_cons_t, Dummysplitplayers_OnChange, 0, NULL, NULL, 0, 0, NULL}; +#endif + static CV_PossibleValue_t dummyteam_cons_t[] = {{0, "Spectator"}, {1, "Red"}, {2, "Blue"}, {0, NULL}}; static CV_PossibleValue_t dummyscramble_cons_t[] = {{0, "Random"}, {1, "Points"}, {0, NULL}}; static CV_PossibleValue_t ringlimit_cons_t[] = {{0, "MIN"}, {9999, "MAX"}, {0, NULL}}; @@ -608,9 +608,9 @@ static menuitem_t MISC_ChangeTeamMenu[] = static menuitem_t MISC_ChangeLevelMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 30}, - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 60}, - {IT_WHITESTRING|IT_CALL, NULL, "Change Level", M_ChangeLevel, 120}, + {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 68}, + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, + {IT_WHITESTRING|IT_CALL, NULL, "Change Level", M_ChangeLevel, 130}, }; static menuitem_t MISC_HelpMenu[] = @@ -684,9 +684,8 @@ static menuitem_t SR_MainMenu[] = static menuitem_t SR_LevelSelectMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 60}, - - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 120}, + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, + {IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 130}, }; static menuitem_t SR_UnlockChecklistMenu[] = @@ -731,9 +730,8 @@ static menuitem_t SP_LoadGameMenu[] = // Single Player Level Select static menuitem_t SP_LevelSelectMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 60}, - - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 120}, + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, + {IT_WHITESTRING|IT_CALL, NULL, "Start", M_LevelSelectWarp, 130}, }; // Single Player Time Attack @@ -908,52 +906,91 @@ menuitem_t PlayerMenu[32] = // Multiplayer and all of its submenus // ----------------------------------- // Prefix: MP_ + +#ifdef NONET +#define IT_NETCALL IT_DISABLED +#define IT_NETHANDLER IT_DISABLED +#define M_StartServerMenu NULL +#define M_ConnectMenu NULL +#define M_HandleConnectIP NULL +#else +#define IT_NETCALL (IT_STRING|IT_CALL) +#define IT_NETHANDLER (IT_STRING|IT_KEYHANDLER) +#endif + static menuitem_t MP_MainMenu[] = { -#ifndef NONET - {IT_CALL | IT_STRING, NULL, "HOST GAME", M_StartServerMenu, 10}, - {IT_CALL | IT_STRING, NULL, "JOIN GAME (Search)", M_ConnectMenu, 30}, - {IT_CALL | IT_STRING, NULL, "JOIN GAME (Specify IP)", M_ConnectIPMenu, 40}, -#endif - - {IT_CALL | IT_STRING, NULL, "TWO PLAYER GAME", M_StartSplitServerMenu, 60}, - -#ifdef NOFOURPLAYER - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 1", M_SetupMultiPlayer, 80}, - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 2", M_SetupMultiPlayer2, 90}, -#else - {IT_CALL | IT_STRING, NULL, "THREE PLAYER GAME", M_Start3PServerMenu, 70}, - {IT_CALL | IT_STRING, NULL, "FOUR PLAYER GAME", M_Start4PServerMenu, 80}, - - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 1", M_SetupMultiPlayer, 100}, - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 2", M_SetupMultiPlayer2, 110}, - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 3", M_SetupMultiPlayer3, 120}, - {IT_CALL | IT_STRING, NULL, "SETUP PLAYER 4", M_SetupMultiPlayer4, 130}, -#endif + {IT_HEADER, NULL, "Host a game", NULL, 0}, + {IT_NETCALL, NULL, "Internet/LAN...", M_StartServerMenu, 10}, + {IT_STRING|IT_CALL, NULL, "Splitscreen...", M_StartSplitServerMenu, 18}, + {IT_HEADER, NULL, "Join a game", NULL, 32}, + {IT_NETCALL, NULL, "Server browser...", M_ConnectMenu, 42}, + {IT_NETHANDLER, NULL, "Specify IPv4 address:", M_HandleConnectIP, 50}, + {IT_HEADER, NULL, "Player setup", NULL, 80}, + {IT_STRING|IT_CALL, NULL, "Player 1...", M_SetupMultiPlayer, 90}, }; +#undef IT_NETCALL +#undef IT_NETHANDLER +#ifdef NONET +#undef M_StartServerMenu +#undef M_ConnectMenu +#undef M_HandleConnectIP +#endif + static menuitem_t MP_ServerMenu[] = { - {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10}, + {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10}, #ifndef NONET - {IT_STRING|IT_CALL, NULL, "Room...", M_RoomMenu, 20}, - {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Server Name", &cv_servername, 30}, + {IT_STRING|IT_CALL, NULL, "Room...", M_RoomMenu, 20}, + {IT_STRING|IT_CVAR|IT_CV_STRING, NULL, "Server Name", &cv_servername, 30}, #endif - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 80}, + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130}, + {IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130}, }; -enum +// Separated splitscreen and normal servers. +static menuitem_t MP_SplitServerMenu[] = { - mp_server_gametype = 0, -#ifndef NONET - mp_server_room, - mp_server_name, + {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10}, +#ifndef NOFOURPLAYER + {IT_STRING|IT_CVAR, NULL, "Number of players", &cv_dummysplitplayers, 20}, #endif - mp_server_level, - mp_server_start + {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 78}, +#ifdef NOFOURPLAYER + {IT_STRING|IT_CALL, NULL, "Player 1 Setup...", M_SetupMultiPlayer, 110}, + {IT_STRING|IT_CALL, NULL, "Player 2 Setup... ", M_SetupMultiPlayer2, 120}, +#else + {IT_STRING|IT_CALL, NULL, "Player 1 Setup...", M_SetupMultiPlayer, 90}, + {IT_STRING|IT_CALL, NULL, "Player 2 Setup... ", M_SetupMultiPlayer2, 100}, + {IT_GRAYEDOUT, NULL, "Player 3 Setup...", M_SetupMultiPlayer3, 110}, + {IT_GRAYEDOUT, NULL, "Player 4 Setup... ", M_SetupMultiPlayer4, 120}, +#endif + {IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130}, +}; + +#ifndef NOFOURPLAYER +static void Dummysplitplayers_OnChange(void) +{ + UINT8 i = 2; // player 2 is the last unchanging setup + + while (i++ < 4) + { + if (i <= cv_dummysplitplayers.value) + MP_SplitServerMenu[3+i-1].status = IT_STRING|IT_CALL; + else + MP_SplitServerMenu[3+i-1].status = IT_GRAYEDOUT; + } +} +#endif + +static menuitem_t MP_PlayerSetupMenu[] = +{ + {IT_KEYHANDLER | IT_STRING, NULL, "Name", M_HandleSetupMultiPlayer, 0}, + {IT_KEYHANDLER | IT_STRING, NULL, "Character", M_HandleSetupMultiPlayer, 16}, // Tails 01-18-2001 + {IT_KEYHANDLER | IT_STRING, NULL, "Color", M_HandleSetupMultiPlayer, 152}, }; #ifndef NONET @@ -1007,28 +1044,8 @@ static menuitem_t MP_RoomMenu[] = {IT_DISABLED, NULL, "", M_ChooseRoom, 153}, {IT_DISABLED, NULL, "", M_ChooseRoom, 162}, }; - -static menuitem_t MP_ConnectIPMenu[] = -{ - {IT_KEYHANDLER | IT_STRING, NULL, " IP Address:", M_HandleConnectIP, 0}, -}; #endif -// Separated splitscreen and normal servers. -static menuitem_t MP_SplitServerMenu[] = -{ - {IT_STRING|IT_CVAR, NULL, "Game Type", &cv_newgametype, 10}, - {IT_STRING|IT_CVAR, NULL, "Level", &cv_nextmap, 80}, - {IT_WHITESTRING|IT_CALL, NULL, "Start", M_StartServer, 130}, -}; - -static menuitem_t MP_PlayerSetupMenu[] = -{ - {IT_KEYHANDLER | IT_STRING, NULL, "Name", M_HandleSetupMultiPlayer, 0}, - {IT_KEYHANDLER | IT_STRING, NULL, "Character", M_HandleSetupMultiPlayer, 16}, // Tails 01-18-2001 - {IT_KEYHANDLER | IT_STRING, NULL, "Color", M_HandleSetupMultiPlayer, 152}, -}; - // ------------------------------------ // Options and most (?) of its submenus // ------------------------------------ @@ -1052,113 +1069,61 @@ static menuitem_t OP_MainMenu[] = static menuitem_t OP_ControlsMenu[] = { - {IT_SUBMENU | IT_STRING, NULL, "Player 1 Controls...", &OP_P1ControlsDef, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Player 2 Controls...", &OP_P2ControlsDef, 20}, + {IT_CALL | IT_STRING, NULL, "Player 1 Controls...", M_Setup1PControlsMenu, 10}, + {IT_CALL | IT_STRING, NULL, "Player 2 Controls...", M_Setup2PControlsMenu, 20}, #ifdef NOFOURPLAYER {IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 40}, #else - {IT_SUBMENU | IT_STRING, NULL, "Player 3 Controls...", &OP_P3ControlsDef, 30}, - {IT_SUBMENU | IT_STRING, NULL, "Player 4 Controls...", &OP_P4ControlsDef, 40}, + {IT_CALL | IT_STRING, NULL, "Player 3 Controls...", &M_Setup3PControlsMenu, 30}, + {IT_CALL | IT_STRING, NULL, "Player 4 Controls...", &M_Setup4PControlsMenu, 40}, {IT_STRING | IT_CVAR, NULL, "Controls per key", &cv_controlperkey, 60}, #endif }; -static menuitem_t OP_P1ControlsMenu[] = -{ - {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup1PControlsMenu, 10}, - //{IT_SUBMENU | IT_STRING, NULL, "Mouse Options...", &OP_MouseOptionsDef, 20}, - {IT_SUBMENU | IT_STRING, NULL, "Joystick Options...", &OP_Joystick1Def , 20}, - - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam , 40}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair , 50}, - - //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog, 80}, -}; - -static menuitem_t OP_P2ControlsMenu[] = -{ - {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup2PControlsMenu, 10}, - //{IT_SUBMENU | IT_STRING, NULL, "Second Mouse Options...", &OP_Mouse2OptionsDef, 20}, - {IT_SUBMENU | IT_STRING, NULL, "Second Joystick Options...", &OP_Joystick2Def , 20}, - - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam2 , 40}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair2, 50}, - - //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog2, 70}, -}; - -#ifndef NOFOURPLAYER -static menuitem_t OP_P3ControlsMenu[] = -{ - {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup3PControlsMenu, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Third Joystick Options...", &OP_Joystick3Def , 20}, - - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam3 , 40}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair3, 50}, - - //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog3, 60}, -}; - -static menuitem_t OP_P4ControlsMenu[] = -{ - {IT_CALL | IT_STRING, NULL, "Control Configuration...", M_Setup4PControlsMenu, 10}, - {IT_SUBMENU | IT_STRING, NULL, "Fourth Joystick Options...", &OP_Joystick4Def , 20}, - - {IT_STRING | IT_CVAR, NULL, "Camera" , &cv_chasecam4 , 40}, - {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair4, 50}, - - //{IT_STRING | IT_CVAR, NULL, "Analog Control", &cv_useranalog4, 60}, -}; -#endif - -/*static menuitem_t OP_ControlListMenu[] = -{ - {IT_SUBMENU | IT_STRING, NULL, "Kart Controls...", &OP_MoveControlsDef, 10}, -// {IT_SUBMENU | IT_STRING, NULL, "Multiplayer Controls...", &OP_MPControlsDef, 20}, -// {IT_SUBMENU | IT_STRING, NULL, "Camera Controls...", &OP_CameraControlsDef, 20}, -// {IT_SUBMENU | IT_STRING, NULL, "Miscellaneous Controls...", &OP_MiscControlsDef, 20}, -};*/ - static menuitem_t OP_MoveControlsMenu[] = { - {IT_CALL | IT_STRING2, NULL, "Aim Forward", M_ChangeControl, gc_aimforward }, - {IT_CALL | IT_STRING2, NULL, "Aim Backward", M_ChangeControl, gc_aimbackward}, - {IT_CALL | IT_STRING2, NULL, "Turn Left", M_ChangeControl, gc_turnleft }, - {IT_CALL | IT_STRING2, NULL, "Turn Right", M_ChangeControl, gc_turnright }, - {IT_CALL | IT_STRING2, NULL, "Accelerate", M_ChangeControl, gc_accelerate }, - {IT_CALL | IT_STRING2, NULL, "Drift", M_ChangeControl, gc_drift }, - {IT_CALL | IT_STRING2, NULL, "Brake", M_ChangeControl, gc_brake }, - {IT_CALL | IT_STRING2, NULL, "Use/Throw Item", M_ChangeControl, gc_fire }, - {IT_CALL | IT_STRING2, NULL, "Look Backward", M_ChangeControl, gc_lookback }, + {IT_CONTROL, NULL, "Accelerate", M_ChangeControl, gc_accelerate }, + {IT_CONTROL, NULL, "Turn Left", M_ChangeControl, gc_turnleft }, + {IT_CONTROL, NULL, "Turn Right", M_ChangeControl, gc_turnright }, + {IT_CONTROL, NULL, "Drift", M_ChangeControl, gc_drift }, + {IT_CONTROL, NULL, "Brake", M_ChangeControl, gc_brake }, + {IT_CONTROL, NULL, "Use/Throw Item", M_ChangeControl, gc_fire }, + {IT_CONTROL, NULL, "Aim Forward", M_ChangeControl, gc_aimforward }, + {IT_CONTROL, NULL, "Aim Backward", M_ChangeControl, gc_aimbackward}, + {IT_CONTROL, NULL, "Look Backward", M_ChangeControl, gc_lookback }, - {IT_CALL | IT_STRING2, NULL, "Talk key", M_ChangeControl, gc_talkkey }, - {IT_CALL | IT_STRING2, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey }, - {IT_CALL | IT_STRING2, NULL, "Rankings/Scores", M_ChangeControl, gc_scores }, + {IT_SPACE, NULL, "", NULL, 76}, + {IT_CONTROL, NULL, "Talk key", M_ChangeControl, gc_talkkey }, + //{IT_CONTROL, NULL, "Team-Talk key", M_ChangeControl, gc_teamkey }, + {IT_CONTROL, NULL, "Rankings/Scores", M_ChangeControl, gc_scores }, + {IT_CONTROL, NULL, "Pause", M_ChangeControl, gc_pause }, + {IT_CONTROL, NULL, "Console", M_ChangeControl, gc_console }, - {IT_CALL | IT_STRING2, NULL, "Pause", M_ChangeControl, gc_pause }, - {IT_CALL | IT_STRING2, NULL, "Console", M_ChangeControl, gc_console }, - - {IT_SUBMENU | IT_STRING, NULL, "Spectator Controls...", &OP_SpectateControlsDef, 112}, - {IT_SUBMENU | IT_STRING, NULL, "Custom Lua Actions...", &OP_CustomControlsDef, 120}, + {IT_SUBMENU | IT_STRING, NULL, "Gamepad Options...", &OP_Joystick1Def, 112}, + {IT_SUBMENU | IT_STRING, NULL, "Spectator Controls...", &OP_SpectateControlsDef, 120}, + {IT_SUBMENU | IT_STRING, NULL, "Custom Lua Actions...", &OP_CustomControlsDef, 128}, }; static menuitem_t OP_SpectateControlsMenu[] = { - {IT_CALL | IT_STRING2, NULL, "Spectate", M_ChangeControl, gc_spectate }, - {IT_CALL | IT_STRING2, NULL, "Look Up", M_ChangeControl, gc_lookup }, - {IT_CALL | IT_STRING2, NULL, "Look Down", M_ChangeControl, gc_lookdown }, - {IT_CALL | IT_STRING2, NULL, "Center View", M_ChangeControl, gc_centerview}, - {IT_CALL | IT_STRING2, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, - {IT_CALL | IT_STRING2, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle }, + {IT_CONTROL, NULL, "Become Spectator", M_ChangeControl, gc_spectate }, + {IT_CONTROL, NULL, "Look Up", M_ChangeControl, gc_lookup }, + {IT_CONTROL, NULL, "Look Down", M_ChangeControl, gc_lookdown }, + {IT_CONTROL, NULL, "Center View", M_ChangeControl, gc_centerview}, + {IT_CONTROL, NULL, "Reset Camera", M_ChangeControl, gc_camreset }, + {IT_CONTROL, NULL, "Toggle Chasecam", M_ChangeControl, gc_camtoggle }, + + {IT_STRING | IT_CVAR, NULL, "Chasecam" , &cv_chasecam , 52}, + {IT_STRING | IT_CVAR, NULL, "Crosshair", &cv_crosshair, 60}, }; static menuitem_t OP_CustomControlsMenu[] = { - {IT_CALL | IT_STRING2, NULL, "Custom Action 1", M_ChangeControl, gc_custom1}, - {IT_CALL | IT_STRING2, NULL, "Custom Action 2", M_ChangeControl, gc_custom2}, - {IT_CALL | IT_STRING2, NULL, "Custom Action 3", M_ChangeControl, gc_custom3}, + {IT_CONTROL, NULL, "Custom Action 1", M_ChangeControl, gc_custom1}, + {IT_CONTROL, NULL, "Custom Action 2", M_ChangeControl, gc_custom2}, + {IT_CONTROL, NULL, "Custom Action 3", M_ChangeControl, gc_custom3}, }; // Obsolete thanks to Kart @@ -1200,7 +1165,7 @@ static menuitem_t OP_MiscControlsMenu[] = static menuitem_t OP_Joystick1Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup1PJoystickMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup1PJoystickMenu, 10}, {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis , 30}, {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis , 40}, {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis , 50}, @@ -1212,7 +1177,7 @@ static menuitem_t OP_Joystick1Menu[] = static menuitem_t OP_Joystick2Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup2PJoystickMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup2PJoystickMenu, 10}, {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis2 , 30}, {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis2 , 40}, {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis2 , 50}, @@ -1225,7 +1190,7 @@ static menuitem_t OP_Joystick2Menu[] = #ifndef NOFOURPLAYER static menuitem_t OP_Joystick3Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup3PJoystickMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup3PJoystickMenu, 10}, {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis3 , 30}, {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis3 , 40}, {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis3 , 50}, @@ -1237,7 +1202,7 @@ static menuitem_t OP_Joystick3Menu[] = static menuitem_t OP_Joystick4Menu[] = { - {IT_STRING | IT_CALL, NULL, "Select Joystick..." , M_Setup4PJoystickMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Select Gamepad..." , M_Setup4PJoystickMenu, 10}, {IT_STRING | IT_CVAR, NULL, "Aim Forward/Back" , &cv_aimaxis4 , 30}, {IT_STRING | IT_CVAR, NULL, "Turn Left/Right" , &cv_turnaxis4 , 40}, {IT_STRING | IT_CVAR, NULL, "Accelerate" , &cv_moveaxis4 , 50}, @@ -1259,7 +1224,7 @@ static menuitem_t OP_JoystickSetMenu[] = {IT_CALL | IT_NOTHING, "", NULL, M_AssignJoystick, '6'}, }; -static menuitem_t OP_MouseOptionsMenu[] = +/*static menuitem_t OP_MouseOptionsMenu[] = { {IT_STRING | IT_CVAR, NULL, "Use Mouse", &cv_usemouse, 10}, @@ -1285,11 +1250,11 @@ static menuitem_t OP_Mouse2OptionsMenu[] = NULL, "Mouse X Speed", &cv_mousesens2, 60}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "Mouse Y Speed", &cv_mouseysens2, 70}, -}; +};*/ static menuitem_t OP_VideoOptionsMenu[] = { - {IT_STRING | IT_CALL, NULL, "Resolution Modes...", M_VideoModeMenu, 10}, + {IT_STRING | IT_CALL, NULL, "Set Resolution...", M_VideoModeMenu, 10}, #ifdef HWRENDER {IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 20}, #endif @@ -1300,13 +1265,13 @@ static menuitem_t OP_VideoOptionsMenu[] = NULL, "Gamma", &cv_usegamma, 50}, {IT_STRING | IT_CVAR, NULL, "Draw Distance", &cv_drawdist, 70}, - {IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 80}, - {IT_STRING | IT_CVAR, NULL, "Precip Draw Dist", &cv_drawdist_precip, 90}, - {IT_STRING | IT_CVAR, NULL, "Precip Density", &cv_precipdensity, 100}, - {IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 110}, + //{IT_STRING | IT_CVAR, NULL, "NiGHTS Draw Dist", &cv_drawdist_nights, 80}, + {IT_STRING | IT_CVAR, NULL, "Weather Draw Dist.", &cv_drawdist_precip, 80}, + {IT_STRING | IT_CVAR, NULL, "Weather Density", &cv_precipdensity, 90}, + {IT_STRING | IT_CVAR, NULL, "Skyboxes", &cv_skybox, 100}, - {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 130}, - {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 140}, + {IT_STRING | IT_CVAR, NULL, "Show FPS", &cv_ticrate, 120}, + {IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 130}, }; static menuitem_t OP_VideoModeMenu[] = @@ -1359,25 +1324,31 @@ static menuitem_t OP_OpenGLColorMenu[] = static menuitem_t OP_SoundOptionsMenu[] = { + {IT_KEYHANDLER|IT_STRING, NULL, "SFX", M_ToggleSFX, 10}, {IT_STRING|IT_CVAR|IT_CV_SLIDER, - NULL, "SFX Volume", &cv_soundvolume, 10}, + NULL, "SFX Volume", &cv_soundvolume, 18}, + + {IT_KEYHANDLER|IT_STRING, NULL, "Music", M_ToggleDigital, 30}, {IT_STRING|IT_CVAR|IT_CV_SLIDER, - NULL, "Music Volume", &cv_digmusicvolume, 20}, + NULL, "Music Volume", &cv_digmusicvolume, 38}, + +/* -- :nonnathisshit: + {IT_KEYHANDLER|IT_STRING, NULL, "MIDI", M_ToggleMIDI, 50}, {IT_STRING|IT_CVAR|IT_CV_SLIDER, - NULL, "MIDI Volume", &cv_midimusicvolume, 30}, + NULL, "MIDI Volume", &cv_midimusicvolume, 58}, #ifdef PC_DOS {IT_STRING|IT_CVAR|IT_CV_SLIDER, NULL, "CD Volume", &cd_volume, 40}, -#endif - {IT_STRING|IT_CALL, NULL, "Toggle SFX", M_ToggleSFX, 50}, - {IT_STRING|IT_CALL, NULL, "Toggle Music", M_ToggleDigital, 60}, - {IT_STRING|IT_CALL, NULL, "Toggle MIDI", M_ToggleMIDI, 70}, - {IT_STRING|IT_CALL, NULL, "Restart Audio System", M_RestartAudio, 80}, +#endif*/ - {IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 100}, - {IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 110}, + {IT_STRING|IT_CALL, NULL, "Restart Audio System", M_RestartAudio, 50}, - {IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 130}, + {IT_STRING|IT_CVAR, NULL, "Reverse L/R Channels", &stereoreverse, 70}, + {IT_STRING|IT_CVAR, NULL, "Surround Sound", &surround, 80}, + + {IT_STRING|IT_CVAR, NULL, "Powerup warning", &cv_kartinvinsfx, 100}, + + {IT_KEYHANDLER|IT_STRING, NULL, "Sound Test", M_HandleSoundTest, 120}, }; /*static menuitem_t OP_DataOptionsMenu[] = @@ -1430,7 +1401,7 @@ static menuitem_t OP_EraseDataMenu[] = static menuitem_t OP_HUDOptionsMenu[] = { - {IT_STRING | IT_CVAR, NULL, "Show HUD", &cv_showhud, 10}, + {IT_STRING | IT_CVAR, NULL, "Show HUD", &cv_showhud, 10}, {IT_STRING | IT_CVAR | IT_CV_SLIDER, NULL, "HUD Visibility", &cv_translucenthud, 20}, @@ -1438,10 +1409,9 @@ static menuitem_t OP_HUDOptionsMenu[] = NULL, "Minimap Visibility", &cv_kartminimap, 40}, {IT_STRING | IT_CVAR, NULL, "Speedometer Display", &cv_kartspeedometer, 50}, {IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 60}, - {IT_STRING | IT_CVAR, NULL, "Invinciblity SFX", &cv_kartinvinsfx, 70}, - {IT_STRING | IT_CVAR, NULL, "Console Color", &cons_backcolor, 90}, - {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 100}, + {IT_STRING | IT_CVAR, NULL, "Console Color", &cons_backcolor, 80}, + {IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 90}, }; static menuitem_t OP_GameOptionsMenu[] = @@ -1581,17 +1551,9 @@ menu_t SR_MainDef = 0, NULL }; -menu_t SR_LevelSelectDef = -{ - 0, - sizeof (SR_LevelSelectMenu)/sizeof (menuitem_t), - &SR_MainDef, - SR_LevelSelectMenu, - M_DrawLevelSelectMenu, - 40, 40, - 0, - NULL -}; + +menu_t SR_LevelSelectDef = MAPICONMENUSTYLE(NULL, SR_LevelSelectMenu, &SR_MainDef); + menu_t SR_UnlockChecklistDef = { NULL, @@ -1757,8 +1719,30 @@ menu_t SP_PlayerDef = }; // Multiplayer -menu_t MP_MainDef = DEFAULTMENUSTYLE("M_MULTI", MP_MainMenu, &MainDef, 60, 40); +menu_t MP_MainDef = +{ + "M_MULTI", + sizeof (MP_MainMenu)/sizeof (menuitem_t), + &MainDef, + MP_MainMenu, + M_DrawMPMainMenu, + 42, 40, + 0, + M_CancelConnect +}; menu_t MP_ServerDef = MAPICONMENUSTYLE("M_MULTI", MP_ServerMenu, &MP_MainDef); +//menu_t MP_SplitServerDef = MAPICONMENUSTYLE("M_MULTI", MP_SplitServerMenu, &MP_MainDef); +menu_t MP_SplitServerDef = +{ + "M_MULTI", + sizeof (MP_SplitServerMenu)/sizeof (menuitem_t), + &MP_MainDef, + MP_SplitServerMenu, + M_DrawSplitServerMenu, + 42,40, + 0, + NULL +}; #ifndef NONET menu_t MP_ConnectDef = { @@ -1771,17 +1755,6 @@ menu_t MP_ConnectDef = 0, M_CancelConnect }; -menu_t MP_ConnectIPDef = -{ - "M_MULTI", - sizeof (MP_ConnectIPMenu)/sizeof (menuitem_t), - &MP_MainDef, - MP_ConnectIPMenu, - M_DrawConnectIPMenu, - 27,40, - 0, - M_CancelConnect -}; menu_t MP_RoomDef = { "M_MULTI", @@ -1794,9 +1767,6 @@ menu_t MP_RoomDef = NULL }; #endif -menu_t MP_SplitServerDef = MAPICONMENUSTYLE("M_MULTI", MP_SplitServerMenu, &MP_MainDef); -menu_t MP_3PServerDef = MAPICONMENUSTYLE("M_MULTI", MP_SplitServerMenu, &MP_MainDef); -menu_t MP_4PServerDef = MAPICONMENUSTYLE("M_MULTI", MP_SplitServerMenu, &MP_MainDef); menu_t MP_PlayerSetupDef = { NULL, //"M_SPLAYR" @@ -1830,6 +1800,7 @@ menu_t OP_MoveControlsDef = CONTROLMENUSTYLE(OP_MoveControlsMenu, &OP_ControlsDe //menu_t OP_MiscControlsDef = CONTROLMENUSTYLE(OP_MiscControlsMenu, &OP_ControlListDef); menu_t OP_CustomControlsDef = CONTROLMENUSTYLE(OP_CustomControlsMenu, &OP_MoveControlsDef); menu_t OP_SpectateControlsDef = CONTROLMENUSTYLE(OP_SpectateControlsMenu, &OP_MoveControlsDef); +/* menu_t OP_P1ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P1ControlsMenu, &OP_ControlsDef, 60, 30); menu_t OP_P2ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P2ControlsMenu, &OP_ControlsDef, 60, 30); #ifndef NOFOURPLAYER @@ -1838,11 +1809,12 @@ menu_t OP_P4ControlsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_P4ControlsMenu, &OP_Co #endif menu_t OP_MouseOptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_MouseOptionsMenu, &OP_P1ControlsDef, 60, 30); menu_t OP_Mouse2OptionsDef = DEFAULTMENUSTYLE("M_CONTRO", OP_Mouse2OptionsMenu, &OP_P2ControlsDef, 60, 30); -menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_P1ControlsDef, 60, 30); -menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_P2ControlsDef, 60, 30); +*/ +menu_t OP_Joystick1Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick1Menu, &OP_MoveControlsDef, 60, 30); +menu_t OP_Joystick2Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick2Menu, &OP_MoveControlsDef, 60, 30); #ifndef NOFOURPLAYER -menu_t OP_Joystick3Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_P3ControlsDef, 60, 30); -menu_t OP_Joystick4Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_P4ControlsDef, 60, 30); +menu_t OP_Joystick3Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick3Menu, &OP_MoveControlsDef, 60, 30); +menu_t OP_Joystick4Def = DEFAULTMENUSTYLE("M_CONTRO", OP_Joystick4Menu, &OP_MoveControlsDef, 60, 30); #endif menu_t OP_JoystickSetDef = { @@ -1856,7 +1828,18 @@ menu_t OP_JoystickSetDef = NULL }; -menu_t OP_VideoOptionsDef = DEFAULTMENUSTYLE("M_VIDEO", OP_VideoOptionsMenu, &OP_MainDef, 60, 30); +menu_t OP_VideoOptionsDef = +{ + "M_VIDEO", + sizeof(OP_VideoOptionsMenu)/sizeof(menuitem_t), + &OP_MainDef, + OP_VideoOptionsMenu, + M_DrawVideoMenu, + 60, 30, + 0, + NULL +}; + menu_t OP_VideoModeDef = { "M_VIDEO", @@ -2155,8 +2138,8 @@ static void Newgametype_OnChange(void) } CV_SetValue(&cv_nextmap, M_FindFirstMap(value)); - CV_AddValue(&cv_nextmap, -1); - CV_AddValue(&cv_nextmap, 1); + //CV_AddValue(&cv_nextmap, -1); + //CV_AddValue(&cv_nextmap, 1); } } } @@ -2224,26 +2207,38 @@ static void M_ChangeCvar(INT32 choice) static boolean M_ChangeStringCvar(INT32 choice) { consvar_t *cv = (consvar_t *)currentMenu->menuitems[itemOn].itemaction; - char buf[255]; + char buf[MAXSTRINGLENGTH]; size_t len; + if (shiftdown && choice >= 32 && choice <= 127) + choice = shiftxform[choice]; + switch (choice) { case KEY_BACKSPACE: len = strlen(cv->string); if (len > 0) { + S_StartSound(NULL,sfx_menu1); // Tails M_Memcpy(buf, cv->string, len); buf[len-1] = 0; CV_Set(cv, buf); } return true; + case KEY_DEL: + if (cv->string[0]) + { + S_StartSound(NULL,sfx_menu1); // Tails + CV_Set(cv, ""); + } + return true; default: if (choice >= 32 && choice <= 127) { len = strlen(cv->string); if (len < MAXSTRINGLENGTH - 1) { + S_StartSound(NULL,sfx_menu1); // Tails M_Memcpy(buf, cv->string, len); buf[len++] = (char)choice; buf[len] = 0; @@ -2959,6 +2954,9 @@ void M_Init(void) return; // Menu hacks +#ifndef NOFOURPLAYER + CV_RegisterVar(&cv_dummysplitplayers); +#endif CV_RegisterVar(&cv_dummyteam); CV_RegisterVar(&cv_dummyscramble); CV_RegisterVar(&cv_dummyrings); @@ -2971,7 +2969,7 @@ void M_Init(void) quitmsg[QUITMSG1] = M_GetText("What would Tails say if\nhe saw you quitting the game?\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG2] = M_GetText("Hey!\nWhere do ya think you're goin'?\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG3] = M_GetText("Forget your studies!\nPlay some more!\n\n(Press 'Y' to quit)"); - quitmsg[QUITMSG4] = M_GetText("You're trying to say you\nlike Team Sonic Racing better than\nthis, aren't you?\n\n(Press 'Y' to quit)"); + quitmsg[QUITMSG4] = M_GetText("You're trying to say you\nlike Sonic R better than\nthis, aren't you?\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG5] = M_GetText("Don't leave yet -- there's a\nsuper emerald around that corner!\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG6] = M_GetText("You'd rather work than play?\n\n(Press 'Y' to quit)"); quitmsg[QUITMSG7] = M_GetText("Go ahead and leave. See if I care...\n*sniffle*\n\n(Press 'Y' to quit)"); @@ -3062,7 +3060,7 @@ static void M_DrawThermo(INT32 x, INT32 y, consvar_t *cv) } // A smaller 'Thermo', with range given as percents (0-100) -static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv) +static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv, boolean ontop) { INT32 i; INT32 range; @@ -3070,16 +3068,31 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv) for (i = 0; cv->PossibleValue[i+1].strvalue; i++); - range = ((cv->value - cv->PossibleValue[0].value) * 100 / - (cv->PossibleValue[i].value - cv->PossibleValue[0].value)); - - if (range < 0) - range = 0; - if (range > 100) - range = 100; - x = BASEVIDWIDTH - x - SLIDER_WIDTH; + if (ontop) + { + V_DrawCharacter(x - 15 - (skullAnimCounter/5), y, + '\x1C' | V_YELLOWMAP, false); // left arrow + V_DrawCharacter(x+(SLIDER_RANGE*8) + 8 + (skullAnimCounter/5), y, + '\x1D' | V_YELLOWMAP, false); // right arrow + } + + if ((range = atoi(cv->defaultvalue)) != cv->value) + { + range = ((range - cv->PossibleValue[0].value) * 100 / + (cv->PossibleValue[1].value - cv->PossibleValue[0].value)); + + if (range < 0) + range = 0; + if (range > 100) + range = 100; + + // draw the default + p = W_CachePatchName("M_SLIDEC", PU_CACHE); + V_DrawScaledPatch(x - 4 + (((SLIDER_RANGE)*8 + 4)*range)/100, y, 0, p); + } + V_DrawScaledPatch(x - 8, y, 0, W_CachePatchName("M_SLIDEL", PU_CACHE)); p = W_CachePatchName("M_SLIDEM", PU_CACHE); @@ -3089,9 +3102,17 @@ static void M_DrawSlider(INT32 x, INT32 y, const consvar_t *cv) p = W_CachePatchName("M_SLIDER", PU_CACHE); V_DrawScaledPatch(x+SLIDER_RANGE*8, y, 0, p); + range = ((cv->value - cv->PossibleValue[0].value) * 100 / + (cv->PossibleValue[1].value - cv->PossibleValue[0].value)); + + if (range < 0) + range = 0; + if (range > 100) + range = 100; + // draw the slider cursor p = W_CachePatchName("M_SLIDEC", PU_CACHE); - V_DrawMappedPatch(x + ((SLIDER_RANGE-1)*8*range)/100, y, 0, p, yellowmap); + V_DrawScaledPatch(x - 4 + (((SLIDER_RANGE)*8 + 4)*range)/100, y, 0, p); } // @@ -3284,7 +3305,7 @@ static void M_DrawGenericMenu(void) /* FALLTHRU */ case IT_NOTHING: case IT_DYBIGSPACE: - y += LINEHEIGHT; + y = currentMenu->y+currentMenu->menuitems[i].alphaKey;//+= LINEHEIGHT; break; case IT_BIGSLIDER: M_DrawThermo(x, y, (consvar_t *)currentMenu->menuitems[i].itemaction); @@ -3310,7 +3331,7 @@ static void M_DrawGenericMenu(void) switch (currentMenu->menuitems[i].status & IT_CVARTYPE) { case IT_CV_SLIDER: - M_DrawSlider(x, y, cv); + M_DrawSlider(x, y, cv, (i == itemOn)); case IT_CV_NOPRINT: // color use this case IT_CV_INVISSLIDER: // monitor toggles use this break; @@ -3325,6 +3346,13 @@ static void M_DrawGenericMenu(void) default: V_DrawString(BASEVIDWIDTH - x - V_StringWidth(cv->string, 0), y, ((cv->flags & CV_CHEAT) && !CV_IsSetToDefault(cv) ? V_REDMAP : V_YELLOWMAP), cv->string); + if (i == itemOn) + { + V_DrawCharacter(BASEVIDWIDTH - x - 10 - V_StringWidth(cv->string, 0) - (skullAnimCounter/5), y, + '\x1C' | V_YELLOWMAP, false); // left arrow + V_DrawCharacter(BASEVIDWIDTH - x + 2 + (skullAnimCounter/5), y, + '\x1D' | V_YELLOWMAP, false); // right arrow + } break; } break; @@ -3598,7 +3626,7 @@ static void M_DrawCenteredMenu(void) switch(currentMenu->menuitems[i].status & IT_CVARTYPE) { case IT_CV_SLIDER: - M_DrawSlider(x, y, cv); + M_DrawSlider(x, y, cv, (i == itemOn)); case IT_CV_NOPRINT: // color use this break; case IT_CV_STRING: @@ -4439,47 +4467,65 @@ static void M_DrawEmblemHints(void) M_DrawGenericMenu(); } -static void M_DrawLevelSelectMenu(void) -{ - M_DrawGenericMenu(); - - if (cv_nextmap.value) - { - lumpnum_t lumpnum; - patch_t *PictureOfLevel; - - // A 160x100 image of the level as entry MAPxxP - lumpnum = W_CheckNumForName(va("%sP", G_BuildMapName(cv_nextmap.value))); - - if (lumpnum != LUMPERROR) - PictureOfLevel = W_CachePatchName(va("%sP", G_BuildMapName(cv_nextmap.value)), PU_CACHE); - else - PictureOfLevel = W_CachePatchName("BLANKLVL", PU_CACHE); - - V_DrawSmallScaledPatch(200, 110, 0, PictureOfLevel); - } -} - static void M_DrawSkyRoom(void) { INT32 i, y = 0; + INT32 lengthstring = 0; M_DrawGenericMenu(); + if (currentMenu == &OP_SoundOptionsDef) + { + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, + currentMenu->y+currentMenu->menuitems[0].alphaKey, + (nosound ? V_REDMAP : V_YELLOWMAP), + ((nosound || sound_disabled) ? "OFF" : "ON")); + + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, + currentMenu->y+currentMenu->menuitems[2].alphaKey, + (nodigimusic ? V_REDMAP : V_YELLOWMAP), + ((nodigimusic || digital_disabled) ? "OFF" : "ON")); + + /*V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, + currentMenu->y+currentMenu->menuitems[5].alphaKey, + (nomidimusic ? V_REDMAP : V_YELLOWMAP), + ((nomidimusic || music_disabled) ? "OFF" : "ON"));*/ + + if (itemOn == 0) + lengthstring = 8*((nosound || sound_disabled) ? 3 : 2); + else if (itemOn == 2) + lengthstring = 8*((nodigimusic || digital_disabled) ? 3 : 2); + /*else if (itemOn == 5) + lengthstring = 8*((nomidimusic || music_disabled) ? 3 : 2);*/ + } + for (i = 0; i < currentMenu->numitems; ++i) { - if (currentMenu->menuitems[i].status == (IT_STRING|IT_KEYHANDLER)) + if (currentMenu->menuitems[i].itemaction == M_HandleSoundTest) { y = currentMenu->menuitems[i].alphaKey; break; } } - if (!y) - return; + if (y) + { + y += currentMenu->y; - V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + y, V_YELLOWMAP, cv_soundtest.string); - if (cv_soundtest.value) - V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + y + 8, V_YELLOWMAP, S_sfx[cv_soundtest.value].name); + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, y, V_YELLOWMAP, cv_soundtest.string); + if (cv_soundtest.value) + V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, y + 8, V_YELLOWMAP, S_sfx[cv_soundtest.value].name); + + if (i == itemOn) + lengthstring = V_StringWidth(cv_soundtest.string, 0); + } + + if (lengthstring) + { + V_DrawCharacter(BASEVIDWIDTH - currentMenu->x - 10 - lengthstring - (skullAnimCounter/5), currentMenu->y+currentMenu->menuitems[itemOn].alphaKey, + '\x1C' | V_YELLOWMAP, false); + V_DrawCharacter(BASEVIDWIDTH - currentMenu->x + 2 + (skullAnimCounter/5), currentMenu->y+currentMenu->menuitems[itemOn].alphaKey, + '\x1D' | V_YELLOWMAP, false); + } } static void M_HandleSoundTest(INT32 choice) @@ -6558,13 +6604,16 @@ static void M_ChooseRoom(INT32 choice) // // FindFirstMap // -// Finds the first map of a particular gametype +// Finds the first map of a particular gametype (or returns the current map) // Defaults to 1 if nothing found. // static INT32 M_FindFirstMap(INT32 gtype) { INT32 i; + if (mapheaderinfo[gamemap] && (mapheaderinfo[gamemap]->typeoflevel & gtype)) + return gamemap; + for (i = 0; i < NUMMAPS; i++) { if (mapheaderinfo[i] && (mapheaderinfo[i]->typeoflevel & gtype)) @@ -6578,15 +6627,16 @@ static void M_StartServer(INT32 choice) { UINT8 ssplayers = 0; - if (currentMenu == &MP_SplitServerDef) - ssplayers = 1; - else if (currentMenu == &MP_3PServerDef) - ssplayers = 2; - else if (currentMenu == &MP_4PServerDef) - ssplayers = 3; - (void)choice; - if (ssplayers < 2) + + if (currentMenu == &MP_SplitServerDef) + ssplayers = +#ifdef NOFOURPLAYER + 1; +#else + cv_dummysplitplayers.value-1; +#endif + else netgame = true; multiplayer = true; @@ -6625,6 +6675,7 @@ static void M_DrawServerMenu(void) { lumpnum_t lumpnum; patch_t *PictureOfLevel; + INT32 x, y; M_DrawGenericMenu(); @@ -6632,23 +6683,17 @@ static void M_DrawServerMenu(void) // Room name if (currentMenu == &MP_ServerDef) { +#define mp_server_room 1 if (ms_RoomId < 0) V_DrawRightAlignedString(BASEVIDWIDTH - currentMenu->x, currentMenu->y + MP_ServerMenu[mp_server_room].alphaKey, V_YELLOWMAP, (itemOn == mp_server_room) ? "