Scoreboard display will now handle big games better, instead of truncating the list.

git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@6007 fc73d0e0-1445-4013-8a0c-d673dee63da5
This commit is contained in:
Spoike 2021-08-04 21:18:20 +00:00
parent 662f7cfd75
commit cd45de7a1e
7 changed files with 171 additions and 148 deletions

View File

@ -1800,7 +1800,7 @@ void CL_UpdateSeats(void)
//some userinfos should always have a value
if (!*InfoBuf_ValueForKey(info, "name")) //$name-2
InfoBuf_SetKey(info, "name", va("%s-%i\n", InfoBuf_ValueForKey(&cls.userinfo[0], "name"), cl.splitclients+1));
InfoBuf_SetKey(info, "name", va("%s-%i", InfoBuf_ValueForKey(&cls.userinfo[0], "name"), cl.splitclients+1));
if (cls.protocol != CP_QUAKE2)
{
if (!*InfoBuf_ValueForKey(info, "team")) //put players on the same team by default. this avoids team damage in coop, and if you're playing on the same computer then you probably want to be on the same team anyway.

View File

@ -3381,7 +3381,9 @@ static void CLQW_ParseServerData (void)
/*parsing here is slightly different to allow us 255 max players instead of 127*/
cl.splitclients = (qbyte)MSG_ReadByte();
if (cl.splitclients & 128)
if (cls.fteprotocolextensions2 & PEXT2_VRINPUTS)
;
else if (cl.splitclients & 128)
{
// spec = true;
cl.splitclients &= ~128;

View File

@ -947,14 +947,14 @@ void Key_DefaultLinkClicked(console_t *con, char *text, char *info)
else
{
char cmdprefix[6];
if (i == 0)
// if (i == 0)
*cmdprefix = 0;
else
snprintf(cmdprefix, sizeof(cmdprefix), "%i ", i+1);
// else
// snprintf(cmdprefix, sizeof(cmdprefix), "%i ", i+1);
//hey look! its you!
if (cl.playerview[i].spectator || cls.demoplayback)
if (i || cl.playerview[i].spectator || cls.demoplayback)
{
//need join option here or something
}

View File

@ -270,11 +270,6 @@ void Draw_FunStringWidthFont(struct font_s *font, float x, float y, const void *
}
#ifdef QUAKEHUD
static qboolean largegame = false;
#ifdef Q2CLIENT
@ -3311,7 +3306,7 @@ ping time frags name
},{ \
if (!s->spectator) \
{ \
if (largegame) \
if (skip==8) \
Sbar_FillPC(x, y+1, 40, 3, top); \
else \
Sbar_FillPC(x, y, 40, 4, top); \
@ -3365,12 +3360,12 @@ void Sbar_DeathmatchOverlay (playerview_t *pv, int start)
int namesize = (cl.teamplay ? 12*8 : 16*8);
float backalpha;
int pages;
int linesperpage, firstline, lastline;
if (!pv)
return;
if (largegame)
skip = 8;
// request new ping times every two second
if (realtime - cl.last_ping_request > 2 && cls.demoplayback != DPB_EZTV)
{
@ -3431,7 +3426,16 @@ void Sbar_DeathmatchOverlay (playerview_t *pv, int start)
y += 8;
}
y += gr.y;
start = y;
y+=8;
linesperpage = floor(((gr.height-10.)-y)/skip);
while (scoreboardlines > linesperpage && skip > 8)
{ //won't fit, shrink the gaps.
skip--;
linesperpage = floor(((vid.height-10.)-y)/skip);
}
linesperpage = max(linesperpage,1);
pages = max(1, (scoreboardlines+linesperpage-1)/linesperpage);
showcolumns = 0;
@ -3476,7 +3480,7 @@ void Sbar_DeathmatchOverlay (playerview_t *pv, int start)
#undef COLUMN
rank_width -= namesize;
if (rank_width < 320)
if (rank_width < 320 && pages <= 1)
{
namesize += 320-rank_width;
if (namesize > 32*8)
@ -3484,8 +3488,19 @@ void Sbar_DeathmatchOverlay (playerview_t *pv, int start)
}
rank_width += namesize;
startx = (gr.width-rank_width)/2;
startx = (gr.width-rank_width*pages)/2;
if (startx < 0)
{
startx = fmod(realtime*128, rank_width*pages) - (gr.width/2);
startx = -bound(0, startx, (rank_width*pages-gr.width));
}
startx += gr.x;
for (firstline = 0; firstline < scoreboardlines; firstline += linesperpage, startx += rank_width)
{
if (startx+rank_width < gr.x || startx > gr.x+gr.width)
continue;
lastline = min(firstline + linesperpage, scoreboardlines);
y = start + gr.y;
if (scr_scoreboard_newstyle.ival)
{
@ -3541,7 +3556,7 @@ if (showcolumns & (1<<COLUMN##title)) \
y -= skip;
//drawfills (these are split out to aid batching)
for (i = 0; i < scoreboardlines; i++)
for (i = firstline; i < lastline; i++)
{
char team[5];
unsigned int top, bottom;
@ -3616,10 +3631,10 @@ if (showcolumns & (1<<COLUMN##title)) \
R2D_FillBlock (startx - 3, y + skip, rank_width - 1, 1); // Electro - Border - Bottom
}
R2D_ImageColours(1.0, 1.0, 1.0, 1.0);
y -= i * skip;
y -= (i-firstline) * skip;
//text parts
for (i = 0; i < scoreboardlines; i++)
for (i = firstline; i < lastline; i++)
{
// TODO: Sort players so that the leading teams are drawn first
k = fragsort[i];
@ -3643,9 +3658,7 @@ if (showcolumns & (1<<COLUMN##title)) \
ALLCOLUMNS
#undef COLUMN
}
if (y >= vid.height-10) // we ran over the screen size, squish
largegame = true;
}
}
/*

View File

@ -2458,6 +2458,7 @@ void V_RenderView (qboolean no2d)
{
int seatnum;
int maxseats = cl.splitclients;
int pl;
Surf_LessenStains();
@ -2466,13 +2467,16 @@ void V_RenderView (qboolean no2d)
if (cl.intermissionmode != IM_NONE)
maxseats = 1;
else if (cl_forceseat.ival && cl_splitscreen.ival >= 4)
maxseats = 1;
R_PushDlights ();
r_secondaryview = 0;
for (seatnum = 0; seatnum < cl.splitclients && seatnum < maxseats; seatnum++)
{
V_ClearRefdef(&cl.playerview[seatnum]);
pl = (maxseats==1&&cl_forceseat.ival>=1)?(cl_forceseat.ival-1)%cl.splitclients:seatnum;
V_ClearRefdef(&cl.playerview[pl]);
if (no2d)
r_refdef.drawcrosshair = r_refdef.drawsbar = 0;
if (seatnum)

View File

@ -10324,10 +10324,10 @@ void SV_SetSSQCInputs(usercmd_t *ucmd)
if (pr_global_ptrs->input_angles)
{
if (sv_player->v->fixangle)
{
(pr_global_struct->input_angles)[0] = sv_player->v->v_angle[0];
(pr_global_struct->input_angles)[1] = sv_player->v->v_angle[1];
(pr_global_struct->input_angles)[2] = sv_player->v->v_angle[2];
{ //hate this, but somehow still pending
(pr_global_struct->input_angles)[0] = sv_player->v->angles[0];
(pr_global_struct->input_angles)[1] = sv_player->v->angles[1];
(pr_global_struct->input_angles)[2] = sv_player->v->angles[2];
}
else
{
@ -10441,12 +10441,6 @@ qboolean SV_RunFullQCMovement(client_t *client, usercmd_t *ucmd)
}
#endif
if (!sv_player->v->fixangle)
{
sv_player->v->v_angle[0] = SHORT2ANGLE(ucmd->angles[0]);
sv_player->v->v_angle[1] = SHORT2ANGLE(ucmd->angles[1]);
sv_player->v->v_angle[2] = SHORT2ANGLE(ucmd->angles[2]);
}
VectorCopy(sv_player->v->v_angle, startangle);
#ifdef HEXEN2

View File

@ -363,6 +363,9 @@ void SV_New_f (void)
splitnum = 0;
for (split = host_client, splitnum = 0; split; split = split->controlled)
splitnum++;
if (fteext2 & PEXT2_VRINPUTS)
ClientReliableWrite_Byte (host_client, splitnum);
else
ClientReliableWrite_Byte (host_client, (host_client->spectator?128:0) | splitnum); //read each player's userinfo to see if its a spectator or not. this hint is merely a cheat.
for (split = host_client; split; split = split->controlled)
{
@ -9458,6 +9461,13 @@ void SV_ClientThink (void)
sv_player->xv->movement[0] = cmd.forwardmove;
sv_player->xv->movement[1] = cmd.sidemove;
sv_player->xv->movement[2] = cmd.upmove;
if (!sv_player->v->fixangle)
{
sv_player->v->v_angle[0] = SHORT2ANGLE(cmd.angles[0]);
sv_player->v->v_angle[1] = SHORT2ANGLE(cmd.angles[1]);
sv_player->v->v_angle[2] = SHORT2ANGLE(cmd.angles[2]);
}
}
SV_SetSSQCInputs(&cmd);