void PostInit(void);
void CSQC_Demo_Camera();
-float HUD_WouldDrawScoreboard ();
+float HUD_WouldDrawScoreboard();
float view_set;
float camera_mode;
float reticle_type;
}
// Draw the Crosshair
- float scoreboard_active;
- scoreboard_active = HUD_WouldDrawScoreboard();
R_SetView(VF_DRAWCROSSHAIR, 0); //Make sure engine crosshairs are always hidden
// Draw the Engine Status Bar (the default Quake HUD)
self.draw2d();
self = e;
+ scoreboard_active = HUD_WouldDrawScoreboard();
+
float hud;
hud = getstati(STAT_HUD);
if(hud == HUD_SPIDERBOT)
- {
CSQC_SPIDER_HUD();
- }
else if(hud == HUD_WAKIZASHI)
CSQC_WAKIZASHI_HUD();
else if(hud == HUD_RAPTOR)
HUD_Main(); // always run these functions for alpha checks
HUD_DrawScoreboard();
- if (scoreboard_showscores || scoreboard_showscores_force || getstati(STAT_HEALTH) <= 0 || intermission == 1) // scoreboard/accuracy
+ if (scoreboard_active) // scoreboard/accuracy
{
HUD_Reset();
// HUD_DrawScoreboard takes care of centerprint_start
return 1;
else if (intermission == 1)
return 1;
- else if (intermission == 2 && scoreboard_showscores)
- return 1;
else if (getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard"))
return 1;
- else if(scoreboard_showscores_force)
+ else if (scoreboard_showscores_force)
return 1;
return 0;
}
float hud_woulddrawscoreboard_change; // "time" at which HUD_WouldDrawScoreboard() changed
void HUD_DrawScoreboard()
{
- HUD_UpdatePlayerTeams();
-
float hud_woulddrawscoreboard;
- hud_woulddrawscoreboard = HUD_WouldDrawScoreboard();
+ hud_woulddrawscoreboard = scoreboard_active;
if(hud_woulddrawscoreboard != hud_woulddrawscoreboard_prev) {
hud_woulddrawscoreboard_change = time;
hud_woulddrawscoreboard_prev = hud_woulddrawscoreboard;
}
- float scoreboard_fadeinspeed = cvar_or("scoreboard_fadeinspeed", 10);
- float scoreboard_fadeoutspeed = cvar_or("scoreboard_fadeoutspeed", 5);
if(hud_woulddrawscoreboard) {
+ float scoreboard_fadeinspeed = cvar_or("scoreboard_fadeinspeed", 10);
if (scoreboard_fadeinspeed)
scoreboard_fade_alpha = bound (0, (time - hud_woulddrawscoreboard_change) * scoreboard_fadeinspeed, 1);
else
scoreboard_fade_alpha = 1;
}
- else
+ else {
+ float scoreboard_fadeoutspeed = cvar_or("scoreboard_fadeoutspeed", 5);
if (scoreboard_fadeoutspeed)
scoreboard_fade_alpha = bound (0, (1/scoreboard_fadeoutspeed - (time - hud_woulddrawscoreboard_change)) * scoreboard_fadeoutspeed, 1);
else
scoreboard_fade_alpha = 0;
+ }
if not(scoreboard_fade_alpha)
return;
+ HUD_UpdatePlayerTeams();
+
scoreboard_alpha_bg = cvar("scoreboard_alpha_bg") * scoreboard_fade_alpha * (1 - cvar("_menu_alpha"));
scoreboard_alpha_fg = cvar_or("scoreboard_alpha_fg", 1.0) * scoreboard_fade_alpha * (1 - cvar("_menu_alpha"));
scoreboard_highlight = cvar("scoreboard_highlight");