Add showdownloadprompt cvar, so addon download prompt can be disabled
This commit is contained in:
1 parent
0dbae34998
commit
90745d91aa
3 files changed
+53
-37
No files matched your search
+49
-37
@@ -2197,6 +2197,33 @@ void CL_TimeoutServerList(void)
|
||||
}
|
||||
#endif // ifndef NONET
|
||||
|
||||
static void CL_ConfirmConnect(void)
|
||||
{
|
||||
if (totalfilesrequestednum > 0)
|
||||
{
|
||||
#ifdef HAVE_CURL
|
||||
if (http_source[0] == '\0' || curl_failedwebdownload)
|
||||
#endif
|
||||
{
|
||||
if (CL_SendRequestFile())
|
||||
{
|
||||
cl_mode = CL_DOWNLOADFILES;
|
||||
}
|
||||
else
|
||||
{
|
||||
cl_mode = CL_LEGACYREQUESTFAILED;
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_CURL
|
||||
else
|
||||
cl_mode = CL_PREPAREHTTPFILES;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
cl_mode = CL_LOADFILES;
|
||||
|
||||
}
|
||||
|
||||
static void M_ConfirmConnect(event_t *ev)
|
||||
{
|
||||
#ifndef NONET
|
||||
@@ -2204,28 +2231,7 @@ static void M_ConfirmConnect(event_t *ev)
|
||||
{
|
||||
if (ev->data1 == ' ' || ev->data1 == 'y' || ev->data1 == KEY_ENTER || ev->data1 == gamecontrol[gc_accelerate][0] || ev->data1 == gamecontrol[gc_accelerate][1])
|
||||
{
|
||||
if (totalfilesrequestednum > 0)
|
||||
{
|
||||
#ifdef HAVE_CURL
|
||||
if (http_source[0] == '\0' || curl_failedwebdownload)
|
||||
#endif
|
||||
{
|
||||
if (CL_SendRequestFile())
|
||||
{
|
||||
cl_mode = CL_DOWNLOADFILES;
|
||||
}
|
||||
else
|
||||
{
|
||||
cl_mode = CL_LEGACYREQUESTFAILED;
|
||||
}
|
||||
}
|
||||
#ifdef HAVE_CURL
|
||||
else
|
||||
cl_mode = CL_PREPAREHTTPFILES;
|
||||
#endif
|
||||
}
|
||||
else
|
||||
cl_mode = CL_LOADFILES;
|
||||
CL_ConfirmConnect();
|
||||
|
||||
M_ClearMenus(true);
|
||||
}
|
||||
@@ -2355,24 +2361,30 @@ static boolean CL_FinishedFileList(void)
|
||||
downloadsize = Z_StrDup(va("%uK",totalfilesrequestedsize>>10));
|
||||
#endif
|
||||
|
||||
if (serverisfull)
|
||||
M_StartMessage(va(M_GetText(
|
||||
"This server is full!\n"
|
||||
"Download of %s additional content is required to join.\n"
|
||||
"\n"
|
||||
"You may download, load server addons, and wait for a slot.\n"
|
||||
"\n"
|
||||
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
||||
), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER);
|
||||
if (cv_showdownloadprompt.value)
|
||||
{
|
||||
if (serverisfull)
|
||||
M_StartMessage(va(M_GetText(
|
||||
"This server is full!\n"
|
||||
"Download of %s additional content is required to join.\n"
|
||||
"\n"
|
||||
"You may download, load server addons, and wait for a slot.\n"
|
||||
"\n"
|
||||
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
||||
), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER);
|
||||
else
|
||||
M_StartMessage(va(M_GetText(
|
||||
"Download of %s additional content is required to join.\n"
|
||||
"\n"
|
||||
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
||||
), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER);
|
||||
|
||||
cl_mode = CL_CONFIRMCONNECT;
|
||||
}
|
||||
else
|
||||
M_StartMessage(va(M_GetText(
|
||||
"Download of %s additional content is required to join.\n"
|
||||
"\n"
|
||||
"Press ACCEL to continue or BRAKE to cancel.\n\n"
|
||||
), downloadsize), M_ConfirmConnect, MM_EVENTHANDLER);
|
||||
CL_ConfirmConnect();
|
||||
|
||||
Z_Free(downloadsize);
|
||||
cl_mode = CL_CONFIRMCONNECT;
|
||||
}
|
||||
#ifdef HAVE_CURL
|
||||
else
|
||||
|
||||
@@ -493,6 +493,8 @@ consvar_t cv_showlapemblem = {"showlapemblem", "On", CV_SAVE, CV_OnOff, NULL, 0,
|
||||
|
||||
consvar_t cv_showviewpointtext = {"showviewpointtext", "On", CV_SAVE, CV_OnOff, 0, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
consvar_t cv_showdownloadprompt = {"showdownloadprompt", "On", CV_SAVE, CV_OnOff, 0, 0, NULL, NULL, 0, 0, NULL};
|
||||
|
||||
// Intermission time Tails 04-19-2002
|
||||
static CV_PossibleValue_t inttime_cons_t[] = {{0, "MIN"}, {3600, "MAX"}, {0, NULL}};
|
||||
consvar_t cv_inttime = {"inttime", "20", CV_NETVAR, inttime_cons_t, NULL, 0, NULL, NULL, 0, 0, NULL};
|
||||
@@ -994,6 +996,7 @@ void D_RegisterClientCommands(void)
|
||||
|
||||
CV_RegisterVar(&cv_showtrackaddon);
|
||||
CV_RegisterVar(&cv_showviewpointtext);
|
||||
CV_RegisterVar(&cv_showdownloadprompt);
|
||||
|
||||
CV_RegisterVar(&cv_director);
|
||||
CV_RegisterVar(&cv_kartdebugdirector);
|
||||
|
||||
@@ -166,6 +166,7 @@ extern consvar_t cv_minihead;
|
||||
extern consvar_t cv_showlapemblem;
|
||||
|
||||
extern consvar_t cv_showviewpointtext;
|
||||
extern consvar_t cv_showdownloadprompt;
|
||||
extern consvar_t cv_luaimmersion;
|
||||
extern consvar_t cv_fakelocalskin;
|
||||
extern consvar_t cv_showlocalskinmenus;
|
||||
|
||||
Reference in new issue
Block a user