seta sbar_stomachboard_status_fade 1 "color fading speed of the stomach board status"\r
seta sbar_stomachboard_highlight_alpha 0.25 "alpha of the stomach board highlight"\r
seta sbar_timer_increment 0 "1 = show elapsed time on the timer"\r
-seta sbar_timer_scale 1 "scale multiplier of the timer"\r
seta sbar_ring1 1 "enables the first HUD ring"\r
seta sbar_ring1_scale 110 "scale of the first HUD ring"\r
seta sbar_ring1_text_scale 12 "scale of the text on the first HUD ring"\r
// Only some HUD components can be customized here at the time.\r
-// Components left to do: Timer, Portrait, Sbar ring, "HUD disabled" warnings, some race timers, some spectator messages,.\r
+// Components left to do: Portrait, Sbar ring, "HUD disabled" warnings, some race timers, some spectator messages,.\r
\r
set hud_panel_status_background_position "0 -0.85 0"\r
set hud_panel_status_background_scale "0.2 0.15 0"\r
\r
+set hud_item_timer_text_position "0.875 0.96 0"\r
+set hud_item_timer_text_scale 16\r
+set hud_item_timer_icon_position "0.975 0.96 0"\r
+set hud_item_timer_icon_scale "0.025 0.035 0"\r
+\r
set hud_item_score_race_primary_text_position "0 0.95 0"\r
set hud_item_score_race_primary_text_scale 30\r
set hud_item_score_race_secondary_text_position "-0.225 0.95 0"\r
topright_x = vid_conwidth;\r
\r
float scale;\r
- scale = cvar_or("sbar_timer_scale", 1);\r
+ scale = 1; // temporary\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
return;\r
\r
- Sbar_DrawRaceStatus((topright_x - 100) * '1 0 0' + '0 30 0' * scale);\r
+ Sbar_DrawRaceStatus('0 20 0');\r
\r
timeleft = max(0, timelimit * 60 + getstatf(STAT_GAMESTARTTIME) - time);\r
timeleft = ceil(timeleft);\r
minutes = floor(elapsedTime / 60);\r
seconds = elapsedTime - minutes*60;\r
}\r
- if (minutes < 10)\r
- bgpos_x = topright_x - (54 + 17 + 12) * scale;\r
- else if (minutes < 100) // nudge the timer background left if more digits are drawn\r
- bgpos_x = topright_x - (62 + 17 + 12) * scale;\r
- else\r
- bgpos_x = topright_x - (70 + 17 + 12) * scale;\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
- if (minutes < 10) // nudge the timer background left if more digits are drawn\r
- bgpos_x = topright_x - (54 + 17 + 12) * scale;\r
- else if (minutes < 100)\r
- bgpos_x = topright_x - (62 + 17 + 12) * scale;\r
- else\r
- bgpos_x = topright_x - (70 + 17 + 12) * scale;\r
+ bgpos_x = topright_x - (70 + 17 + 12) * scale;\r
bgpos_y = 0;\r
bgpos_z = 0;\r
}\r
}\r
}\r
\r
- drawpic(topright - ('19 0 0' + '3 0 0' - '0 2 0'), "gfx/hud/sb_time", '22 22 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL);\r
+ Sbar_DrawPic("gfx/hud/sb_time", stov(cvar_string("hud_item_timer_icon_position")), stov(cvar_string("hud_item_timer_icon_scale")), FALSE);\r
+\r
finaltime = strcat(ftos(minutes), ":");\r
if(seconds < 10)\r
finaltime = strcat(finaltime, "0", 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(pos, finaltime, 18 * scale * '1 1 0', timer_color, sbar_alpha_fg, DRAWFLAG_NORMAL);\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
void Sbar_Ring()\r