void Sbar_Score()\r
{\r
float score, distribution, leader;\r
- vector score_pos, secondary_score_pos, race_score_pos, distribution_color;\r
+ vector distribution_color;\r
string racetime, secondary_racetime;\r
entity tm, pl, me;\r
me = (spectatee_status > 0) ? playerslots[spectatee_status - 1] : playerslots[player_localentnum - 1];\r
\r
- vector top;\r
- top_x = vid_conwidth / 2;\r
- top_y = 0;\r
- top_z = 0;\r
-\r
if(gametype == GAME_RPG)\r
return;\r
\r
- score_pos = top + '-80 8 0';\r
- secondary_score_pos = score_pos + '80 -6 0';\r
-\r
if((scores_flags[ps_primary] & SFL_TIME) && !teamplay) { // race/cts record display on HUD\r
pl = players.sort_next;\r
if(pl == me)\r
}\r
\r
racetime = strcat(s_racemin, " : ", s_racesec, " . ", s_racemsec);\r
- race_score_pos = top + '0 0 0';\r
- race_score_pos -= '1 0 0' * stringwidth(racetime, FALSE, '30 30 0') * 0.5;\r
Sbar_DrawString(racetime, stov(cvar_string("hud_item_score_race_primary_text_position")), cvar("hud_item_score_race_primary_text_scale"));\r
\r
} else if (!teamplay) { // non-teamgames, except race/cts\r
void Sbar_Timer()\r
{\r
float timelimit, elapsedTime, minutes, seconds, timeleft, minutesLeft, secondsLeft;\r
- vector pos, bgpos, timer_color;\r
+ vector timer_color;\r
string finaltime;\r
- bgpos = '0 0 0';\r
- \r
- vector topright;\r
- topright = '0 0 0';\r
- topright_x = vid_conwidth;\r
- \r
- float scale;\r
- scale = 1; // temporary\r
+\r
timelimit = getstatf(STAT_TIMELIMIT);\r
\r
if(gametype == GAME_RPG && !timelimit) // don't draw the timer in rpg if there's no time limit\r
minutes = floor(elapsedTime / 60);\r
seconds = elapsedTime - minutes*60;\r
}\r
- bgpos_x = topright_x - (70 + 17 + 12) * scale;\r
- bgpos_y = 0;\r
- bgpos_z = 0;\r
} else {\r
minutes = minutesLeft;\r
seconds = secondsLeft;\r
- bgpos_x = topright_x - (70 + 17 + 12) * scale;\r
- bgpos_y = 0;\r
- bgpos_z = 0;\r
}\r
\r
if (cvar("viewsize") <= 100 && sbar_hudselector) { // draw timer background when viewsize <= 100\r
if (teamplay)\r
- drawpic(bgpos, "gfx/hud/bg_timer", '120 30 0' * scale, GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // timer bg color = myteam color\r
+ drawpic('1 0 0' * (vid_conwidth - (70 + 17 + 12)), "gfx/hud/bg_timer", '120 30 0', GetTeamRGB(myteam) * sbar_color_bg_team, sbar_alpha_bg, DRAWFLAG_NORMAL); // timer bg color = myteam color\r
else {\r
color = stov(cvar_string("sbar_color_bg"));\r
\r
- drawpic(bgpos, "gfx/hud/bg_timer", '120 30 0' * scale, color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
+ drawpic('1 0 0' * (vid_conwidth - (70 + 17 + 12)), "gfx/hud/bg_timer", '120 30 0', color, sbar_alpha_bg, DRAWFLAG_NORMAL);\r
}\r
}\r
\r
else\r
finaltime = strcat(finaltime, ftos(seconds));\r
\r
- pos = topright - ('24 -2 0' + '3 0 0' - '0 2 0');\r
- pos -= '1 0 0' * stringwidth(finaltime, FALSE, 18 * scale * '1 1 0');\r
drawstring(Sbar_ConvertToScreen_TextPosition(finaltime, stov(cvar_string("hud_item_timer_text_position")), cvar("hud_item_timer_text_scale")), finaltime, '1 1 0' * cvar("hud_item_timer_text_scale"), timer_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\r
}\r
\r