Skip to content

Commit

Permalink
adjust autoid conditions a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
timbergeron committed Nov 18, 2024
1 parent 2db1826 commit 9d3f89b
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Quake/gl_screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -2460,8 +2460,11 @@ void SCR_DrawNet (void)
{
if (!scr_shownet.value)
return;

if (cls.signon < SIGNONS)
return;

if (realtime - cl.last_received_message < 0.3)
if (realtime - cl.last_received_message < scr_shownet.value)
return;
if (cls.demoplayback)
return;
Expand Down Expand Up @@ -3136,6 +3139,9 @@ void SCR_SetupAutoID(void)
char buf2[15];
const char* playmode;

char buf3[15];
const char* mode;

//if (r_refdef.viewangles[ROLL] == 80) // dead, could rotate text?

if (!scr_autoid.value || cls.state != ca_connected || cl.intermission || qeintermission || crxintermission)
Expand All @@ -3145,6 +3151,7 @@ void SCR_SetupAutoID(void)
{
obs = Info_GetKey(cl.scores[cl.realviewentity - 1].userinfo, "observer", buf, sizeof(buf));
playmode = Info_GetKey(cl.serverinfo, "playmode", buf2, sizeof(buf2));
mode = Info_GetKey(cl.serverinfo, "mode", buf3, sizeof(buf3));

if (cl.modtype == 1 || cl.modtype == 4) // mods with observer keys
{
Expand All @@ -3158,7 +3165,7 @@ void SCR_SetupAutoID(void)
((int)scr_autoid.value != 2)
) &&
(
(strcmp(playmode, "match") != 0) || // allow in pre-match if value 2
((strcmp(playmode, "match") != 0 || (strcmp(mode, "dm") != 0 && strcmp(mode, "ctf") != 0))) || // allow in pre-match if value 2
(cl.matchinp || (int)scr_autoid.value != 2)
)
) {
Expand Down Expand Up @@ -3225,6 +3232,10 @@ void SCR_DrawAutoID(void)

GL_SetCanvas(CANVAS_AUTOID);

const char* observing = "null";
char buf[10];
observing = Info_GetKey(cl.scores[cl.realviewentity - 1].userinfo, "observing", buf, sizeof(buf)); // userinfo

for (i = 0; i < autoid_count; i++)
{
// Adjust coordinates according to the scaling factor
Expand All @@ -3243,6 +3254,9 @@ void SCR_DrawAutoID(void)

name_length = strlen(formatted_name);

if (!strcmp(formatted_name, observing))
continue;

Draw_FillPlayer(x - 4 * name_length - 1, y - 1, (name_length * 8) + 2, 11, CL_PLColours_Parse("0x000000"), decimal_part);

Draw_String(x - 4 * name_length, y, formatted_name);
Expand Down

0 comments on commit 9d3f89b

Please sign in to comment.