Fix X/0 files display bug for legacy downloader

Also made "Waiting to Download" consistent with other states
This commit is contained in:
Ashnal 2020-07-01 21:40:21 -04:00
parent f2593219a6
commit 8eb9a6946f

View file

@ -1300,8 +1300,21 @@ static inline void CL_DrawConnectionStatus(void)
va(" %2u/%2u Files",downloadcompletednum,totalfilesrequestednum)); va(" %2u/%2u Files",downloadcompletednum,totalfilesrequestednum));
} }
else else
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-58-32, V_YELLOWMAP, {
INT32 i, animtime = ((ccstime / 4) & 15) + 16;
UINT8 palstart = (cl_mode == CL_SEARCHING) ? 128 : 160;
// 15 pal entries total.
//Draw bottom box
M_DrawTextBox(BASEVIDWIDTH/2-128-8, BASEVIDHEIGHT-24-8, 32, 1);
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-24, V_YELLOWMAP, "Press ESC to abort");
for (i = 0; i < 16; ++i)
V_DrawFill((BASEVIDWIDTH/2-128) + (i * 16), BASEVIDHEIGHT-24, 16, 8, palstart + ((animtime - i) & 15));
V_DrawCenteredString(BASEVIDWIDTH/2, BASEVIDHEIGHT-24-32, V_YELLOWMAP,
M_GetText("Waiting to download files...")); M_GetText("Waiting to download files..."));
}
} }
} }
#endif #endif
@ -1999,11 +2012,11 @@ static boolean CL_FinishedFileList(void)
return false; return false;
} }
downloadcompletednum = 0;
totalfilesrequestednum = 0;
if (CL_SendRequestFile()) if (CL_SendRequestFile())
{ {
cl_mode = CL_DOWNLOADFILES; cl_mode = CL_DOWNLOADFILES;
downloadcompletednum = 0;
totalfilesrequestednum = 0;
} }
} }
#ifdef HAVE_CURL #ifdef HAVE_CURL
@ -2147,10 +2160,10 @@ static boolean CL_ServerConnectionTicker(boolean viams, const char *tmpsave, tic
#ifdef HAVE_CURL #ifdef HAVE_CURL
case CL_PREPAREHTTPFILES: case CL_PREPAREHTTPFILES:
downloadcompletednum = 0;
totalfilesrequestednum = 0;
if (http_source[0]) if (http_source[0])
{ {
downloadcompletednum = 0;
totalfilesrequestednum = 0;
for (i = 0; i < fileneedednum; i++) for (i = 0; i < fileneedednum; i++)
if (fileneeded[i].status == FS_NOTFOUND || fileneeded[i].status == FS_MD5SUMBAD) if (fileneeded[i].status == FS_NOTFOUND || fileneeded[i].status == FS_MD5SUMBAD)
{ {