Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
SRB2
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
STJr
SRB2
Commits
c183437d
Commit
c183437d
authored
1 year ago
by
Lugent
Browse files
Options
Downloads
Patches
Plain Diff
Show how many files the server has while checking
parent
c2b57e26
No related branches found
No related tags found
1 merge request
!2446
Display a progress bar while checking server's files
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/netcode/client_connection.c
+26
-1
26 additions, 1 deletion
src/netcode/client_connection.c
with
26 additions
and
1 deletion
src/netcode/client_connection.c
+
26
−
1
View file @
c183437d
...
@@ -96,7 +96,7 @@ static void CL_DrawConnectionStatus(void)
...
@@ -96,7 +96,7 @@ static void CL_DrawConnectionStatus(void)
// Draw background fade
// Draw background fade
V_DrawFadeScreen
(
0xFF00
,
16
);
// force default
V_DrawFadeScreen
(
0xFF00
,
16
);
// force default
if
(
cl_mode
!=
CL_DOWNLOADFILES
&&
cl_mode
!=
CL_DOWNLOADHTTPFILES
&&
cl_mode
!=
CL_LOADFILES
)
if
(
cl_mode
!=
CL_DOWNLOADFILES
&&
cl_mode
!=
CL_DOWNLOADHTTPFILES
&&
cl_mode
!=
CL_LOADFILES
&&
cl_mode
!=
CL_CHECKFILES
&&
cl_mode
!=
CL_ASKFULLFILELIST
)
{
{
INT32
animtime
=
((
ccstime
/
4
)
&
15
)
+
16
;
INT32
animtime
=
((
ccstime
/
4
)
&
15
)
+
16
;
UINT8
palstart
;
UINT8
palstart
;
...
@@ -179,6 +179,31 @@ static void CL_DrawConnectionStatus(void)
...
@@ -179,6 +179,31 @@ static void CL_DrawConnectionStatus(void)
V_DrawCenteredString
(
BASEVIDWIDTH
/
2
,
BASEVIDHEIGHT
-
16
,
V_20TRANS
|
V_MONOSPACE
,
V_DrawCenteredString
(
BASEVIDWIDTH
/
2
,
BASEVIDHEIGHT
-
16
,
V_20TRANS
|
V_MONOSPACE
,
va
(
" %2u/%2u files"
,
loadcompletednum
,
fileneedednum
));
va
(
" %2u/%2u files"
,
loadcompletednum
,
fileneedednum
));
}
}
else
if
((
cl_mode
==
CL_CHECKFILES
)
||
(
cl_mode
==
CL_ASKFULLFILELIST
))
{
INT32
totalfileslength
;
INT32
checkcompletednum
=
0
;
INT32
i
;
V_DrawCenteredString
(
BASEVIDWIDTH
/
2
,
BASEVIDHEIGHT
-
16
-
16
,
V_YELLOWMAP
,
"Press ESC to abort"
);
//ima just count files here
if
(
fileneeded
)
{
for
(
i
=
0
;
i
<
fileneedednum
;
i
++
)
if
(
fileneeded
[
i
].
status
!=
FS_NOTCHECKED
)
checkcompletednum
++
;
}
// Check progress
V_DrawCenteredString
(
BASEVIDWIDTH
/
2
,
BASEVIDHEIGHT
-
16
-
24
,
V_YELLOWMAP
,
"Checking server addon list..."
);
totalfileslength
=
(
INT32
)((
checkcompletednum
/
(
double
)(
fileneedednum
))
*
256
);
M_DrawTextBox
(
BASEVIDWIDTH
/
2
-
128
-
8
,
BASEVIDHEIGHT
-
16
-
8
,
32
,
1
);
V_DrawFill
(
BASEVIDWIDTH
/
2
-
128
,
BASEVIDHEIGHT
-
16
,
256
,
8
,
111
);
V_DrawFill
(
BASEVIDWIDTH
/
2
-
128
,
BASEVIDHEIGHT
-
16
,
totalfileslength
,
8
,
96
);
V_DrawCenteredString
(
BASEVIDWIDTH
/
2
,
BASEVIDHEIGHT
-
16
,
V_20TRANS
|
V_MONOSPACE
,
va
(
" %2u/%2u Files"
,
checkcompletednum
,
fileneedednum
));
}
else
if
(
filedownload
.
current
!=
-
1
)
else
if
(
filedownload
.
current
!=
-
1
)
{
{
char
tempname
[
28
];
char
tempname
[
28
];
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment