5 float sb_lines; // still don't know what to do with that NOTE: check dp's sbar.c to see what that should be
9 float sbar_hudselector;
11 float ps_primary, ps_secondary;
12 float ts_primary, ts_secondary;
17 void Sbar_FinaleOverlay()
20 pos_x = (vid_conwidth - 1)/2;
24 //drawpic(pos, "gfx/finale", '0 0 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);
26 //drawstring(pos, "END", sbar_fontsize, '1 1 1', 1, DRAWFLAG_NORMAL);
30 void Sbar_DrawWeapon(float nr, float fade, float active)
32 vector pos, vsize, color;
35 value = (active) ? 1 : 0.6;
36 color_x = color_y = color_z = value;
38 if(sbar_hudselector == 1)
40 // width = 300, height = 100
41 const float w_width = 32, w_height = 12, w_space = 2, font_size = 8;
43 pos_x = (vid_conwidth - w_width * 9) * 0.5 + w_width * nr;
44 pos_y = (vid_conheight - w_height);
49 drawpic(pos, strcat("gfx/inv_weapon", ftos(nr)), vsize, color, value * fade * sbar_alpha_fg, 0);
55 drawstring(pos, ftos(nr+1), vsize, '1 1 0', sbar_alpha_fg, 0);
60 // width = 300, height = 100
61 const float w2_width = 300, w2_height = 100, w2_space = 10;
62 const float w2_scale = 0.4;
64 pos_x = vid_conwidth - (w2_width + w2_space) * w2_scale;
65 pos_y = (w2_height + w2_space) * w2_scale * nr + w2_space;
67 vsize_x = w2_width * w2_scale;
68 vsize_y = w2_height * w2_scale;
71 drawpic(pos, strcat("gfx/inv_weapon", ftos(nr)), vsize, color, value * fade * sbar_alpha_fg, 0);
74 void Sbar_DrawXNum (vector pos, float num, float digits, float lettersize, vector rgb, float a, float dflags)
81 vsize_x = vsize_y = lettersize;
96 str = strcat(substring("0000000000", 0, digits - strlen(tmp)), tmp);
104 str = substring(str, l-digits, 999);
106 } else if(l < digits)
107 pos_x += (digits-l) * lettersize;
111 drawpic(sbar + pos, "gfx/num_minus", vsize, rgb, a * sbar_alpha_fg, dflags);
115 for(i = 0; i < l; ++i)
117 drawpic(sbar + pos, strcat("gfx/num_", substring(str, i, 1)), vsize, rgb, a * sbar_alpha_fg, dflags);
122 void Cmd_Sbar_SetFields(float argc);
123 void Sbar_InitScores()
127 ps_primary = ps_secondary = ts_primary = ts_secondary = -1;
128 for(i = 0; i < MAX_SCORE; ++i)
130 f = (scores_flags[i] & SFL_SORT_PRIO_MASK);
131 if(f == SFL_SORT_PRIO_PRIMARY)
133 if(f == SFL_SORT_PRIO_SECONDARY)
136 if(ps_secondary == -1)
137 ps_secondary = ps_primary;
139 for(i = 0; i < MAX_TEAMSCORE; ++i)
141 f = (teamscores_flags[i] & SFL_SORT_PRIO_MASK);
142 if(f == SFL_SORT_PRIO_PRIMARY)
144 if(f == SFL_SORT_PRIO_SECONDARY)
147 if(ts_secondary == -1)
148 ts_secondary = ts_primary;
150 Cmd_Sbar_SetFields(0);
153 void Sbar_UpdatePlayerPos(entity pl);
154 float SetTeam(entity pl, float Team);
156 void Sbar_UpdatePlayerTeams()
163 for(pl = players.sort_next; pl; pl = pl.sort_next)
166 Team = GetPlayerColor(pl.sv_entnum);
167 if(SetTeam(pl, Team))
170 Sbar_UpdatePlayerPos(pl);
174 pl = players.sort_next;
179 print(strcat("PNUM: ", ftos(num), "\n"));
184 float Sbar_ComparePlayerScores(entity left, entity right)
187 vl = GetPlayerColor(left.sv_entnum);
188 vr = GetPlayerColor(right.sv_entnum);
195 if(vl == COLOR_SPECTATOR)
197 // FIRST the one with scores (spectators), THEN the ones without (downloaders)
199 if(!left.gotscores && right.gotscores)
204 vl = left.scores[ps_primary];
205 vr = right.scores[ps_primary];
206 if(scores_flags[ps_primary] & SFL_ZERO_IS_WORST)
208 if(vl == 0 && vr != 0)
210 if(vl != 0 && vr == 0)
214 return IS_INCREASING(scores_flags[ps_primary]);
216 return IS_DECREASING(scores_flags[ps_primary]);
218 vl = left.scores[ps_secondary];
219 vr = right.scores[ps_secondary];
220 if(scores_flags[ps_secondary] & SFL_ZERO_IS_WORST)
222 if(vl == 0 && vr != 0)
224 if(vl != 0 && vr == 0)
228 return IS_INCREASING(scores_flags[ps_secondary]);
230 return IS_DECREASING(scores_flags[ps_secondary]);
235 void Sbar_UpdatePlayerPos(entity player)
237 for(other = player.sort_next; other && Sbar_ComparePlayerScores(player, other); other = player.sort_next)
239 SORT_SWAP(player, other);
241 for(other = player.sort_prev; other != players && Sbar_ComparePlayerScores(other, player); other = player.sort_prev)
243 SORT_SWAP(other, player);
247 float Sbar_CompareTeamScores(entity left, entity right)
251 if(left.team == COLOR_SPECTATOR)
253 if(right.team == COLOR_SPECTATOR)
256 vl = left.teamscores[ts_primary];
257 vr = right.teamscores[ts_primary];
259 return IS_INCREASING(teamscores_flags[ts_primary]);
261 return IS_DECREASING(teamscores_flags[ts_primary]);
263 vl = left.teamscores[ts_secondary];
264 vr = right.teamscores[ts_secondary];
266 return IS_INCREASING(teamscores_flags[ts_secondary]);
268 return IS_DECREASING(teamscores_flags[ts_secondary]);
273 void Sbar_UpdateTeamPos(entity Team)
275 for(other = Team.sort_next; other && Sbar_CompareTeamScores(Team, other); other = Team.sort_next)
277 SORT_SWAP(Team, other);
279 for(other = Team.sort_prev; other != teams && Sbar_CompareTeamScores(other, Team); other = Team.sort_prev)
281 SORT_SWAP(other, Team);
285 void Cmd_Sbar_Help(float argc)
287 print("You can modify the scoreboard using the\n");
288 print("^3|---------------------------------------------------------------|\n");
289 print("^1 TO BE DONE\n");
291 print("^2sbar_columns_set default\n");
292 print("^2sbar_columns_set ^7filed1 field2 ...\n");
293 print("The following field names are recognized (case INsensitive):\n");
294 print("You can use a ^3|^7 to start the right-aligned fields.\n");
296 print("^3name^7 or ^3nick^7 Name of a player\n");
297 print("^3ping^7 Ping time\n\n");
298 print("^3kd^7 or ^3kdr^7 or ^3kdratio^7 or ^3k/d\n");
299 print(" The kill-death ratio\n");
301 print("Before a field you can put a + or - sign, then a comma separated list\n");
302 print("of game types, then a slash, to make the field show up only in these\n");
303 print("or in all but these game types.\n");
306 print("Additional columns:\n");
307 for(i = 0; i < MAX_SCORE; ++i)
309 if(scores_label[i] != "")
310 print(strcat(scores_label[i], "\n"));
314 #define MIN_NAMELEN 24
315 #define MAX_NAMELEN 24
317 string Sbar_DefaultColumnLayout()
319 return "ping pl name | -ctf,kh/kills -ctf,kh/deaths +lms/lives +lms/rank +kh,ctf/caps +kh/pushes +kh/destroyed -lms/score";
322 void Cmd_Sbar_SetFields(float argc)
325 string str, pattern, subpattern;
327 float have_name, have_primary, have_secondary, have_separator;
330 // TODO: re enable with gametype dependant cvars?
331 if(argc < 2) // no arguments provided
332 argc = tokenizebyseparator(strcat("x ", cvar_string("sbar_columns")), " ");
335 argc = tokenizebyseparator(strcat("x ", Sbar_DefaultColumnLayout()), " ");
339 if(argv(1) == "default")
340 argc = tokenizebyseparator(strcat("x ", Sbar_DefaultColumnLayout()), " ");
341 else if(argv(1) == "all")
345 for(i = 0; i < MAX_SCORE; ++i)
348 if(i != ps_secondary)
349 if(scores_label[i] != "")
350 s = strcat(s, " ", scores_label[i]);
352 if(ps_secondary != ps_primary)
353 s = strcat(s, " ", scores_label[ps_secondary]);
354 s = strcat(s, " ", scores_label[ps_primary]);
355 argc = tokenizebyseparator(strcat("x ", s), " ");
360 argc = min(MAX_SBAR_FIELDS, argc);
363 drawfont = sbar_font;
364 digit = stringwidth("0123456789", FALSE) / 10;
366 subpattern = strcat(",", GametypeNameFromType(gametype), ",");
368 argc = min(argc-1, MAX_SBAR_FIELDS-1);
369 for(i = 0; i < argc; ++i)
373 slash = strstrofs(str, "/", 0);
376 pattern = substring(str, 0, slash);
377 str = substring(str, slash + 1, strlen(str) - (slash + 1));
379 if(substring(pattern, 0, 1) == "-")
381 pattern = substring(pattern, 1, strlen(pattern) - 1);
382 if(strstrofs(strcat(",", pattern, ","), subpattern, 0) >= 0)
387 if(substring(pattern, 0, 1) == "+")
388 pattern = substring(pattern, 1, strlen(pattern) - 1);
389 if(strstrofs(strcat(",", pattern, ","), subpattern, 0) < 0)
394 strunzone(sbar_title[sbar_num_fields]);
395 sbar_title[sbar_num_fields] = strzone(str);
396 sbar_size[sbar_num_fields] = stringwidth(str, FALSE);
397 str = strtolower(str);
400 sbar_field[sbar_num_fields] = SP_PING;
401 } else if(str == "pl") {
402 sbar_field[sbar_num_fields] = SP_PL;
403 } else if(str == "kd" || str == "kdr" || str == "kdratio" || str == "k/d") {
404 sbar_field[sbar_num_fields] = SP_KDRATIO;
405 } else if(str == "name" || str == "nick") {
406 sbar_field[sbar_num_fields] = SP_NAME;
407 sbar_size[sbar_num_fields] = MIN_NAMELEN; // minimum size? any use?
409 } else if(str == "|") {
410 sbar_field[sbar_num_fields] = SP_SEPARATOR;
413 for(j = 0; j < MAX_SCORE; ++j)
414 if(str == strtolower(scores_label[j]))
415 goto found; // sorry, but otherwise fteqcc -O3 miscompiles this and warns about "unreachable code"
417 print(strcat("^1Error:^7 Unknown score field: '", str, "'\n"));
420 sbar_field[sbar_num_fields] = j;
423 if(j == ps_secondary)
429 if(scores_flags[ps_primary] & SFL_ALLOW_HIDE)
431 if(scores_flags[ps_secondary] & SFL_ALLOW_HIDE)
433 if(ps_primary == ps_secondary)
435 missing = !have_primary + !have_secondary + !have_separator + !have_name;
437 if(sbar_num_fields+missing < MAX_SBAR_FIELDS)
441 strunzone(sbar_title[sbar_num_fields]);
442 for(i = sbar_num_fields; i > 0; --i)
444 sbar_title[i] = sbar_title[i-1];
445 sbar_size[i] = sbar_size[i-1];
446 sbar_field[i] = sbar_field[i-1];
448 sbar_title[0] = strzone("name");
449 sbar_field[0] = SP_NAME;
450 sbar_size[0] = MIN_NAMELEN; // minimum size? any use?
452 print("fixed missing field 'name'\n");
456 strunzone(sbar_title[sbar_num_fields]);
457 for(i = sbar_num_fields; i > 1; --i)
459 sbar_title[i] = sbar_title[i-1];
460 sbar_size[i] = sbar_size[i-1];
461 sbar_field[i] = sbar_field[i-1];
463 sbar_title[1] = strzone("|");
464 sbar_field[1] = SP_SEPARATOR;
465 sbar_size[1] = stringwidth("|", FALSE);
467 print("fixed missing field '|'\n");
470 else if(!have_separator)
472 strunzone(sbar_title[sbar_num_fields]);
473 sbar_title[sbar_num_fields] = strzone("|");
474 sbar_size[sbar_num_fields] = stringwidth("|", FALSE);
475 sbar_field[sbar_num_fields] = SP_SEPARATOR;
477 print("fixed missing field '|'\n");
482 strunzone(sbar_title[sbar_num_fields]);
483 sbar_title[sbar_num_fields] = strzone(scores_label[ps_secondary]);
484 sbar_size[sbar_num_fields] = stringwidth(sbar_title[sbar_num_fields], FALSE);
485 sbar_field[sbar_num_fields] = ps_secondary;
487 print("fixed missing field '", scores_label[ps_secondary], "'\n");
492 strunzone(sbar_title[sbar_num_fields]);
493 sbar_title[sbar_num_fields] = strzone(scores_label[ps_primary]);
494 sbar_size[sbar_num_fields] = stringwidth(sbar_title[sbar_num_fields], FALSE);
495 sbar_field[sbar_num_fields] = ps_primary;
497 print("fixed missing field '", scores_label[ps_primary], "'\n");
501 sbar_field[sbar_num_fields] = SP_END;
505 vector sbar_field_rgb;
506 string Sbar_GetField(entity pl, float field)
508 float tmp, num, denom, f;
510 sbar_field_rgb = '1 1 1';
515 return "\x8D\x8D\x8D"; // >>> sign
516 str = getplayerkey(pl.sv_entnum, "ping");
519 tmp = max(0, min(220, stof(str)-80)) / 220;
520 sbar_field_rgb = '1 1 1' - '0 1 1'*tmp;
526 str = getplayerkey(pl.sv_entnum, "pl");
529 tmp = bound(0, stof(str), 20) / 20; // 20% is REALLY BAD pl
530 sbar_field_rgb = '1 0.5 0.5' - '0 0.5 0.5'*tmp;
534 return getplayerkey(pl.sv_entnum, "name");
537 num = pl.(scores[SP_KILLS]);
538 denom = pl.(scores[SP_DEATHS]);
541 sbar_field_rgb = '0 1 0';
543 } else if(num <= 0) {
544 sbar_field_rgb = '1 0 0';
545 str = ftos(num/denom);
547 str = ftos(num/denom);
549 tmp = strstrofs(str, ".", 0);
551 str = substring(str, 0, tmp+2);
555 tmp = pl.(scores[field]);
556 f = scores_flags[field];
557 if(field == ps_primary)
558 sbar_field_rgb = '1 1 0';
559 else if(field == ps_secondary)
560 sbar_field_rgb = '0 1 1';
562 sbar_field_rgb = '1 1 1';
563 return ScoreString(f, tmp);
568 // shamelessly stolen from menu QC :P <- as if I would steal YOUR code pfft ;)
569 float textLengthUpToWidth(string theText, float maxWidth, float handleColors)
572 // The following function is SLOW.
573 // For your safety and for the protection of those around you...
574 // DO NOT CALL THIS AT HOME.
576 if(stringwidth(theText, handleColors) <= maxWidth)
577 return strlen(theText); // yeah!
579 // binary search for right place to cut string
580 float left, right, middle; // this always works
582 right = strlen(theText); // this always fails
585 middle = floor((left + right) / 2);
586 if(stringwidth(substring(theText, 0, middle), handleColors) <= maxWidth)
591 while(left < right - 1);
593 // NOTE: when color codes are involved, this binary search is,
594 // mathematically, BROKEN. However, it is obviously guaranteed to
595 // terminate, as the range still halves each time - but nevertheless, it is
596 // guaranteed that it finds ONE valid cutoff place (where "left" is in
597 // range, and "right" is outside).
601 string textShortenToWidth(string theText, float maxWidth, float handleColors)
603 if(stringwidth(theText, handleColors) <= maxWidth)
606 return strcat(substring(theText, 0, textLengthUpToWidth(theText, maxWidth - stringwidth("...", handleColors), handleColors)), "...");
609 float xmin, xmax, ymin, ymax, sbwidth, sbheight;
611 void Sbar_PrintScoreboardItem(vector pos, entity pl, float is_self)
617 is_spec = (GetPlayerColor(pl.sv_entnum) == COLOR_SPECTATOR);
624 tmp_y = sbar_fontsize_y;
625 drawfill(pos - '1 1 0', tmp + '2 2 0', '1 1 1', 0.3, DRAWFLAG_NORMAL);
629 for(i = 0; i < sbar_num_fields; ++i)
631 field = sbar_field[i];
632 if(field == SP_SEPARATOR)
635 if(is_spec && field != SP_NAME && field != SP_PING) {
636 pos_x += sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
639 str = Sbar_GetField(pl, field);
645 realsize = sbar_size[i];
646 if(i+1 < sbar_num_fields)
647 if(sbar_field[i+1] == SP_SEPARATOR)
649 realsize = (xmax - xmin) / sbar_fontsize_x;
650 for(j = 0; j < sbar_num_fields; ++j) if(j != i) if(sbar_field[j] != SP_SEPARATOR)
651 realsize -= sbar_size[j] + 1;
654 str = textShortenToWidth(str, realsize, TRUE);
656 len = stringwidth(str, TRUE);
658 if(sbar_size[i] < len)
661 pos_x += sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
663 if(field == SP_NAME) {
664 tmp_x = sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
665 drawcolorcodedstring(pos - tmp, str, sbar_fontsize, 1, DRAWFLAG_NORMAL);
667 tmp_x = len*sbar_fontsize_x + sbar_fontsize_x;
668 drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, 1, DRAWFLAG_NORMAL);
672 if(sbar_field[i] == SP_SEPARATOR)
675 for(i = sbar_num_fields-1; i > 0; --i)
677 field = sbar_field[i];
678 if(field == SP_SEPARATOR)
681 if(is_spec && field != SP_NAME && field != SP_PING) {
682 pos_x -= sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
686 str = Sbar_GetField(pl, field);
689 str = textShortenToWidth(str, sbar_size[i], TRUE);
690 len = stringwidth(str, TRUE);
692 if(sbar_size[i] < len)
695 if(field == SP_NAME) {
696 tmp_x = sbar_fontsize_x*len; // left or right aligned? let's put it right...
697 drawcolorcodedstring(pos - tmp, str, sbar_fontsize, 1, DRAWFLAG_NORMAL);
699 tmp_x = sbar_fontsize_x*len; //strlen(str);
700 drawstring(pos - tmp, str, sbar_fontsize, sbar_field_rgb, 1, DRAWFLAG_NORMAL);
702 pos_x -= sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
708 void Sbar_DrawScoreboard()
710 //float xmin, ymin, xmax, ymax;
711 vector rgb, pos, tmp, sbar_save;
716 if(time > lastpingstime + 10)
719 lastpingstime = time;
722 xmin = vid_conwidth / 5;
725 xmax = vid_conwidth - xmin;
726 ymax = vid_conheight - 0.2*vid_conheight;
728 sbwidth = xmax - xmin;
729 sbheight = ymax - ymin;
731 center_x = xmin + 0.5*sbwidth;
733 //Sbar_UpdateFields();
735 // Initializes position
741 drawfont = sbar_bigfont;
742 pos_x = center_x - stringwidth("Scoreboard", TRUE)*0.5*24;
743 drawstring(pos, "Scoreboard", '24 24 0', '1 1 1', 1, DRAWFLAG_NORMAL);
747 // Titlebar background:
749 tmp_y = sbar_fontsize_y;
750 drawfill(pos - '1 1 0', tmp + '2 2 0', '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL);
752 drawfont = sbar_font;
754 for(i = 0; i < sbar_num_fields; ++i)
756 if(sbar_field[i] == SP_SEPARATOR)
758 drawstring(pos, sbar_title[i], sbar_fontsize, '1 1 1', 1, DRAWFLAG_NORMAL);
759 pos_x += sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
762 if(sbar_field[i] == SP_SEPARATOR)
764 pos_x = xmax + sbar_fontsize_x;
766 for(i = sbar_num_fields-1; i > 0; --i)
768 if(sbar_field[i] == SP_SEPARATOR)
771 pos_x -= sbar_fontsize_x*sbar_size[i] + sbar_fontsize_x;
774 * Using the following line will fuck it all up:
776 * tmp_x = sbar_size[i] - strlen(sbar_title[i])*8;
778 tmp_x = sbar_fontsize_x*sbar_size[i];
779 tmp_x -= stringwidth(sbar_title[i], FALSE)*sbar_fontsize_x;
780 drawstring(pos + tmp, sbar_title[i], sbar_fontsize, '1 1 1', 1, DRAWFLAG_NORMAL);
785 pos_y += 1.5 * sbar_fontsize_y;
792 //for(tm = sortedTeams.sort_next; tm; tm = tm.sort_next)
793 for(tm = teams.sort_next; tm; tm = tm.sort_next)
795 if(!tm.team_size || tm.team == COLOR_SPECTATOR)
798 rgb = GetTeamRGB(tm.team);
803 pos - '6.5 0 0' * sbar_fontsize_y,
804 tm.(teamscores[ts_primary]),
805 4, sbar_fontsize_y * 1.5, rgb, 1, DRAWFLAG_NORMAL);
807 if(ts_primary != ts_secondary)
809 pos - '4.5 0 0' * sbar_fontsize_y + '0 1.5 0' * sbar_fontsize_y,
810 tm.(teamscores[ts_secondary]),
811 4, sbar_fontsize_y * 1, rgb, 1, DRAWFLAG_NORMAL);
813 specs = tm.team_size;
819 tmp_y = 1.25 * sbar_fontsize_y * specs;
820 drawfill(pos - '1 1 0', tmp + '2 0 0', rgb, 0.2, DRAWFLAG_NORMAL);
822 for(pl = players.sort_next; pl; pl = pl.sort_next)
824 if(pl.team != tm.team)
826 Sbar_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1));
827 pos_y += 1.25 * sbar_fontsize_y;
828 tmp_y -= 1.25 * sbar_fontsize_y;
830 pos_y += tmp_y + 1.5 * sbar_fontsize_y;
832 // rgb := tempvector :)
833 rgb = pos + '0 1.5 0' * sbar_fontsize_y;
834 pos_y += 3 * sbar_fontsize_y;
836 for(pl = players.sort_next; pl; pl = pl.sort_next)
838 if(pl.team != COLOR_SPECTATOR)
840 //drawcolorcodedstring(pos, getplayerkey(pl.sb_player, "name"), '8 8 0', 1, 0);
841 Sbar_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1));
842 pos += '0 1.25 0' * sbar_fontsize_y;
847 drawstring(rgb, "Spectators", sbar_fontsize, '1 1 1', 1, 0);
850 for(pl = players.sort_next; pl; pl = pl.sort_next)
852 if(pl.team == COLOR_SPECTATOR)
854 Sbar_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1));
855 pos_y += 1.25 * sbar_fontsize_y;
856 tmp_y -= 1.25 * sbar_fontsize_y;
859 // rgb := tempvector :)
860 rgb = pos + '0 1.5 0' * sbar_fontsize_y;
861 pos_y += 3 * sbar_fontsize_y;
863 for(pl = players.sort_next; pl; pl = pl.sort_next)
865 if(pl.team != COLOR_SPECTATOR)
867 Sbar_PrintScoreboardItem(pos, pl, (pl.sv_entnum == player_localentnum - 1));
868 pos += '0 1.25 0' * sbar_fontsize_y;
873 drawstring(rgb, "Spectators", sbar_fontsize, '1 1 1', 1, 0);
878 str = strcat("playing on ^2", shortmapname, "^7");
879 tl = getstatf(STAT_TIMELIMIT);
880 fl = getstatf(STAT_FRAGLIMIT);
881 if(gametype == GAME_LMS)
884 str = strcat(str, " for up to ^1", ftos(tl), " minutes^7");
889 str = strcat(str, " for ^1", ftos(tl), " minutes^7");
893 str = strcat(str, " or");
894 str = strcat(str, " until ^3", ScoreString(scores_flags[ps_primary], fl));
895 if(scores_label[ps_primary] == "score")
896 str = strcat(str, " points^7");
897 else if(scores_label[ps_primary] == "fastest")
898 str = strcat(str, " is beaten^7");
900 str = strcat(str, " ", scores_label[ps_primary]);
904 pos_y += 1.5 * sbar_fontsize_y;
905 drawcolorcodedstring(pos + '0.5 0 0' * (sbwidth - sbar_fontsize_x * stringwidth(str, TRUE)), str, sbar_fontsize, 0.8, 0);
910 string MakeRaceString(float cp, float mytime, float histime, float lapdelta, string hisname)
918 if(histime == 0) // goal hit
922 timestr = strcat("+", ftos_decimals(+mytime, 1));
932 timestr = strcat("-", ftos_decimals(-mytime, 1));
938 lapstr = strcat(" (-", ftos(lapdelta), "L)");
941 else if(lapdelta < 0)
943 lapstr = strcat(" (+", ftos(-lapdelta), "L)");
947 else if(histime > 0) // anticipation
949 if(mytime >= histime)
950 timestr = strcat("+", ftos_decimals(mytime - histime, 1));
952 timestr = mmsss(histime * 10);
959 cpname = strcat("Intermediate ", ftos(cp));
961 cpname = "Finish line";
964 return strcat(col, cpname);
965 else if(hisname == "")
966 return strcat(col, cpname, " (", timestr, ")");
968 return strcat(col, cpname, " (", timestr, " ", strcat(hisname, col, lapstr), ")");
971 void dummyfunction(float a1, float a2, float a3, float a4, float a5, float a6, float a7, float a8)
975 void Sbar_Score(float margin)
977 float timelimit, timeleft, minutes, seconds, distribution, myplace, score;
978 vector sbar_save, place;
982 myteam = GetPlayerColor(player_localentnum - 1);
984 sbar_y = vid_conheight - (32+12);
995 //for(i = 0; i < 4; ++i)
996 for(tm = teams.sort_next; tm; tm = tm.sort_next)
998 if(tm.team == COLOR_SPECTATOR || !tm.team_size) // no players? don't display
1001 score = tm.(teamscores[ts_primary]);
1002 if(tm.team == myteam)
1003 Sbar_DrawXNum('-128 0 0', score, 4, 32, GetTeamRGB(tm.team), 1, DRAWFLAG_NORMAL);
1006 Sbar_DrawXNum(place, score, 4, 12, GetTeamRGB(tm.team), 1, DRAWFLAG_NORMAL);
1011 // me vector := [team/connected frags id]
1013 for(me = players.sort_next; me; me = me.sort_next)
1015 if(me.team != COLOR_SPECTATOR)
1017 if(me.sv_entnum == player_localentnum - 1)
1025 distribution = me.(scores[ps_primary]) - pl.(scores[ps_primary]);
1030 Sbar_DrawXNum('-36 -12 0', myplace, 3, 12, '1 1 1', 1, DRAWFLAG_NORMAL);
1031 else if(myplace == 2)
1032 Sbar_DrawXNum('-36 -12 0', myplace, 3, 12, '1 1 0', 1, DRAWFLAG_NORMAL);
1034 Sbar_DrawXNum('-36 -12 0', myplace, 3, 12, '1 0 0', 1, DRAWFLAG_NORMAL);
1036 score = me.(scores[ps_primary]);
1037 if(distribution >= 0)
1039 Sbar_DrawXNum('-84 -12 0', distribution, 4, 12, ' 1 1 1', 1, DRAWFLAG_NORMAL);
1040 Sbar_DrawXNum('-128 0 0', score, 4, 32, '1 1 1', 1, DRAWFLAG_NORMAL);
1041 } else if(distribution >= -5)
1043 Sbar_DrawXNum('-84 -12 0', distribution, 4, 12, ' 1 1 0', 1, DRAWFLAG_NORMAL);
1044 Sbar_DrawXNum('-128 0 0', score, 4, 32, '1 1 0', 1, DRAWFLAG_NORMAL);
1046 Sbar_DrawXNum('-84 -12 0', distribution, 4, 12, ' 1 0 0', 1, DRAWFLAG_NORMAL);
1047 Sbar_DrawXNum('-128 0 0', score, 4, 32, '1 0 0', 1, DRAWFLAG_NORMAL);
1050 timelimit = getstatf(STAT_TIMELIMIT);
1053 timeleft = max(0, timelimit * 60 - time);
1054 minutes = floor(timeleft / 60);
1055 seconds = floor(timeleft - minutes*60);
1058 Sbar_DrawXNum('-72 32 0', minutes, 3, 12, '1 1 1', 1, DRAWFLAG_NORMAL);
1059 drawpic(sbar + '-36 32 0', "gfx/num_colon", '12 12 0', '1 1 1', sbar_alpha_fg, 0);
1060 Sbar_DrawXNum('-24 32 0', seconds, -2, 12, '1 1 1', 1, DRAWFLAG_NORMAL);
1061 } else if(minutes >= 1)
1063 Sbar_DrawXNum('-72 32 0', minutes, 3, 12, '1 1 0', 1, DRAWFLAG_NORMAL);
1064 drawpic(sbar + '-36 32 0', "gfx/num_colon", '12 12 0', '1 1 0', sbar_alpha_fg, 0);
1065 Sbar_DrawXNum('-24 32 0', seconds, -2, 12, '1 1 0', 1, DRAWFLAG_NORMAL);
1067 Sbar_DrawXNum('-24 32 0', seconds, -2, 12, '1 0 0', 1, DRAWFLAG_NORMAL);
1070 minutes = floor(time / 60);
1071 seconds = floor(time - minutes*60);
1072 Sbar_DrawXNum('-72 32 0', minutes, 3, 12, '1 1 1', 1, DRAWFLAG_NORMAL);
1073 drawpic(sbar + '-36 32 0', "gfx/num_colon", '12 12 0', '1 1 1', sbar_alpha_fg, 0);
1074 Sbar_DrawXNum('-24 32 0', seconds, -2, 12, '1 1 1', 1, DRAWFLAG_NORMAL);
1077 if(gametype == GAME_RACE)
1079 drawfont = sbar_bigfont;
1082 string s, forcetime;
1084 m = '0.5 0 0' * vid_conwidth + '0 0.25 0' * vid_conheight;
1086 if(race_checkpointtime)
1089 a = bound(0, 2 - (time - race_checkpointtime), 1);
1092 if(a > 0) // just hit a checkpoint?
1094 if(race_time && race_previousbesttime)
1095 s = MakeRaceString(race_checkpoint, race_time / 10 - race_previousbesttime / 10, 0, 0, race_previousbestname);
1097 s = MakeRaceString(race_checkpoint, 0, -1, 0, race_previousbestname);
1099 forcetime = mmsss(race_time);
1103 if(race_laptime && race_nextbesttime)
1105 a = bound(0, 2 - ((race_laptime + race_nextbesttime/10) - time), 1);
1106 if(a > 0) // next one?
1108 s = MakeRaceString(race_nextcheckpoint, time - race_laptime, race_nextbesttime / 10, 0, race_nextbestname);
1113 if(s != "" && a > 0)
1115 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1116 drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, 0);
1122 a = bound(0, 1 - 2 * (time - race_checkpointtime), 1);
1123 sz = 1.2 / (a + 0.2);
1124 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);
1132 s = mmsss(10*(time - race_laptime));
1133 drawstring(m - '0 0 0' - '16 0 0' * stringwidth(s, FALSE), s, '32 32 0', '1 1 1', sbar_alpha_fg * a, 0);
1138 if(race_mycheckpointtime)
1140 a = bound(0, 2 - (time - race_mycheckpointtime), 1);
1141 s = MakeRaceString(race_mycheckpoint, race_mycheckpointdelta / 10, -!race_mycheckpointenemy, race_mycheckpointlapsdelta, race_mycheckpointenemy);
1142 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1143 drawcolorcodedstring(m - '0 16 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, 0);
1145 if(race_othercheckpointtime && race_othercheckpointenemy != "")
1147 a = bound(0, 2 - (time - race_othercheckpointtime), 1);
1148 s = MakeRaceString(race_othercheckpoint, -race_othercheckpointdelta / 10, -!race_othercheckpointenemy, race_othercheckpointlapsdelta, race_othercheckpointenemy);
1149 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1150 drawcolorcodedstring(m - '0 0 0' - '8 0 0' * stringwidth(s, TRUE), s, '16 16 0', sbar_alpha_fg * a, 0);
1154 drawfont = sbar_font;
1160 void Sbar_MiniscoreItem(vector pos, entity pl, float is_self)
1166 drawfill(pos + '0 1 0', '40 6 0', GetTeamRGB(pl.team)*0.5, 1, DRAWFLAG_NORMAL);
1168 drawfill(pos + '0 1 0', '40 6 0', '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL);
1171 score = pl.(scores[ps_primary]);
1172 pos_x -= stringwidth(ftos(score), FALSE)*8;
1173 drawstring(pos, ftos(score), '8 8 0', '1 1 1', 1, DRAWFLAG_NORMAL);
1178 drawstring(pos, "\x0D", '8 8 0', '1 1 1', 1, DRAWFLAG_NORMAL);
1182 drawcolorcodedstring(pos, getplayerkey(pl.sv_entnum, "name"), '8 8 0', 1, 0);
1185 void Sbar_MiniscoreTeamItem(vector pos, float color, float frags, float is_self)
1191 drawfill(pos + '0 1 0', '40 6 0', GetTeamRGB(color)*0.5, 1, DRAWFLAG_NORMAL);
1193 drawfill(pos + '0 1 0', '40 6 0', '0.5 0.5 0.5', 0.5, DRAWFLAG_NORMAL);
1196 pos_x -= stringwidth(ftos(frags), FALSE)*8;
1197 drawstring(pos, ftos(frags), '8 8 0', '1 1 1', 1, DRAWFLAG_NORMAL);
1202 drawstring(pos, "\x0D", '8 8 0', '1 1 1', 1, DRAWFLAG_NORMAL);
1206 drawstring(pos, GetTeamName(color), '8 8 0', '1 1 1', 1, DRAWFLAG_NORMAL);
1209 void Sbar_MiniDeathmatchOverlay(vector pos)
1211 float numlines, up, down, score;
1213 float miniscoreboard_size;
1214 miniscoreboard_size = cvar("sbar_miniscoreboard_size");
1216 if(miniscoreboard_size == 0)
1218 pos_y = vid_conheight - 8;
1220 if(miniscoreboard_size < 0)
1221 numlines = (vid_conheight - sbar_y + 7) / 8;
1223 numlines = miniscoreboard_size;
1225 // give up if there isn't enough room
1226 if(pos_x >= vid_conwidth || pos_y >= vid_conheight || numlines < 1)
1229 // me vector := [team/connected frags id]
1230 for(me = players.sort_next; me; me = me.sort_next)
1232 if(me.sv_entnum == player_localentnum - 1)
1237 numlines -= numteams;
1239 // figure out how many players above and below we can show
1240 up = floor(numlines/2);
1242 if((up + down) > numlines)
1243 down = numlines - up;
1246 for(pl = me.sort_next; pl && down > 0; pl = pl.sort_next)
1248 if(pl.team == COLOR_SPECTATOR)
1250 Sbar_MiniscoreItem(pos, pl, false);
1254 Sbar_MiniscoreItem(pos, me, true);
1256 up += down; // if there weren't enough lines below... add them
1257 for(pl = me.sort_prev; pl && up > 0; pl = pl.sort_prev)
1259 if(pl.team == COLOR_SPECTATOR)
1261 Sbar_MiniscoreItem(pos, pl, false);
1268 for(tm = teams.sort_next; tm.sort_next; tm = tm.sort_next);
1269 for(; tm; tm = tm.sort_prev)
1271 if(!tm.team_size || tm.team == COLOR_SPECTATOR)
1273 score = tm.(teamscores[ts_primary]);
1274 Sbar_MiniscoreTeamItem(pos, tm.team, score, (tm.team == me.team));
1280 float Sbar_WouldDrawScoreboard ()
1284 else if (intermission == 1)
1286 else if (intermission == 2)
1288 else if (getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard"))
1290 else if(sb_showscores_force)
1295 void Sbar_Draw (void)
1301 sbar_fontsize = Sbar_GetFontsize();
1303 if(spectatee_status)
1307 o = '1 0 0' * vid_conwidth;
1308 if(spectatee_status == -1)
1311 s = strcat("^1Spectating ^7", getplayerkey(spectatee_status - 1, "name"));
1312 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1313 drawcolorcodedstring(
1314 o - sbar_fontsize_x * '1 0 0' * stringwidth(s, TRUE),
1320 o += sbar_fontsize_y * '0 1 0';
1322 if(spectatee_status == -1)
1323 s = "^1Press ^3primary fire^1 to spectate";
1325 s = "^1Press ^3primary fire^1 for another player";
1326 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1327 drawcolorcodedstring(
1328 o - sbar_fontsize_x * '1 0 0' * stringwidth(s, TRUE),
1334 o += sbar_fontsize_y * '0 1 0';
1336 if(spectatee_status == -1)
1337 s = "^1Use ^3weapon switching^1 to change the speed";
1339 s = "^1Press ^3secondary fire^1 to observe";
1340 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1341 drawcolorcodedstring(
1342 o - sbar_fontsize_x * '1 0 0' * stringwidth(s, TRUE),
1348 o += sbar_fontsize_y * '0 1 0';
1350 if(gametype == GAME_ARENA)
1351 s = "^1Wait for your turn to join";
1352 else if(gametype == GAME_LMS)
1355 sk = playerslots[player_localentnum - 1];
1356 if(sk.(scores[ps_primary]) >= 666)
1357 s = "^1Match has already begun";
1358 else if(sk.(scores[ps_primary]) > 0)
1359 s = "^1You have no more lives left";
1361 s = "^1Press ^7jump^1 to join";
1364 s = "^1Press ^7jump^1 to join";
1365 dummyfunction(0, 0, 0, 0, 0, 0, 0, 0); // work around DP bug (set OFS_PARAM5 to 0)
1366 drawcolorcodedstring(
1367 o - sbar_fontsize_x * '1 0 0' * stringwidth(s, TRUE),
1373 o += sbar_fontsize_y * '0 1 0';
1377 Sbar_UpdatePlayerTeams();
1382 Sbar_DrawScoreboard();
1383 else if (intermission == 1)
1385 Sbar_DrawScoreboard();
1388 else if (intermission == 2)
1389 Sbar_FinaleOverlay();
1392 if (sb_showscores || sb_showscores_force || (getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard")))
1394 sbar_x = (vid_conwidth - 640.0)*0.5;
1395 sbar_y = vid_conheight - 47;
1396 //Sbar_DrawAlphaPic (sbar_x, sbar_y, sb_scorebar, sbar_alpha_bg.value);
1397 //drawpic('0 0 0', "gfx/scorebar", '0 0 0', '1 1 1', cvar("sbar_alpha_bg"), 0);
1398 Sbar_DrawScoreboard ();
1402 if (sb_lines && sbar_hudselector == 1)
1404 stat_items = getstati(STAT_ITEMS);
1406 sbar_x = (vid_conwidth - 320.0)*0.5;
1407 sbar_y = vid_conheight - 24.0 - 16.0;
1410 fade = 3.2 - 2 * (time - weapontime);
1411 fade = bound(0.7, fade, 1);
1414 for(i = 0; i < 8; ++i)
1418 Sbar_DrawWeapon(i+1, fade, (i + 2 == activeweapon));
1425 Sbar_DrawWeapon(0, fade, (activeweapon == 1));
1429 x = getstati(STAT_ARMOR);
1433 //Sbar_DrawStretchPic (72, 0, sb_armor[0], sbar_alpha_fg.value, 24, 24);
1434 drawpic(sbar + '72 0 0', "gfx/sb_armor", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1436 Sbar_DrawXNum('0 0 0', x, 3, 24, '0 1 0', 1, 0);
1438 Sbar_DrawXNum('0 0 0', x, 3, 24, '0.2 1 0', 1, 0);
1440 Sbar_DrawXNum('0 0 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
1442 Sbar_DrawXNum('0 0 0', x, 3, 24, '1 1 0.2', 1, 0);
1444 Sbar_DrawXNum('0 0 0', x, 3, 24, '0.7 0 0', 1, 0);
1448 x = getstati(STAT_HEALTH);
1452 //Sbar_DrawStretchPic (184, 0, sb_health, sbar_alpha_fg.value, 24, 24);
1453 drawpic(sbar + '184 0 0', "gfx/sb_health", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1455 Sbar_DrawXNum('112 0 0', x, 3, 24, '0 1 0', 1, 0);
1457 Sbar_DrawXNum('112 0 0', x, 3, 24, '0.2 1 0', 1, 0);
1459 Sbar_DrawXNum('112 0 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
1461 Sbar_DrawXNum('112 0 0', x, 3, 24, '1 1 0.2', 1, 0);
1463 Sbar_DrawXNum('112 0 0', x, 3, 24, '0.7 0 0', 1, 0);
1467 x = getstati(STAT_AMMO);
1468 if ((stat_items & (NEX_IT_SHELLS | NEX_IT_BULLETS | NEX_IT_ROCKETS | NEX_IT_CELLS)) || x != 0)
1470 if (stat_items & NEX_IT_SHELLS)
1471 drawpic(sbar + '296 0 0', "gfx/sb_shells", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1472 else if (stat_items & NEX_IT_BULLETS)
1473 drawpic(sbar + '296 0 0', "gfx/sb_bullets", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1474 else if (stat_items & NEX_IT_ROCKETS)
1475 drawpic(sbar + '296 0 0', "gfx/sb_rocket", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1476 else if (stat_items & NEX_IT_CELLS)
1477 drawpic(sbar + '296 0 0', "gfx/sb_cells", '24 24 0', '1 1 1', sbar_alpha_fg, 0);
1479 Sbar_DrawXNum('224 0 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
1481 Sbar_DrawXNum('224 0 0', x, 3, 24, '0.7 0 0', 1, 0);
1484 if (sbar_x + 320 + 160 <= vid_conwidth)
1485 Sbar_MiniDeathmatchOverlay(sbar + '320 0 0');
1488 // The margin can be at most 8 to support 640x480 console size:
1489 // 320 + 2 * (144 + 16) = 640
1494 stat_items = getstati(STAT_ITEMS);
1496 sbar_x = (vid_conwidth - 640.0)*0.5;
1497 sbar_y = vid_conheight - 47;
1500 fade = 3 - 2 * (time - weapontime);
1503 for(i = 0; i < 8; ++i)
1507 Sbar_DrawWeapon(i+1, fade, (i + 2 == activeweapon));
1514 Sbar_DrawWeapon(0, fade, (activeweapon == 1));
1518 drawpic(sbar, "gfx/sbar", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1520 drawpic(sbar, "gfx/sbar_minimal", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1524 Sbar_DrawXNum('268 12 0', getstati(STAT_ARMOR), 3, 24, '0.6 0.7 0.8', 1, 0);
1528 x = getstati(STAT_HEALTH);
1530 Sbar_DrawXNum('82 12 0', x, 3, 24, '1 1 1', 1, 0);
1531 else if(x <= 25 && time - floor(time) > 0.5)
1532 Sbar_DrawXNum('82 12 0', x, 3, 24, '0.7 0 0', 1, 0);
1534 Sbar_DrawXNum('81 12 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
1536 // AK dont draw ammo for the laser
1537 x = getstati(STAT_AMMO);
1538 if(activeweapon != 12)
1541 if (stat_items & NEX_IT_SHELLS)
1542 drawpic(sbar + '519 0 0', "gfx/sb_shells", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1543 else if (stat_items & NEX_IT_BULLETS)
1544 drawpic(sbar + '519 0 0', "gfx/sb_bullets", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1545 else if (stat_items & NEX_IT_ROCKETS)
1546 drawpic(sbar + '519 0 0', "gfx/sb_rocket", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1547 else if (stat_items & NEX_IT_CELLS)
1548 drawpic(sbar + '519 0 0', "gfx/sb_cells", '0 0 0', '1 1 1', sbar_alpha_fg, 0);
1550 Sbar_DrawXNum('447 12 0', x, 3, 24, '0.6 0.7 0.8', 1, 0);
1552 Sbar_DrawXNum('447 12 0', x, 3, 24, '0.7 0 0', 1, 0);
1556 drawpic(sbar, "gfx/sbar_overlay", '0 0 0', '1 1 1', 1, DRAWFLAG_MODULATE);
1558 if (sbar_x + 600 + 160 <= vid_conwidth)
1559 Sbar_MiniDeathmatchOverlay (sbar + '600 0 0');
1564 // Mini scoreboard uses 12*4 per other team, that is, 144
1565 // pixels when there are four teams...
1566 // Nexuiz by default sets vid_conwidth to 800... makes
1568 // so we need to shift it by 64 pixels to the right to fit
1569 // BUT: then it overlaps with the image that gets drawn
1570 // for viewsize 100! Therefore, just account for 3 teams,
1571 // that is, 96 pixels mini scoreboard size, needing 16 pixels
1576 if(gametype == GAME_KEYHUNT)
1579 } else if(gametype == GAME_CTF)
1587 void CSQC_ctf_hud(void)
1589 // cvar("sbar_flagstatus_right") move the flag icons right
1590 // cvar("sbar_flagstatus_pos") pixel position of the nexuiz flagstatus icons
1591 float redflag, blueflag;
1595 stat_items = getstati(STAT_ITEMS);
1596 redflag = (stat_items/32768) & 3;
1597 blueflag = (stat_items/131072) & 3;
1601 * For some reason now not even THAT works there...
1602 * Maybe the minus' precedence screws it up? The last one there, maybe I should use brackets
1604 * pos_x = (cvar("sbar_flagstatus_right")) ? vid_conwidth - 10 - sbar_x - 64 : 10 - sbar_x;
1605 ** Should try those later:
1606 * pos_x = (cvar("sbar_flagstatus_right")) ? (vid_conwidth - 10 - sbar_x - 64) : (10 - sbar_x);
1607 * pos_x = ( (cvar("sbar_flagstatus_right")) ? vid_conwidth - 10 - 64 : 10 ) - sbar_x;
1610 if(cvar("sbar_flagstatus_right"))
1611 pos_x = vid_conwidth - 10 - sbar_x - 64;
1613 pos_x = 10 - sbar_x;
1617 if(sbar_hudselector == 1)
1618 pos_y = (vid_conheight - sbar_y) - cvar("sbar_flagstatus_pos") - 64;
1626 case 1: drawpic(pos, "gfx/sb_flag_red_taken", '0 0 0', '1 1 1', 1, DRAWFLAG_NORMAL); break;
1627 case 2: drawpic(pos, "gfx/sb_flag_red_lost", '0 0 0', '1 1 1', 1, DRAWFLAG_NORMAL); break;
1628 case 3: drawpic(pos, "gfx/sb_flag_red_carrying", '0 0 0', '1 1 1', 1, DRAWFLAG_NORMAL); break;
1635 case 1: drawpic(pos, "gfx/sb_flag_blue_taken", '0 0 0', '1 1 1', 1, 0); break;
1636 case 2: drawpic(pos, "gfx/sb_flag_blue_lost", '0 0 0', '1 1 1', 1, 0); break;
1637 case 3: drawpic(pos, "gfx/sb_flag_blue_carrying", '0 0 0', '1 1 1', 1, 0); break;