Saturnmenu #6

Merged
alufolie91 merged 7 commits from saturnmenu into Saturn 2023-07-23 21:46:28 +02:00
4 changed files with 106 additions and 73 deletions

No files matched your search

+12 -8
View File
@@ -2509,18 +2509,19 @@ static boolean CL_ServerConnectionTicker(const char *tmpsave, tic_t *oldtic, tic
}
break;
case CL_ASKJOIN:
if (firstconnectattempttime + NEWTICRATE*300 < I_GetTime() && !server)
if (cv_connectawaittime.value && firstconnectattempttime + NEWTICRATE*60*cv_connectawaittime.value < I_GetTime() && !server)
{
CONS_Printf(M_GetText("5 minute wait time exceeded.\n"));
CONS_Printf("%d minute wait time exceeded.\n", cv_connectawaittime.value);
CONS_Printf(M_GetText("Network game synchronization aborted.\n"));
D_QuitNetGame();
CL_Reset();
D_StartTitle();
M_StartMessage(M_GetText(
"5 minute wait time exceeded.\n"
M_StartMessage(va(
"%d minute wait time exceeded.\n"
"You may retry connection.\n"
"\n"
"Press ESC\n"
"Press ESC\n",
cv_connectawaittime.value
), NULL, MM_NOTHING);
return false;
}
@@ -3883,6 +3884,9 @@ consvar_t cv_noticedownload = {"noticedownload", "Off", CV_SAVE, CV_OnOff, NULL,
static CV_PossibleValue_t downloadspeed_cons_t[] = {{1, "MIN"}, {300, "MAX"}, {0, NULL}};
consvar_t cv_downloadspeed = {"downloadspeed", "MAX", CV_SAVE, downloadspeed_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static CV_PossibleValue_t connectawaittime_cons_t[] = {{1, "MIN"}, {60, "MAX"}, {0, "Inf"}, {0, NULL}};
consvar_t cv_connectawaittime = {"connectawaittime", "5", CV_SAVE, connectawaittime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
static void Got_AddPlayer(UINT8 **p, INT32 playernum);
static void Got_RemovePlayer(UINT8 **p, INT32 playernum);
@@ -5979,9 +5983,9 @@ boolean TryRunTics(tic_t realtics)
while (neededtic > gametic)
{
boolean update_stats = !(paused || P_AutoPause());
DEBFILE(va("============ Running tic %d (local %d)\n", gametic, localgametic));
if (update_stats)
PS_START_TIMING(ps_tictime);
@@ -5989,7 +5993,7 @@ boolean TryRunTics(tic_t realtics)
ExtraDataTicker();
gametic++;
consistancy[gametic%TICQUEUE] = Consistancy();
if (update_stats)
{
PS_STOP_TIMING(ps_tictime);
+2
View File
@@ -567,6 +567,8 @@ extern consvar_t
#endif
cv_netticbuffer, cv_allownewplayer, cv_maxplayers, cv_resynchattempts, cv_blamecfail, cv_maxsend, cv_noticedownload, cv_downloadspeed;
extern consvar_t cv_connectawaittime;
extern consvar_t cv_discordinvites;
// Used in d_net, the only dependence
+1
View File
@@ -739,6 +739,7 @@ void D_RegisterServerCommands(void)
CV_RegisterVar(&cv_maxsend);
CV_RegisterVar(&cv_noticedownload);
CV_RegisterVar(&cv_downloadspeed);
CV_RegisterVar(&cv_connectawaittime);
CV_RegisterVar(&cv_httpsource);
#ifndef NONET
CV_RegisterVar(&cv_allownewplayer);
+91 -65
View File
@@ -314,7 +314,6 @@ menu_t OP_VideoOptionsDef, OP_VideoModeDef;
#ifdef HWRENDER
menu_t OP_OpenGLOptionsDef, OP_OpenGLColorDef;
#endif
menu_t OP_PlayerDistortDef;
menu_t OP_SoundOptionsDef;
//static void M_RestartAudio(void);
@@ -325,7 +324,6 @@ menu_t OP_ProtocolDef;
menu_t OP_DiscordOptionsDef;
#endif
menu_t OP_HUDOptionsDef, OP_ChatOptionsDef;
menu_t OP_HudOffsetDef;
menu_t OP_GameOptionsDef, OP_ServerOptionsDef;
#ifndef NONET
menu_t OP_AdvServerOptionsDef;
@@ -341,6 +339,12 @@ static patch_t *addonsp[NUM_EXT+5];
static void M_DeleteProtocol(void);
// Saturn
menu_t OP_SaturnDef;
menu_t OP_HudOffsetDef;
menu_t OP_PlayerDistortDef;
//menu_t OP_SaturnCreditsDef;
// Bird
menu_t OP_BirdDef;
menu_t OP_TiltDef;
@@ -1103,19 +1107,21 @@ enum
// Prefix: OP_
static menuitem_t OP_MainMenu[] =
{
{IT_SUBMENU|IT_STRING, NULL, "Control Setup...", &OP_ControlsDef, 10},
{IT_SUBMENU|IT_STRING, NULL, "Control Setup...", &OP_ControlsDef, 0},
{IT_SUBMENU|IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 30},
{IT_SUBMENU|IT_STRING, NULL, "Sound Options...", &OP_SoundOptionsDef, 40},
{IT_SUBMENU|IT_STRING, NULL, "Video Options...", &OP_VideoOptionsDef, 20},
{IT_SUBMENU|IT_STRING, NULL, "Sound Options...", &OP_SoundOptionsDef, 30},
{IT_SUBMENU|IT_STRING, NULL, "HUD Options...", &OP_HUDOptionsDef, 60},
{IT_SUBMENU|IT_STRING, NULL, "Gameplay Options...", &OP_GameOptionsDef, 70},
{IT_SUBMENU|IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 80},
{IT_SUBMENU|IT_STRING, NULL, "HUD Options...", &OP_HUDOptionsDef, 50},
{IT_SUBMENU|IT_STRING, NULL, "Gameplay Options...", &OP_GameOptionsDef, 60},
{IT_SUBMENU|IT_STRING, NULL, "Server Options...", &OP_ServerOptionsDef, 70},
{IT_SUBMENU|IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 100},
{IT_SUBMENU|IT_STRING, NULL, "Data Options...", &OP_DataOptionsDef, 90},
{IT_CALL|IT_STRING, NULL, "Tricks & Secrets (F1)", M_Manual, 120},
{IT_CALL|IT_STRING, NULL, "Play Credits", M_Credits, 130},
{IT_CALL|IT_STRING, NULL, "Tricks & Secrets (F1)", M_Manual, 110},
{IT_CALL|IT_STRING, NULL, "Play Credits", M_Credits, 120},
{IT_SUBMENU|IT_STRING, NULL, "Saturn Options...", &OP_SaturnDef, 140},
{IT_SUBMENU|IT_STRING, NULL, "Bird", &OP_BirdDef, 150},
};
@@ -1296,10 +1302,9 @@ static menuitem_t OP_VideoOptionsMenu[] =
{IT_STRING | IT_CVAR, NULL, "Vertical Sync", &cv_vidwait, 100},
{IT_STRING | IT_CVAR, NULL, "FPS Cap", &cv_fpscap, 110},
{IT_STRING | IT_CVAR, NULL, "Drift spark pulse size",&cv_driftsparkpulse, 125},
{IT_SUBMENU|IT_STRING, NULL, "Player distortion...", &OP_PlayerDistortDef, 135},
#ifdef HWRENDER
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 145},
{IT_SUBMENU|IT_STRING, NULL, "OpenGL Options...", &OP_OpenGLOptionsDef, 135},
#endif
};
@@ -1341,7 +1346,7 @@ static menuitem_t OP_OpenGLOptionsMenu[] =
{IT_STRING|IT_CVAR, NULL, "Texture Quality", &cv_scr_depth, 60},
{IT_STRING|IT_CVAR, NULL, "Texture Filter", &cv_grfiltermode, 70},
{IT_STRING|IT_CVAR, NULL, "Anisotropic", &cv_granisotropicmode, 80},
{IT_STRING|IT_CVAR, NULL, "Visual Portals", &cv_grportals, 90},
{IT_STRING|IT_CVAR, NULL, "Wall Contrast Style", &cv_grfakecontrast, 110},
@@ -1360,41 +1365,6 @@ static menuitem_t OP_OpenGLColorMenu[] =
};
#endif
static menuitem_t OP_PlayerDistortMenu[] =
{
{IT_HEADER, NULL, "Player Distortion", NULL, 0},
{IT_STRING | IT_CVAR, NULL, "Rotate players on slopes", &cv_sloperoll, 10},
{IT_STRING | IT_CVAR, NULL, "Slope rotation distance", &cv_sloperolldist, 20},
{IT_STRING | IT_CVAR, NULL, "Rotate players when sliptiding", &cv_sliptideroll, 30},
{IT_STRING | IT_CVAR, NULL, "Player stretch factor", &cv_gravstretch, 50},
};
enum
{
sloperotate,
slrotatedist,
stretchyplayer,
};
static menuitem_t OP_HudOffsetMenu[] =
{
{IT_HEADER, NULL, "Kart Hud Offsets", NULL, 0},
{IT_STRING | IT_CVAR, NULL, "Itembox Horizontal Offset", &cv_item_xoffset, 10},
{IT_STRING | IT_CVAR, NULL, "Itembox Vertical Offset", &cv_item_yoffset, 20},
{IT_STRING | IT_CVAR, NULL, "Timer Horizontal Offset", &cv_time_xoffset, 35},
{IT_STRING | IT_CVAR, NULL, "Timer Vertical Offset", &cv_time_yoffset, 45},
{IT_STRING | IT_CVAR, NULL, "Lapcount Horizontal Offset", &cv_laps_xoffset, 60},
{IT_STRING | IT_CVAR, NULL, "Lapcount Vertical Offset", &cv_laps_yoffset, 70},
{IT_STRING | IT_CVAR, NULL, "Speedometer Horizontal Offset", &cv_spdm_xoffset, 85},
{IT_STRING | IT_CVAR, NULL, "Speedometer Vertical Offset", &cv_spdm_yoffset, 95},
{IT_STRING | IT_CVAR, NULL, "Miniranking Horizontal Offset", &cv_face_xoffset, 110},
{IT_STRING | IT_CVAR, NULL, "Miniranking Vertical Offset", &cv_face_yoffset, 120},
{IT_STRING | IT_CVAR, NULL, "Minimap Horizontal Offset", &cv_mini_xoffset, 135},
{IT_STRING | IT_CVAR, NULL, "Minimap Vertical Offset", &cv_mini_yoffset, 145},
};
static menuitem_t OP_SoundOptionsMenu[] =
{
{IT_STRING|IT_CVAR, NULL, "SFX", &cv_gamesounds, 10},
@@ -1527,29 +1497,28 @@ static menuitem_t OP_HUDOptionsMenu[] =
{
{IT_STRING | IT_CVAR, NULL, "Show HUD (F3)", &cv_showhud, 10},
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
NULL, "HUD Visibility", &cv_translucenthud, 20},
{IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 30},
NULL, "HUD Visibility", &cv_translucenthud, 20},
{IT_STRING | IT_SUBMENU, NULL, "Online HUD options...",&OP_ChatOptionsDef, 45},
{IT_STRING | IT_CVAR, NULL, "Background Glass", &cons_backcolor, 55},
{IT_STRING | IT_SUBMENU, NULL, "Online HUD options...",&OP_ChatOptionsDef, 35},
{IT_STRING | IT_CVAR, NULL, "Background Glass", &cons_backcolor, 45},
{IT_STRING | IT_CVAR | IT_CV_SLIDER,
NULL, "Minimap Visibility", &cv_kartminimap, 65},
{IT_STRING | IT_CVAR, NULL, "Speedometer Display", &cv_kartspeedometer, 75},
{IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 85},
NULL, "Minimap Visibility", &cv_kartminimap, 60},
{IT_STRING | IT_CVAR, NULL, "Speedometer Display", &cv_kartspeedometer, 70},
{IT_STRING | IT_CVAR, NULL, "Show \"CHECK\"", &cv_kartcheck, 80},
{IT_STRING | IT_CVAR, NULL, "Menu Highlights", &cons_menuhighlight, 100},
{IT_STRING | IT_CVAR, NULL, "Menu Highlights", &cons_menuhighlight, 95},
// highlight info - (GOOD HIGHLIGHT, WARNING HIGHLIGHT) - 105 (see M_DrawHUDOptions)
{IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 125},
{IT_STRING | IT_CVAR, NULL, "Console Text Size", &cv_constextsize, 120},
{IT_STRING | IT_CVAR, NULL, "Show Track Addon Name", &cv_showtrackaddon, 140},
{IT_STRING | IT_CVAR, NULL, "Show \"FOCUS LOST\"", &cv_showfocuslost, 150},
{IT_STRING | IT_CVAR, NULL, "Show Track Addon Name", &cv_showtrackaddon, 135},
{IT_STRING | IT_CVAR, NULL, "Show \"FOCUS LOST\"", &cv_showfocuslost, 145},
{IT_STRING | IT_CVAR, NULL, "2D character select", &cv_skinselectmenu, 160},
{IT_STRING | IT_CVAR, NULL, "2D character select", &cv_skinselectmenu, 155},
};
// Ok it's still called chatoptions but we'll put ping display in here to be clean
static menuitem_t OP_ChatOptionsMenu[] =
{
@@ -1697,6 +1666,60 @@ static menuitem_t OP_MonitorToggleMenu[] =
#endif
};
static menuitem_t OP_SaturnMenu[] =
{
{IT_HEADER, NULL, "Saturn Options", NULL, 0},
{IT_STRING | IT_CVAR, NULL, "Serverqueue waittime", &cv_connectawaittime, 40},
{IT_STRING | IT_CVAR, NULL, "Addon Download Speed", &cv_downloadspeed, 55},
{IT_SUBMENU|IT_STRING, NULL, "Player distortion...", &OP_PlayerDistortDef, 90},
{IT_SUBMENU|IT_STRING, NULL, "Hud Offsets...", &OP_HudOffsetDef, 105},
//{IT_SUBMENU|IT_STRING, NULL, "Saturn Credits", &OP_SaturnCreditsDef, 130},
};
static menuitem_t OP_PlayerDistortMenu[] =
{
{IT_HEADER, NULL, "Player Distortion", NULL, 0},
{IT_STRING | IT_CVAR, NULL, "Rotate players on slopes", &cv_sloperoll, 10},
{IT_STRING | IT_CVAR, NULL, "Slope rotation distance", &cv_sloperolldist, 20},
{IT_STRING | IT_CVAR, NULL, "Rotate players when sliptiding", &cv_sliptideroll, 30},
{IT_STRING | IT_CVAR, NULL, "Player stretch factor", &cv_gravstretch, 50},
};
enum
{
sloperotate,
slrotatedist,
stretchyplayer,
};
static menuitem_t OP_HudOffsetMenu[] =
{
{IT_HEADER, NULL, "Kart Hud Offsets", NULL, 0},
{IT_STRING | IT_CVAR, NULL, "Itembox Horizontal Offset", &cv_item_xoffset, 10},
{IT_STRING | IT_CVAR, NULL, "Itembox Vertical Offset", &cv_item_yoffset, 20},
{IT_STRING | IT_CVAR, NULL, "Timer Horizontal Offset", &cv_time_xoffset, 35},
{IT_STRING | IT_CVAR, NULL, "Timer Vertical Offset", &cv_time_yoffset, 45},
{IT_STRING | IT_CVAR, NULL, "Lapcount Horizontal Offset", &cv_laps_xoffset, 60},
{IT_STRING | IT_CVAR, NULL, "Lapcount Vertical Offset", &cv_laps_yoffset, 70},
{IT_STRING | IT_CVAR, NULL, "Speedometer Horizontal Offset", &cv_spdm_xoffset, 85},
{IT_STRING | IT_CVAR, NULL, "Speedometer Vertical Offset", &cv_spdm_yoffset, 95},
{IT_STRING | IT_CVAR, NULL, "Miniranking Horizontal Offset", &cv_face_xoffset, 110},
{IT_STRING | IT_CVAR, NULL, "Miniranking Vertical Offset", &cv_face_yoffset, 120},
{IT_STRING | IT_CVAR, NULL, "Minimap Horizontal Offset", &cv_mini_xoffset, 135},
{IT_STRING | IT_CVAR, NULL, "Minimap Vertical Offset", &cv_mini_yoffset, 145},
};
/*static menuitem_t OP_SaturnCreditsMenu[] =
{
{IT_HEADER, NULL, "Saturn Credits", NULL, 0},
// idk need to add credits uwu
};*/
static menuitem_t OP_BirdMenu[] =
{
{IT_HEADER, NULL, "Crazy", NULL, 0},
@@ -2257,7 +2280,7 @@ menu_t OP_OpenGLColorDef =
NULL
};
#endif
menu_t OP_PlayerDistortDef = DEFAULTMENUSTYLE("M_VIDEO", OP_PlayerDistortMenu, &OP_VideoOptionsDef, 30, 60);
menu_t OP_DataOptionsDef = DEFAULTMENUSTYLE("M_DATA", OP_DataOptionsMenu, &OP_MainDef, 60, 30);
menu_t OP_ScreenshotOptionsDef = DEFAULTMENUSTYLE("M_SCSHOT", OP_ScreenshotOptionsMenu, &OP_DataOptionsDef, 30, 30);
menu_t OP_AddonsOptionsDef = DEFAULTMENUSTYLE("M_ADDONS", OP_AddonsOptionsMenu, &OP_DataOptionsDef, 30, 30);
@@ -2267,7 +2290,10 @@ menu_t OP_DiscordOptionsDef = DEFAULTMENUSTYLE(NULL, OP_DiscordOptionsMenu, &OP_
#endif
menu_t OP_EraseDataDef = DEFAULTMENUSTYLE("M_DATA", OP_EraseDataMenu, &OP_DataOptionsDef, 30, 30);
menu_t OP_HudOffsetDef = DEFAULTMENUSTYLE(NULL, OP_HudOffsetMenu, &OP_HUDOptionsDef, 30, 30);
menu_t OP_SaturnDef = DEFAULTMENUSTYLE(NULL, OP_SaturnMenu, &OP_MainDef, 30, 30);
menu_t OP_PlayerDistortDef = DEFAULTMENUSTYLE("M_VIDEO", OP_PlayerDistortMenu, &OP_SaturnDef, 30, 60);
menu_t OP_HudOffsetDef = DEFAULTMENUSTYLE(NULL, OP_HudOffsetMenu, &OP_SaturnDef, 30, 30);
//menu_t OP_SaturnCreditsDef = DEFAULTMENUSTYLE(NULL, OP_SaturnCreditsMenu, &OP_SaturnDef, 30, 30);
menu_t OP_BirdDef = DEFAULTMENUSTYLE(NULL, OP_BirdMenu, &OP_MainDef, 30, 30);
menu_t OP_TiltDef = DEFAULTMENUSTYLE(NULL, OP_TiltMenu, &OP_BirdDef, 30, 60);
@@ -2726,7 +2752,7 @@ boolean M_Responder(event_t *ev)
|| gamestate == GS_INTRO || gamestate == GS_CUTSCENE || gamestate == GS_GAMEEND
|| gamestate == GS_CREDITS || gamestate == GS_EVALUATION)
return false;
if (CON_Ready() && gamestate != GS_WAITINGPLAYERS)
return false;