6 float sb_lines; // still don't know what to do with that NOTE: check dp's sbar.c to see what that should be
10 float sbar_hudselector;
12 float ps_primary, ps_secondary;
13 float ts_primary, ts_secondary;
18 void Sbar_FinaleOverlay()
21 pos_x = (vid_conwidth - 1)/2;
25 //drawpic(pos, "gfx/finale", '0 0 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
27 //drawstring(pos, "END", sbar_fontsize, '1 1 1', 1, DRAWFLAG_NORMAL);
31 void Sbar_DrawWeapon(float nr, float fade, float active)
33 vector pos, vsize, color;
36 value = (active) ? 1 : 0.6;
37 color_x = color_y = color_z = value;
39 if(sbar_hudselector == 1)
41 // width = 300, height = 100
42 const float w_width = 32, w_height = 12, w_space = 2, font_size = 8;
44 pos_x = (vid_conwidth - w_width * 9) * 0.5 + w_width * nr;
45 pos_y = (vid_conheight - w_height);
50 drawpic(pos, strcat("gfx/inv_weapon", ftos(nr)), vsize, color, value * fade * sbar_alpha_fg, 0);
56 drawstring(pos, ftos(nr+1), vsize, '1 1 0', sbar_alpha_fg, 0);
61 // width = 300, height = 100
62 const float w2_width = 300, w2_height = 100, w2_space = 10;
63 const float w2_scale = 0.4;
65 pos_x = vid_conwidth - (w2_width + w2_space) * w2_scale;
66 pos_y = (w2_height + w2_space) * w2_scale * nr + w2_space;
68 vsize_x = w2_width * w2_scale;
69 vsize_y = w2_height * w2_scale;
72 drawpic(pos, strcat("gfx/inv_weapon", ftos(nr)), vsize, color, value * fade * sbar_alpha_fg, 0);
75 void Sbar_DrawXNum (vector pos, float num, float digits, float lettersize, vector rgb, float a, float dflags)
82 vsize_x = vsize_y = lettersize;
97 str = strcat(substring("0000000000", 0, digits - strlen(tmp)), tmp);
105 str = substring(str, l-digits, 999);
107 } else if(l < digits)
108 pos_x += (digits-l) * lettersize;
112 drawpic(sbar + pos, "gfx/num_minus", vsize, rgb, a * sbar_alpha_fg, dflags);
116 for(i = 0; i < l; ++i)
118 drawpic(sbar + pos, strcat("gfx/num_", substring(str, i, 1)), vsize, rgb, a * sbar_alpha_fg, dflags);
123 void Cmd_Sbar_SetFields(float argc);
124 void Sbar_InitScores()
128 ps_primary = ps_secondary = ts_primary = ts_secondary = -1;
129 for(i = 0; i < MAX_SCORE; ++i)
131 f = (scores_flags[i] & SFL_SORT_PRIO_MASK);
132 if(f == SFL_SORT_PRIO_PRIMARY)
134 if(f == SFL_SORT_PRIO_SECONDARY)
137 if(ps_secondary == -1)
138 ps_secondary = ps_primary;
140 for(i = 0; i < MAX_TEAMSCORE; ++i)
142 f = (teamscores_flags[i] & SFL_SORT_PRIO_MASK);
143 if(f == SFL_SORT_PRIO_PRIMARY)
145 if(f == SFL_SORT_PRIO_SECONDARY)
148 if(ts_secondary == -1)
149 ts_secondary = ts_primary;
151 Cmd_Sbar_SetFields(0);
154 void Sbar_UpdatePlayerPos(entity pl);
155 float SetTeam(entity pl, float Team);
157 void Sbar_UpdatePlayerTeams()
164 for(pl = players.sort_next; pl; pl = pl.sort_next)
167 Team = GetPlayerColor(pl.sv_entnum);
168 if(SetTeam(pl, Team))
171 Sbar_UpdatePlayerPos(pl);
175 pl = players.sort_next;
180 print(strcat("PNUM: ", ftos(num), "\n"));
185 float Sbar_ComparePlayerScores(entity left, entity right)
188 vl = GetPlayerColor(left.sv_entnum);
189 vr = GetPlayerColor(right.sv_entnum);
196 if(vl == COLOR_SPECTATOR)
198 // FIRST the one with scores (spectators), THEN the ones without (downloaders)
200 if(!left.gotscores && right.gotscores)
205 vl = left.scores[ps_primary];
206 vr = right.scores[ps_primary];
207 if(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)
209 if(vl == 0 && vr != 0)
211 if(vl != 0 && vr == 0)
215 return IS_INCREASING(scores_flags[ps_primary]);
217 return IS_DECREASING(scores_flags[ps_primary]);
219 vl = left.scores[ps_secondary];
220 vr = right.scores[ps_secondary];
221 if(scores_flags[ps_secondary] & SFL_ZERO_IS_WORST)
223 if(vl == 0 && vr != 0)
225 if(vl != 0 && vr == 0)
229 return IS_INCREASING(scores_flags[ps_secondary]);
231 return IS_DECREASING(scores_flags[ps_secondary]);
236 void Sbar_UpdatePlayerPos(entity player)
238 for(other = player.sort_next; other && Sbar_ComparePlayerScores(player, other); other = player.sort_next)
240 SORT_SWAP(player, other);
242 for(other = player.sort_prev; other != players && Sbar_ComparePlayerScores(other, player); other = player.sort_prev)
244 SORT_SWAP(other, player);
248 float Sbar_CompareTeamScores(entity left, entity right)
252 if(left.team == COLOR_SPECTATOR)
254 if(right.team == COLOR_SPECTATOR)
257 vl = left.teamscores[ts_primary];
258 vr = right.teamscores[ts_primary];
260 return IS_INCREASING(teamscores_flags[ts_primary]);
262 return IS_DECREASING(teamscores_flags[ts_primary]);
264 vl = left.teamscores[ts_secondary];
265 vr = right.teamscores[ts_secondary];
267 return IS_INCREASING(teamscores_flags[ts_secondary]);
269 return IS_DECREASING(teamscores_flags[ts_secondary]);
274 void Sbar_UpdateTeamPos(entity Team)
276 for(other = Team.sort_next; other && Sbar_CompareTeamScores(Team, other); other = Team.sort_next)
278 SORT_SWAP(Team, other);
280 for(other = Team.sort_prev; other != teams && Sbar_CompareTeamScores(other, Team); other = Team.sort_prev)
282 SORT_SWAP(other, Team);
286 void Cmd_Sbar_Help(float argc)
288 print("You can modify the scoreboard using the\n");
289 print("^3|---------------------------------------------------------------|\n");
290 print("^1 TO BE DONE\n");
292 print("^2sbar_columns_set default\n");
293 print("^2sbar_columns_set ^7filed1 field2 ...\n");
294 print("The following field names are recognized (case INsensitive):\n");
295 print("You can use a ^3|^7 to start the right-aligned fields.\n");
297 print("^3name^7 or ^3nick^7 Name of a player\n");
298 print("^3ping^7 Ping time\n\n");
299 print("^3kd^7 or ^3kdr^7 or ^3kdratio^7 or ^3k/d\n");
300 print(" The kill-death ratio\n");
302 print("Before a field you can put a + or - sign, then a comma separated list\n");
303 print("of game types, then a slash, to make the field show up only in these\n");
304 print("or in all but these game types.\n");
307 print("Additional columns:\n");
308 for(i = 0; i < MAX_SCORE; ++i)
310 if(scores_label[i] != "")
311 print(strcat(scores_label[i], "\n"));
315 #define MIN_NAMELEN 24
316 #define MAX_NAMELEN 24
318 string Sbar_DefaultColumnLayout()
320 return "ping pl name | -ctf,kh/kills -ctf,kh/deaths +lms/lives +lms/rank +kh,ctf/caps +kh/pushes +kh/destroyed -lms/score";
323 void Cmd_Sbar_SetFields(float argc)
326 string str, pattern, subpattern;
328 float have_name, have_primary, have_secondary, have_separator;
331 // TODO: re enable with gametype dependant cvars?
332 if(argc < 2) // no arguments provided
333 argc = tokenizebyseparator(strcat("x ", cvar_string("sbar_columns")), " ");
336 argc = tokenizebyseparator(strcat("x ", Sbar_DefaultColumnLayout()), " ");
340 if(argv(1) == "default")
341 argc = tokenizebyseparator(strcat("x ", Sbar_DefaultColumnLayout()), " ");
342 else if(argv(1) == "all")
346 for(i = 0; i < MAX_SCORE; ++i)
349 if(i != ps_secondary)
350 if(scores_label[i] != "")
351 s = strcat(s, " ", scores_label[i]);
353 if(ps_secondary != ps_primary)
354 s = strcat(s, " ", scores_label[ps_secondary]);
355 s = strcat(s, " ", scores_label[ps_primary]);
356 argc = tokenizebyseparator(strcat("x ", s), " ");
361 argc = min(MAX_SBAR_FIELDS, argc);
364 drawfont = sbar_font;
365 digit = stringwidth("0123456789", FALSE) / 10;
367 subpattern = strcat(",", GametypeNameFromType(gametype), ",");
369 argc = min(argc-1, MAX_SBAR_FIELDS-1);
370 for(i = 0; i < argc; ++i)
374 slash = strstrofs(str, "/", 0);
377 pattern = substring(str, 0, slash);
378 str = substring(str, slash + 1, strlen(str) - (slash + 1));
380 if(substring(pattern, 0, 1) == "-")
382 pattern = substring(pattern, 1, strlen(pattern) - 1);
383 if(strstrofs(strcat(",", pattern, ","), subpattern, 0) >= 0)
388 if(substring(pattern, 0, 1) == "+")
389 pattern = substring(pattern, 1, strlen(pattern) - 1);
390 if(strstrofs(strcat(",", pattern, ","), subpattern, 0) < 0)
395 strunzone(sbar_title[sbar_num_fields]);
396 sbar_title[sbar_num_fields] = strzone(str);
397 sbar_size[sbar_num_fields] = stringwidth(str, FALSE);
398 str = strtolower(str);
401 sbar_field[sbar_num_fields] = SP_PING;
402 } else if(str == "pl") {
403 sbar_field[sbar_num_fields] = SP_PL;
404 } else if(str == "kd" || str == "kdr" || str == "kdratio" || str == "k/d") {
405 sbar_field[sbar_num_fields] = SP_KDRATIO;
406 } else if(str == "name" || str == "nick") {
407 sbar_field[sbar_num_fields] = SP_NAME;
408 sbar_size[sbar_num_fields] = MIN_NAMELEN; // minimum size? any use?
410 } else if(str == "|") {
411 sbar_field[sbar_num_fields] = SP_SEPARATOR;
414 for(j = 0; j < MAX_SCORE; ++j)
415 if(str == strtolower(scores_label[j]))
416 goto found; // sorry, but otherwise fteqcc -O3 miscompiles this and warns about "unreachable code"
418 print(strcat("^1Error:^7 Unknown score field: '", str, "'\n"));
421 sbar_field[sbar_num_fields] = j;
424 if(j == ps_secondary)
430 if(scores_flags[ps_primary] & SFL_ALLOW_HIDE)
432 if(scores_flags[ps_secondary] & SFL_ALLOW_HIDE)
434 if(ps_primary == ps_secondary)
436 missing = !have_primary + !have_secondary + !have_separator + !have_name;
438 if(sbar_num_fields+missing < MAX_SBAR_FIELDS)
442 strunzone(sbar_title[sbar_num_fields]);
443 for(i = sbar_num_fields; i > 0; --i)
445 sbar_title[i] = sbar_title[i-1];
446 sbar_size[i] = sbar_size[i-1];
447 sbar_field[i] = sbar_field[i-1];
449 sbar_title[0] = strzone("name");
450 sbar_field[0] = SP_NAME;
451 sbar_size[0] = MIN_NAMELEN; // minimum size? any use?
453 print("fixed missing field 'name'\n");
457 strunzone(sbar_title[sbar_num_fields]);
458 for(i = sbar_num_fields; i > 1; --i)
460 sbar_title[i] = sbar_title[i-1];
461 sbar_size[i] = sbar_size[i-1];
462 sbar_field[i] = sbar_field[i-1];
464 sbar_title[1] = strzone("|");
465 sbar_field[1] = SP_SEPARATOR;
466 sbar_size[1] = stringwidth("|", FALSE);
468 print("fixed missing field '|'\n");
471 else if(!have_separator)
473 strunzone(sbar_title[sbar_num_fields]);
474 sbar_title[sbar_num_fields] = strzone("|");
475 sbar_size[sbar_num_fields] = stringwidth("|", FALSE);
476 sbar_field[sbar_num_fields] = SP_SEPARATOR;
478 print("fixed missing field '|'\n");
483 strunzone(sbar_title[sbar_num_fields]);
484 sbar_title[sbar_num_fields] = strzone(scores_label[ps_secondary]);
485 sbar_size[sbar_num_fields] = stringwidth(sbar_title[sbar_num_fields], FALSE);
486 sbar_field[sbar_num_fields] = ps_secondary;
488 print("fixed missing field '", scores_label[ps_secondary], "'\n");
493 strunzone(sbar_title[sbar_num_fields]);
494 sbar_title[sbar_num_fields] = strzone(scores_label[ps_primary]);
495 sbar_size[sbar_num_fields] = stringwidth(sbar_title[sbar_num_fields], FALSE);
496 sbar_field[sbar_num_fields] = ps_primary;
498 print("fixed missing field '", scores_label[ps_primary], "'\n");
502 sbar_field[sbar_num_fields] = SP_END;
506 vector sbar_field_rgb;
507 string Sbar_GetField(entity pl, float field)
509 float tmp, num, denom, f;
511 sbar_field_rgb = '1 1 1';
516 return "\x8D\x8D\x8D"; // >>> sign
517 str = getplayerkey(pl.sv_entnum, "ping");
520 tmp = max(0, min(220, stof(str)-80)) / 220;
521 sbar_field_rgb = '1 1 1' - '0 1 1'*tmp;
527 str = getplayerkey(pl.sv_entnum, "pl");
530 tmp = bound(0, stof(str), 20) / 20; // 20% is REALLY BAD pl
531 sbar_field_rgb = '1 0.5 0.5' - '0 0.5 0.5'*tmp;
535 return getplayerkey(pl.sv_entnum, "name");
538 num = pl.(scores[SP_KILLS]);
539 denom = pl.(scores[SP_DEATHS]);
542 sbar_field_rgb = '0 1 0';
544 } else if(num <= 0) {
545 sbar_field_rgb = '1 0 0';
546 str = ftos(num/denom);
548 str = ftos(num/denom);
550 tmp = strstrofs(str, ".", 0);
552 str = substring(str, 0, tmp+2);
556 tmp = pl.(scores[field]);
557 f = scores_flags[field];
558 if(field == ps_primary)
559 sbar_field_rgb = '1 1 0';
560 else if(field == ps_secondary)
561 sbar_field_rgb = '0 1 1';
563 sbar_field_rgb = '1 1 1';
564 return ScoreString(f, tmp);
569 // shamelessly stolen from menu QC :P <- as if I would steal YOUR code pfft ;)
570 float textLengthUpToWidth(string theText, float maxWidth, float handleColors)
573 // The following function is SLOW.
574 // For your safety and for the protection of those around you...
575 // DO NOT CALL THIS AT HOME.
577 if(stringwidth(theText, handleColors) <= maxWidth)
578 return strlen(theText); // yeah!
580 // binary search for right place to cut string
581 float left, right, middle; // this always works
583 right = strlen(theText); // this always fails
586 middle = floor((left + right) / 2);
587 if(stringwidth(substring(theText, 0, middle), handleColors) <= maxWidth)
592 while(left < right - 1);
594 // NOTE: when color codes are involved, this binary search is,
595 // mathematically, BROKEN. However, it is obviously guaranteed to
596 // terminate, as the range still halves each time - but nevertheless, it is
597 // guaranteed that it finds ONE valid cutoff place (where "left" is in
598 // range, and "right" is outside).
602 string textShortenToWidth(string theText, float maxWidth, float handleColors)
604 if(stringwidth(theText, handleColors) <= maxWidth)
607 return strcat(substring(theText, 0, textLengthUpToWidth(theText, maxWidth - stringwidth("...", handleColors), handleColors)), "...");
610 float xmin, xmax, ymin, ymax, sbwidth, sbheight;
612 void Sbar_PrintScoreboardItem(vector pos, entity pl, float is_self)
618 is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
625 tmp_y = sbar_fontsize_y;
626 drawfill(pos - '1 1 0', tmp + '2 2 0', '1 1 1', 0.3, DRAWFLAG_NORMAL);
630 for(i = 0; i < sbar_num_fields; ++i)
632 field = sbar_field[i];
633 if(field == SP_SEPARATOR)
636 if(is_spec && field != SP_NAME && field != SP_PING) {
637 pos_x += sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
640 str = Sbar_GetField(pl, field);
646 realsize = sbar_size[i];
647 if(i+1 < sbar_num_fields)
648 if(sbar_field[i+1] == SP_SEPARATOR)
650 realsize = (xmax - xmin) / sbar_fontsize_x;
651 for(j = 0; j < sbar_num_fields; ++j) if(j != i) if(sbar_field[j] != SP_SEPARATOR)
652 realsize -= sbar_size[j] + 1;
655 str = textShortenToWidth(str, realsize, TRUE);
657 len = stringwidth(str, TRUE);
659 if(sbar_size[i] < len)
662 pos_x += sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
664 if(field == SP_NAME) {
665 tmp_x = sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
666 drawcolorcodedstring(pos - tmp, str, sbar_fontsize, 1, DRAWFLAG_NORMAL);
668 tmp_x = len*sbar_fontsize_x + sbar_fontsize_x;
669 drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, 1, DRAWFLAG_NORMAL);
673 if(sbar_field[i] == SP_SEPARATOR)
676 for(i = sbar_num_fields-1; i > 0; --i)
678 field = sbar_field[i];
679 if(field == SP_SEPARATOR)
682 if(is_spec && field != SP_NAME && field != SP_PING) {
683 pos_x -= sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
687 str = Sbar_GetField(pl, field);
690 str = textShortenToWidth(str, sbar_size[i], TRUE);
691 len = stringwidth(str, TRUE);
693 if(sbar_size[i] < len)
696 if(field == SP_NAME) {
697 tmp_x = sbar_fontsize_x*len; // left or right aligned? let's put it right...
698 drawcolorcodedstring(pos - tmp, str, sbar_fontsize, 1, DRAWFLAG_NORMAL);
700 tmp_x = sbar_fontsize_x*len; //strlen(str);
701 drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, 1, DRAWFLAG_NORMAL);
703 pos_x -= sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
709 void Sbar_DrawScoreboard()
711 //float xmin, ymin, xmax, ymax;
712 vector rgb, pos, tmp, sbar_save;
717 if(time > lastpingstime + 10)
720 lastpingstime = time;
723 xmin = vid_conwidth / 5;
726 xmax = vid_conwidth - xmin;
727 ymax = vid_conheight - 0.2*vid_conheight;
729 sbwidth = xmax - xmin;
730 sbheight = ymax - ymin;
732 center_x = xmin + 0.5*sbwidth;
734 //Sbar_UpdateFields();
736 // Initializes position
742 drawfont = sbar_bigfont;
743 pos_x = center_x - stringwidth("Scoreboard", TRUE)*0.5*24;
744 drawstring(pos, "Scoreboard", '24 24 0', '1 1 1', 1, DRAWFLAG_NORMAL);
748 // Titlebar background:
750 tmp_y = sbar_fontsize_y;
751 drawfill(pos - '1 1 0', tmp + '2 2 0', '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL);
753 drawfont = sbar_font;
755 for(i = 0; i < sbar_num_fields; ++i)
757 if(sbar_field[i] == SP_SEPARATOR)
759 drawstring(pos, sbar_title[i], sbar_fontsize, '1 1 1', 1, DRAWFLAG_NORMAL);
760 pos_x += sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
763 if(sbar_field[i] == SP_SEPARATOR)
765 pos_x = xmax + sbar_fontsize_x;
767 for(i = sbar_num_fields-1; i > 0; --i)
769 if(sbar_field[i] == SP_SEPARATOR)
772 pos_x -= sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
775 * Using the following line will fuck it all up:
777 * tmp_x = sbar_size[i] - strlen(sbar_title[i])*8;
779 tmp_x = sbar_fontsize_x*sbar_size[i];
780 tmp_x -= stringwidth(sbar_title[i], FALSE)*sbar_fontsize_x;
781 drawstring(pos + tmp, sbar_title[i], sbar_fontsize, '1 1 1', 1, DRAWFLAG_NORMAL);
786 pos_y += 1.5 * sbar_fontsize_y;
793 //for(tm = sortedTeams.sort_next; tm; tm = tm.sort_next)
794 for(tm = teams.sort_next; tm; tm = tm.sort_next)
796 if(!tm.team_size || tm.team == COLOR_SPECTATOR)
799 rgb = GetTeamRGB(tm.team);
804 pos - '6.5 0 0' * sbar_fontsize_y,
805 tm.(teamscores[ts_primary]),
806 4, sbar_fontsize_y * 1.5, rgb, 1, DRAWFLAG_NORMAL);
808 if(ts_primary != ts_secondary)
810 pos - '4.5 0 0' * sbar_fontsize_y + '0 1.5 0' * sbar_fontsize_y,
811 tm.(teamscores[ts_secondary]),
812 4, sbar_fontsize_y * 1, rgb, 1, DRAWFLAG_NORMAL);
814 specs = tm.team_size;
820 tmp_y = 1.25 * sbar_fontsize_y * specs;
821 drawfill(pos - '1 1 0', tmp + '2 0 0', rgb, 0.2, DRAWFLAG_NORMAL);
823 for(pl = players.sort_next; pl; pl = pl.sort_next)
825 if(pl.team != tm.team)
827 Sbar_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1));
828 pos_y += 1.25 * sbar_fontsize_y;
829 tmp_y -= 1.25 * sbar_fontsize_y;
831 pos_y += tmp_y + 1.5 * sbar_fontsize_y;
833 // rgb := tempvector :)
834 rgb = pos + '0 1.5 0' * sbar_fontsize_y;
835 pos_y += 3 * sbar_fontsize_y;
837 for(pl = players.sort_next; pl; pl = pl.sort_next)
839 if(pl.team != COLOR_SPECTATOR)
841 //drawcolorcodedstring(pos, getplayerkey(pl.sb_player, "name"), '8 8 0', 1, 0);
842 Sbar_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1));
843 pos += '0 1.25 0' * sbar_fontsize_y;
848 drawstring(rgb, "Spectators", sbar_fontsize, '1 1 1', 1, 0);
851 for(pl = players.sort_next; pl; pl = pl.sort_next)
853 if(pl.team == COLOR_SPECTATOR)
855 Sbar_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1));
856 pos_y += 1.25 * sbar_fontsize_y;
857 tmp_y -= 1.25 * sbar_fontsize_y;
860 // rgb := tempvector :)
861 rgb = pos + '0 1.5 0' * sbar_fontsize_y;
862 pos_y += 3 * sbar_fontsize_y;
864 for(pl = players.sort_next; pl; pl = pl.sort_next)
866 if(pl.team != COLOR_SPECTATOR)
868 Sbar_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1));
869 pos += '0 1.25 0' * sbar_fontsize_y;
874 drawstring(rgb, "Spectators", sbar_fontsize, '1 1 1', 1, 0);
879 str = strcat("playing on ^2", shortmapname, "^7");
880 tl = getstatf(STAT_TIMELIMIT);
881 fl = getstatf(STAT_FRAGLIMIT);
882 if(gametype == GAME_LMS)
885 str = strcat(str, " for up to ^1", ftos(tl), " minutes^7");
890 str = strcat(str, " for ^1", ftos(tl), " minutes^7");
894 str = strcat(str, " or");
895 str = strcat(str, " until ^3", ScoreString(scores_flags[ps_primary], fl));
896 if(scores_label[ps_primary] == "score")
897 str = strcat(str, " points^7");
898 else if(scores_label[ps_primary] == "fastest")
899 str = strcat(str, " is beaten^7");
901 str = strcat(str, " ", scores_label[ps_primary]);
905 pos_y += 1.5 * sbar_fontsize_y;
906 drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - sbar_fontsize_x * stringwidth(str, TRUE)), str, sbar_fontsize, 0.8, 0);
911 string MakeRaceString(float cp, float mytime, float histime, float lapdelta, string hisname)
919 if(histime == 0) // goal hit
923 timestr = strcat("+", ftos_decimals(+mytime, 1));
933 timestr = strcat("-", ftos_decimals(-mytime, 1));
939 lapstr = strcat(" (-", ftos(lapdelta), "L)");
942 else if(lapdelta < 0)
944 lapstr = strcat(" (+", ftos(-lapdelta), "L)");
948 else if(histime > 0) // anticipation
950 if(mytime >= histime)
951 timestr = strcat("+", ftos_decimals(mytime - histime, 1));
953 timestr = mmsss(histime * 10);
960 cpname = strcat("Intermediate ", ftos(cp));
962 cpname = "Finish line";
965 return strcat(col, cpname);
966 else if(hisname == "")
967 return strcat(col, cpname, " (", timestr, ")");
969 return strcat(col, cpname, " (", timestr, " ", strcat(hisname, col, lapstr), ")");
972 void dummyfunction(float a1, float a2, float a3, float a4, float a5, float a6, float a7, float a8)
976 void Sbar_Score(float margin)
978 float timelimit, timeleft, minutes, seconds, distribution, myplace, score;
979 vector sbar_save, place;
983 myteam = GetPlayerColor(player_localentnum - 1);
985 sbar_y = vid_conheight - (32+12);
996 //for(i = 0; i < 4; ++i)
997 for(tm = teams.sort_next; tm; tm = tm.sort_next)
999 if(tm.team == COLOR_SPECTATOR || !tm.team_size) // no players? don't display
1002 score = tm.(teamscores[ts_primary]);
1003 if(tm.team == myteam)
1004 Sbar_DrawXNum('-128 0 0', score, 4, 32, GetTeamRGB(tm.team), 1, DRAWFLAG_NORMAL);
1007 Sbar_DrawXNum(place, score, 4, 12, GetTeamRGB(tm.team), 1, DRAWFLAG_NORMAL);
1012 // me vector := [team/connected frags id]
1014 for(me = players.sort_next; me; me = me.sort_next)
1016 if(me.team != COLOR_SPECTATOR)
1018 if(me.sv_entnum == player_localentnum - 1)
1026 distribution = me.(scores[ps_primary]) - pl.(scores[ps_primary]);
1031 Sbar_DrawXNum('-36 -12 0', myplace, 3, 12, '1 1 1', 1, DRAWFLAG_NORMAL);
1032 else if(myplace == 2)
1033 Sbar_DrawXNum('-36 -12 0', myplace, 3, 12, '1 1 0', 1, DRAWFLAG_NORMAL);
1035 Sbar_DrawXNum('-36 -12 0', myplace, 3, 12, '1 0 0', 1, DRAWFLAG_NORMAL);
1037 score = me.(scores[ps_primary]);
1038 if(distribution >= 0)
1040 Sbar_DrawXNum('-84 -12 0', distribution, 4, 12, ' 1 1 1', 1, DRAWFLAG_NORMAL);
1041 Sbar_DrawXNum('-128 0 0', score, 4, 32, '1 1 1', 1, DRAWFLAG_NORMAL);
1042 } else if(distribution >= -5)
1044 Sbar_DrawXNum('-84 -12 0', distribution, 4, 12, ' 1 1 0', 1, DRAWFLAG_NORMAL);
1045 Sbar_DrawXNum('-128 0 0', score, 4, 32, '1 1 0', 1, DRAWFLAG_NORMAL);
1047 Sbar_DrawXNum('-84 -12 0', distribution, 4, 12, ' 1 0 0', 1, DRAWFLAG_NORMAL);
1048 Sbar_DrawXNum('-128 0 0', score, 4, 32, '1 0 0', 1, DRAWFLAG_NORMAL);
1051 timelimit = getstatf(STAT_TIMELIMIT);
1054 timeleft = max(0, timelimit * 60 - time);
1055 minutes = floor(timeleft / 60);
1056 seconds = floor(timeleft - minutes*60);
1059 Sbar_DrawXNum('-72 32 0', minutes, 3, 12, '1 1 1', 1, DRAWFLAG_NORMAL);
1060 drawpic(sbar + '-36 32 0', "gfx/num_colon", '12 12 0', '1 1 1', sbar_alpha_fg, 0);
1061 Sbar_DrawXNum('-24 32 0', seconds, -2, 12, '1 1 1', 1, DRAWFLAG_NORMAL);
1062 } else if(minutes >= 1)
1064 Sbar_DrawXNum('-72 32 0', minutes, 3, 12, '1 1 0', 1, DRAWFLAG_NORMAL);
1065 drawpic(sbar + '-36 32 0', "gfx/num_colon", '12 12 0', '1 1 0', sbar_alpha_fg, 0);
1066 Sbar_DrawXNum('-24 32 0', seconds, -2, 12, '1 1 0', 1, DRAWFLAG_NORMAL);
1068 Sbar_DrawXNum('-24 32 0', seconds, -2, 12, '1 0 0', 1, DRAWFLAG_NORMAL);
1071 minutes = floor(time / 60);
1072 seconds = floor(time - minutes*60);
1073 Sbar_DrawXNum('-72 32 0', minutes, 3, 12, '1 1 1', 1, DRAWFLAG_NORMAL);
1074 drawpic(sbar + '-36 32 0', "gfx/num_colon", '12 12 0', '1 1 1', sbar_alpha_fg, 0);
1075 Sbar_DrawXNum('-24 32 0', seconds, -2, 12, '1 1 1', 1, DRAWFLAG_NORMAL);
1078 if(gametype == GAME_RACE)
1080 drawfont = sbar_bigfont;
1083 string s, forcetime;
1085 m = '0.5 0 0' * vid_conwidth + '0 0.25 0' * vid_conheight;
1087 if(race_checkpointtime)
1090 a = bound(0, 2 - (time - race_checkpointtime), 1);
1093 if(a > 0) // just hit a checkpoint?
1095 if(race_time && race_previousbesttime)
1096 s = MakeRaceString(race_checkpoint, race_time / 10 - race_previousbesttime / 10, 0, 0, race_previousbestname);
1098 s = MakeRaceString(race_checkpoint, 0, -1, 0, race_previousbestname);
1100 forcetime = mmsss(race_time);
1104 if(race_laptime && race_nextbesttime)
1106 a = bound(0, 2 - ((race_laptime + race_nextbesttime/10) - time), 1);
1107 if(a > 0) // next one?
1109 s = MakeRaceString(race_nextcheckpoint, time - race_laptime, race_nextbesttime / 10, 0, race_nextbestname);
1114 if(s != "" && a > 0)
1116 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1117 drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, 0);
1123 a = bound(0, 1 - 2 * (time - race_checkpointtime), 1);
1124 sz = 1.2 / (a + 0.2);
1125 drawstring(m - '0 0 0' - '0 16 0' * (sz - 1) - '16 0 0' * sz * stringwidth(forcetime, FALSE), forcetime, '32 32 0' * sz, '1 1 1', sbar_alpha_fg * a, 0);
1133 s = mmsss(10*(time - race_laptime));
1134 drawstring(m - '0 0 0' - '16 0 0' * stringwidth(s, FALSE), s, '32 32 0', '1 1 1', sbar_alpha_fg * a, 0);
1139 if(race_mycheckpointtime)
1141 a = bound(0, 2 - (time - race_mycheckpointtime), 1);
1142 s = MakeRaceString(race_mycheckpoint, race_mycheckpointdelta / 10, -!race_mycheckpointenemy, race_mycheckpointlapsdelta, race_mycheckpointenemy);
1143 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1144 drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, 0);
1146 if(race_othercheckpointtime && race_othercheckpointenemy != "")
1148 a = bound(0, 2 - (time - race_othercheckpointtime), 1);
1149 s = MakeRaceString(race_othercheckpoint, -race_othercheckpointdelta / 10, -!race_othercheckpointenemy, race_othercheckpointlapsdelta, race_othercheckpointenemy);
1150 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1151 drawcolorcodedstring(m - '0 0 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, 0);
1155 drawfont = sbar_font;
1161 void Sbar_MiniscoreItem(vector pos, entity pl, float is_self)
1167 drawfill(pos + '0 1 0', '40 6 0', GetTeamRGB(pl.team)*0.5, 1, DRAWFLAG_NORMAL);
1169 drawfill(pos + '0 1 0', '40 6 0', '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL);
1172 score = pl.(scores[ps_primary]);
1173 pos_x -= stringwidth(ftos(score), FALSE)*8;
1174 drawstring(pos, ftos(score), '8 8 0', '1 1 1', 1, DRAWFLAG_NORMAL);
1179 drawstring(pos, "\x0D", '8 8 0', '1 1 1', 1, DRAWFLAG_NORMAL);
1183 drawcolorcodedstring(pos, getplayerkey(pl.sv_entnum, "name"), '8 8 0', 1, 0);
1186 void Sbar_MiniscoreTeamItem(vector pos, float color, float frags, float is_self)
1192 drawfill(pos + '0 1 0', '40 6 0', GetTeamRGB(color)*0.5, 1, DRAWFLAG_NORMAL);
1194 drawfill(pos + '0 1 0', '40 6 0', '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL);
1197 pos_x -= stringwidth(ftos(frags), FALSE)*8;
1198 drawstring(pos, ftos(frags), '8 8 0', '1 1 1', 1, DRAWFLAG_NORMAL);
1203 drawstring(pos, "\x0D", '8 8 0', '1 1 1', 1, DRAWFLAG_NORMAL);
1207 drawstring(pos, GetTeamName(color), '8 8 0', '1 1 1', 1, DRAWFLAG_NORMAL);
1210 void Sbar_MiniDeathmatchOverlay(vector pos)
1212 float numlines, up, down, score;
1214 float miniscoreboard_size;
1215 miniscoreboard_size = cvar("sbar_miniscoreboard_size");
1217 if(miniscoreboard_size == 0)
1219 pos_y = vid_conheight - 8;
1221 if(miniscoreboard_size < 0)
1222 numlines = (vid_conheight - sbar_y + 7) / 8;
1224 numlines = miniscoreboard_size;
1226 // give up if there isn't enough room
1227 if(pos_x >= vid_conwidth || pos_y >= vid_conheight || numlines < 1)
1230 // me vector := [team/connected frags id]
1231 for(me = players.sort_next; me; me = me.sort_next)
1233 if(me.sv_entnum == player_localentnum - 1)
1238 numlines -= numteams;
1240 // figure out how many players above and below we can show
1241 up = floor(numlines/2);
1243 if((up + down) > numlines)
1244 down = numlines - up;
1247 for(pl = me.sort_next; pl && down > 0; pl = pl.sort_next)
1249 if(pl.team == COLOR_SPECTATOR)
1251 Sbar_MiniscoreItem(pos, pl, false);
1255 Sbar_MiniscoreItem(pos, me, true);
1257 up += down; // if there weren't enough lines below... add them
1258 for(pl = me.sort_prev; pl && up > 0; pl = pl.sort_prev)
1260 if(pl.team == COLOR_SPECTATOR)
1262 Sbar_MiniscoreItem(pos, pl, false);
1269 for(tm = teams.sort_next; tm.sort_next; tm = tm.sort_next);
1270 for(; tm; tm = tm.sort_prev)
1272 if(!tm.team_size || tm.team == COLOR_SPECTATOR)
1274 score = tm.(teamscores[ts_primary]);
1275 Sbar_MiniscoreTeamItem(pos, tm.team, score, (tm.team == me.team));
1281 float Sbar_WouldDrawScoreboard ()
1285 else if (intermission == 1)
1287 else if (intermission == 2)
1289 else if (getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard"))
1291 else if(sb_showscores_force)
1296 void Sbar_Draw (void)
1302 sbar_fontsize = Sbar_GetFontsize();
1304 if(spectatee_status)
1308 o = '1 0 0' * vid_conwidth;
1309 if(spectatee_status == -1)
1312 s = strcat("^1Spectating ^7", getplayerkey(spectatee_status - 1, "name"));
1313 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1314 drawcolorcodedstring(
1315 o - sbar_fontsize_x * '1 0 0' * stringwidth(s, TRUE),
1321 o += sbar_fontsize_y * '0 1 0';
1323 if(spectatee_status == -1)
1324 s = "^1Press ^3primary fire^1 to spectate";
1326 s = "^1Press ^3primary fire^1 for another player";
1327 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1328 drawcolorcodedstring(
1329 o - sbar_fontsize_x * '1 0 0' * stringwidth(s, TRUE),
1335 o += sbar_fontsize_y * '0 1 0';
1337 if(spectatee_status == -1)
1338 s = "^1Use ^3weapon switching^1 to change the speed";
1340 s = "^1Press ^3secondary fire^1 to observe";
1341 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1342 drawcolorcodedstring(
1343 o - sbar_fontsize_x * '1 0 0' * stringwidth(s, TRUE),
1349 o += sbar_fontsize_y * '0 1 0';
1351 if(gametype == GAME_ARENA)
1352 s = "^1Wait for your turn to join";
1353 else if(gametype == GAME_LMS)
1356 sk = playerslots[player_localentnum - 1];
1357 if(sk.(scores[ps_primary]) >= 666)
1358 s = "^1Match has already begun";
1359 else if(sk.(scores[ps_primary]) > 0)
1360 s = "^1You have no more lives left";
1362 s = "^1Press ^7jump^1 to join";
1365 s = "^1Press ^7jump^1 to join";
1366 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1367 drawcolorcodedstring(
1368 o - sbar_fontsize_x * '1 0 0' * stringwidth(s, TRUE),
1374 o += sbar_fontsize_y * '0 1 0';
1378 Sbar_UpdatePlayerTeams();
1383 Sbar_DrawScoreboard();
1384 else if (intermission == 1)
1386 Sbar_DrawScoreboard();
1389 else if (intermission == 2)
1390 Sbar_FinaleOverlay();
1393 if (sb_showscores || sb_showscores_force || (getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard")))
1395 sbar_x = (vid_conwidth - 640.0)*0.5;
1396 sbar_y = vid_conheight - 47;
1397 //Sbar_DrawAlphaPic (sbar_x, sbar_y, sb_scorebar, sbar_alpha_bg.value);
1398 //drawpic('0 0 0', "gfx/scorebar", '0 0 0', '1 1 1', cvar("sbar_alpha_bg"), 0);
1399 Sbar_DrawScoreboard ();
1403 if (sb_lines && sbar_hudselector == 1)
1405 stat_items = getstati(STAT_ITEMS);
1407 sbar_x = (vid_conwidth - 320.0)*0.5;
1408 sbar_y = vid_conheight - 24.0 - 16.0;
1411 fade = 3.2 - 2 * (time - weapontime);
1412 fade = bound(0.7, fade, 1);
1415 for(i = 0; i < 8; ++i)
1419 Sbar_DrawWeapon(i+1, fade, (i + 2 == activeweapon));
1426 Sbar_DrawWeapon(0, fade, (activeweapon == 1));
1430 x = getstati(STAT_ARMOR);
1434 //Sbar_DrawStretchPic (72, 0, sb_armor[0], sbar_alpha_fg.value, 24, 24);
1435 drawpic(sbar + '72 0 0', "gfx/sb_armor", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1437 Sbar_DrawXNum('0 0 0', x, 3, 24, '0 1 0', 1, 0);
1439 Sbar_DrawXNum('0 0 0', x, 3, 24, '0.2 1 0', 1, 0);
1441 Sbar_DrawXNum('0 0 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
1443 Sbar_DrawXNum('0 0 0', x, 3, 24, '1 1 0.2', 1, 0);
1445 Sbar_DrawXNum('0 0 0', x, 3, 24, '0.7 0 0', 1, 0);
1449 x = getstati(STAT_HEALTH);
1453 //Sbar_DrawStretchPic (184, 0, sb_health, sbar_alpha_fg.value, 24, 24);
1454 drawpic(sbar + '184 0 0', "gfx/sb_health", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1456 Sbar_DrawXNum('112 0 0', x, 3, 24, '0 1 0', 1, 0);
1458 Sbar_DrawXNum('112 0 0', x, 3, 24, '0.2 1 0', 1, 0);
1460 Sbar_DrawXNum('112 0 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
1462 Sbar_DrawXNum('112 0 0', x, 3, 24, '1 1 0.2', 1, 0);
1464 Sbar_DrawXNum('112 0 0', x, 3, 24, '0.7 0 0', 1, 0);
1468 x = getstati(STAT_AMMO);
1469 if ((stat_items & (NEX_IT_SHELLS | NEX_IT_BULLETS | NEX_IT_ROCKETS | NEX_IT_CELLS)) || x != 0)
1471 if (stat_items & NEX_IT_SHELLS)
1472 drawpic(sbar + '296 0 0', "gfx/sb_shells", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1473 else if (stat_items & NEX_IT_BULLETS)
1474 drawpic(sbar + '296 0 0', "gfx/sb_bullets", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1475 else if (stat_items & NEX_IT_ROCKETS)
1476 drawpic(sbar + '296 0 0', "gfx/sb_rocket", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1477 else if (stat_items & NEX_IT_CELLS)
1478 drawpic(sbar + '296 0 0', "gfx/sb_cells", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1480 Sbar_DrawXNum('224 0 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
1482 Sbar_DrawXNum('224 0 0', x, 3, 24, '0.7 0 0', 1, 0);
1485 if (sbar_x + 320 + 160 <= vid_conwidth)
1486 Sbar_MiniDeathmatchOverlay(sbar + '320 0 0');
1489 // The margin can be at most 8 to support 640x480 console size:
1490 // 320 + 2 * (144 + 16) = 640
1495 stat_items = getstati(STAT_ITEMS);
1497 sbar_x = (vid_conwidth - 640.0)*0.5;
1498 sbar_y = vid_conheight - 47;
1501 fade = 3 - 2 * (time - weapontime);
1504 for(i = 0; i < 8; ++i)
1508 Sbar_DrawWeapon(i+1, fade, (i + 2 == activeweapon));
1515 Sbar_DrawWeapon(0, fade, (activeweapon == 1));
1519 drawpic(sbar, "gfx/sbar", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1521 drawpic(sbar, "gfx/sbar_minimal", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1525 Sbar_DrawXNum('268 12 0', getstati(STAT_ARMOR), 3, 24, '0.6 0.7 0.8', 1, 0);
1529 x = getstati(STAT_HEALTH);
1531 Sbar_DrawXNum('82 12 0', x, 3, 24, '1 1 1', 1, 0);
1532 else if(x <= 25 && time - floor(time) > 0.5)
1533 Sbar_DrawXNum('82 12 0', x, 3, 24, '0.7 0 0', 1, 0);
1535 Sbar_DrawXNum('81 12 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
1537 // AK dont draw ammo for the laser
1538 x = getstati(STAT_AMMO);
1539 if(activeweapon != 12)
1542 if (stat_items & NEX_IT_SHELLS)
1543 drawpic(sbar + '519 0 0', "gfx/sb_shells", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1544 else if (stat_items & NEX_IT_BULLETS)
1545 drawpic(sbar + '519 0 0', "gfx/sb_bullets", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1546 else if (stat_items & NEX_IT_ROCKETS)
1547 drawpic(sbar + '519 0 0', "gfx/sb_rocket", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1548 else if (stat_items & NEX_IT_CELLS)
1549 drawpic(sbar + '519 0 0', "gfx/sb_cells", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1551 Sbar_DrawXNum('447 12 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
1553 Sbar_DrawXNum('447 12 0', x, 3, 24, '0.7 0 0', 1, 0);
1557 drawpic(sbar, "gfx/sbar_overlay", '0 0 0', '1 1 1', 1, DRAWFLAG_MODULATE);
1559 if (sbar_x + 600 + 160 <= vid_conwidth)
1560 Sbar_MiniDeathmatchOverlay (sbar + '600 0 0');
1565 // Mini scoreboard uses 12*4 per other team, that is, 144
1566 // pixels when there are four teams...
1567 // Nexuiz by default sets vid_conwidth to 800... makes
1569 // so we need to shift it by 64 pixels to the right to fit
1570 // BUT: then it overlaps with the image that gets drawn
1571 // for viewsize 100! Therefore, just account for 3 teams,
1572 // that is, 96 pixels mini scoreboard size, needing 16 pixels
1577 if(gametype == GAME_KEYHUNT)
1580 } else if(gametype == GAME_CTF)
1588 void CSQC_ctf_hud(void)
1590 // cvar("sbar_flagstatus_right") move the flag icons right
1591 // cvar("sbar_flagstatus_pos") pixel position of the nexuiz flagstatus icons
1592 float redflag, blueflag;
1596 stat_items = getstati(STAT_ITEMS);
1597 redflag = (stat_items/32768) & 3;
1598 blueflag = (stat_items/131072) & 3;
1602 * For some reason now not even THAT works there...
1603 * Maybe the minus' precedence screws it up? The last one there, maybe I should use brackets
1605 * pos_x = (cvar("sbar_flagstatus_right")) ? vid_conwidth - 10 - sbar_x - 64 : 10 - sbar_x;
1606 ** Should try those later:
1607 * pos_x = (cvar("sbar_flagstatus_right")) ? (vid_conwidth - 10 - sbar_x - 64) : (10 - sbar_x);
1608 * pos_x = ( (cvar("sbar_flagstatus_right")) ? vid_conwidth - 10 - 64 : 10 ) - sbar_x;
1611 if(cvar("sbar_flagstatus_right"))
1612 pos_x = vid_conwidth - 10 - sbar_x - 64;
1614 pos_x = 10 - sbar_x;
1618 if(sbar_hudselector == 1)
1619 pos_y = (vid_conheight - sbar_y) - cvar("sbar_flagstatus_pos") - 64;
1627 case 1: drawpic(pos, "gfx/sb_flag_red_taken", '0 0 0', '1 1 1', 1, DRAWFLAG_NORMAL); break;
1628 case 2: drawpic(pos, "gfx/sb_flag_red_lost", '0 0 0', '1 1 1', 1, DRAWFLAG_NORMAL); break;
1629 case 3: drawpic(pos, "gfx/sb_flag_red_carrying", '0 0 0', '1 1 1', 1, DRAWFLAG_NORMAL); break;
1636 case 1: drawpic(pos, "gfx/sb_flag_blue_taken", '0 0 0', '1 1 1', 1, 0); break;
1637 case 2: drawpic(pos, "gfx/sb_flag_blue_lost", '0 0 0', '1 1 1', 1, 0); break;
1638 case 3: drawpic(pos, "gfx/sb_flag_blue_carrying", '0 0 0', '1 1 1', 1, 0); break;