sb_items[4] = Draw_CachePic ("gfx/sb_energy", true);
sb_items[5] = Draw_CachePic ("gfx/sb_str", true);
+ sb_items[11] = Draw_CachePic ("gfx/sb_flag_red_taken", true);
+ sb_items[12] = Draw_CachePic ("gfx/sb_flag_red_lost", true);
+ sb_items[13] = Draw_CachePic ("gfx/sb_flag_red_carrying", true);
+ sb_items[15] = Draw_CachePic ("gfx/sb_flag_blue_taken", true);
+ sb_items[16] = Draw_CachePic ("gfx/sb_flag_blue_lost", true);
+ sb_items[17] = Draw_CachePic ("gfx/sb_flag_blue_carrying", true);
+
sb_sbar = Draw_CachePic("gfx/sbar", true);
sb_sbar_minimal = Draw_CachePic("gfx/sbar_minimal", true);
sb_sbar_overlay = Draw_CachePic("gfx/sbar_overlay", true);
int i;
double time;
float fade;
+ int redflag, blueflag;
// we have a max time 2s (min time = 0)
if ((time = cl.time - cl.weapontime) < 2)
else
Sbar_DrawAlphaPic (0, 0, sb_sbar_minimal, sbar_alpha_fg.value);
- // special items
- if (cl.stats[STAT_ITEMS] & IT_INVULNERABILITY)
- {
- // Nexuiz has no anum pics
- //Sbar_DrawNum (36, 0, 666, 3, 1);
- // Nexuiz has no disc pic
- //Sbar_DrawPic (0, 0, sb_disc);
- }
+ // flag icons
+ redflag = ((cl.stats[STAT_ITEMS]>>15) & 3);
+ if (redflag)
+ Sbar_DrawPic (10, -85, sb_items[redflag+10]);
+ blueflag = ((cl.stats[STAT_ITEMS]>>17) & 3);
+ if (blueflag)
+ Sbar_DrawPic (10, -145, sb_items[blueflag+14]);
// armor
Sbar_DrawXNum ((340-3*24), 12, cl.stats[STAT_ARMOR], 3, 24, 0.6,0.7,0.8,1,0);
Sbar_DrawFace ();
// health
- Sbar_DrawNum (154, 0, cl.stats[STAT_HEALTH], 3, cl.stats[STAT_HEALTH] <= 25);
+ Sbar_DrawNum (136, 0, cl.stats[STAT_HEALTH], 3, cl.stats[STAT_HEALTH] <= 25);
// ammo icon
if (gamemode == GAME_ROGUE)
int minutes;
unsigned char *c;
minutes = (int)((cl.intermission ? cl.completed_time - s->qw_entertime : cl.time - s->qw_entertime) / 60.0);
- if (s->qw_spectator)
+ if (cls.protocol == PROTOCOL_QUAKEWORLD)
{
- if (s->qw_ping || s->qw_packetloss)
- DrawQ_ColoredString(x, y, va("%4i %3i %4i spect %-4s %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ if (s->qw_spectator)
+ {
+ if (s->qw_ping || s->qw_packetloss)
+ DrawQ_ColoredString(x, y, va("%4i %3i %4i spectator %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ else
+ DrawQ_ColoredString(x, y, va(" %4i spectator %c%s", minutes, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ }
else
- DrawQ_ColoredString(x, y, va(" %4i spect %-4s %c%s", minutes, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ {
+ // draw colors behind score
+ c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8];
+ DrawQ_Pic(x + 14*8, y+1, NULL, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
+ c = (unsigned char *)&palette_complete[((s->colors & 15)<<4) + 8];
+ DrawQ_Pic(x + 14*8, y+4, NULL, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
+ // print the text
+ //DrawQ_String(x, y, va("%c%4i %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
+ if (s->qw_ping || s->qw_packetloss)
+ DrawQ_ColoredString(x, y, va("%4i %3i %4i %5i %-4s %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes,(int) s->frags, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ else
+ DrawQ_ColoredString(x, y, va(" %4i %5i %-4s %c%s", minutes,(int) s->frags, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ }
}
else
{
- // draw colors behind score
- c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8];
- DrawQ_Pic(x + 14*8, y+1, NULL, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
- c = (unsigned char *)&palette_complete[((s->colors & 15)<<4) + 8];
- DrawQ_Pic(x + 14*8, y+4, NULL, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
- // print the text
- //DrawQ_String(x, y, va("%c%4i %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
- if (s->qw_ping || s->qw_packetloss)
- DrawQ_ColoredString(x, y, va("%4i %3i %4i %5i %-4s %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), minutes,(int) s->frags, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ if (s->qw_spectator)
+ {
+ if (s->qw_ping || s->qw_packetloss)
+ DrawQ_ColoredString(x, y, va("%4i %3i spect %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ else
+ DrawQ_ColoredString(x, y, va(" spect %c%s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ }
else
- DrawQ_ColoredString(x, y, va(" %4i %5i %-4s %c%s", minutes,(int) s->frags, cl.qw_teamplay ? s->qw_team : "", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ {
+ // draw colors behind score
+ c = (unsigned char *)&palette_complete[(s->colors & 0xf0) + 8];
+ DrawQ_Pic(x + 9*8, y+1, NULL, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
+ c = (unsigned char *)&palette_complete[((s->colors & 15)<<4) + 8];
+ DrawQ_Pic(x + 9*8, y+4, NULL, 40, 3, c[0] * (1.0f / 255.0f), c[1] * (1.0f / 255.0f), c[2] * (1.0f / 255.0f), c[3] * (1.0f / 255.0f) * sbar_alpha_fg.value, 0);
+ // print the text
+ //DrawQ_String(x, y, va("%c%4i %s", (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', (int) s->frags, s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0);
+ if (s->qw_ping || s->qw_packetloss)
+ DrawQ_ColoredString(x, y, va("%4i %3i %5i %c%s", bound(0, s->qw_ping, 9999), bound(0, s->qw_packetloss, 99), (int) s->frags, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ else
+ DrawQ_ColoredString(x, y, va(" %5i %c%s", (int) s->frags, (s - cl.scores) == cl.playerentity - 1 ? 13 : ' ', s->name), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ }
}
return 8;
}
else if (cls.protocol == PROTOCOL_QUAKE || cls.protocol == PROTOCOL_QUAKEDP || cls.protocol == PROTOCOL_NEHAHRAMOVIE || cls.protocol == PROTOCOL_DARKPLACES1 || cls.protocol == PROTOCOL_DARKPLACES2 || cls.protocol == PROTOCOL_DARKPLACES3 || cls.protocol == PROTOCOL_DARKPLACES4 || cls.protocol == PROTOCOL_DARKPLACES5 || cls.protocol == PROTOCOL_DARKPLACES6 || cls.protocol == PROTOCOL_DARKPLACES7)
{
// these servers usually lack the pings command and so a less efficient "ping" command must be sent, which on modern DP servers will also reply with a pingplreport command after the ping listing
- cl.parsingtextexpectingpingforscores = true; // hide the output of the next ping report
- MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
- MSG_WriteString(&cls.netcon->message, "ping");
+ static int ping_anyway_counter = 0;
+ if(cl.parsingtextexpectingpingforscores == 1)
+ {
+ Con_DPrintf("want to send ping, but still waiting for other reply\n");
+ if(++ping_anyway_counter >= 5)
+ cl.parsingtextexpectingpingforscores = 0;
+ }
+ if(cl.parsingtextexpectingpingforscores != 1)
+ {
+ ping_anyway_counter = 0;
+ cl.parsingtextexpectingpingforscores = 1; // hide the output of the next ping report
+ MSG_WriteByte(&cls.netcon->message, clc_stringcmd);
+ MSG_WriteString(&cls.netcon->message, "ping");
+ }
}
else
{
// scores
Sbar_SortFrags ();
// draw the text
- x = (vid_conwidth.integer - (6 + 18 + 15) * 8) / 2;
y = 40;
- DrawQ_ColoredString(x, y, va("ping pl%% time frags team name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ if (cls.protocol == PROTOCOL_QUAKEWORLD)
+ {
+ x = (vid_conwidth.integer - (26 + 15) * 8) / 2; // 26 characters until name, then we assume 15 character names (they can be longer but usually aren't)
+ DrawQ_ColoredString(x, y, va("ping pl%% time frags team name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ }
+ else
+ {
+ x = (vid_conwidth.integer - (16 + 15) * 8) / 2; // 16 characters until name, then we assume 15 character names (they can be longer but usually aren't)
+ DrawQ_ColoredString(x, y, va("ping pl%% frags name"), 0, 8, 8, 1, 1, 1, 1 * sbar_alpha_fg.value, 0, NULL );
+ }
y += 8;
if (Sbar_IsTeammatch ())