From 8c063f818722ca59c769aa742647d729f6a61da3 Mon Sep 17 00:00:00 2001 From: terencehill Date: Sat, 13 Nov 2010 00:07:56 +0100 Subject: [PATCH] When observing show the HUD instead of the scoreboard and show only useful panels The score panel needs to be fixed though --- qcsrc/client/hud.qc | 50 ++++++++++++++++++++++++-------------- qcsrc/client/scoreboard.qc | 2 +- 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index 3ec71fa1a..71ef6f5f8 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -1501,8 +1501,11 @@ void HUD_Weapons(void) float f, screen_ar; float center_x, center_y; - if(!autocvar_hud_panel_weapons && !autocvar__hud_configure) - return; + if(!autocvar__hud_configure) + { + if(!autocvar_hud_panel_weapons) return; + if(spectatee_status == -1) return; + } float timeout = cvar("hud_panel_weapons_timeout"); float timeout_effect_length, timein_effect_length; @@ -1920,8 +1923,11 @@ void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_s void HUD_Ammo(void) { - if(!autocvar_hud_panel_ammo && !autocvar__hud_configure) - return; + if(!autocvar__hud_configure) + { + if(!autocvar_hud_panel_ammo) return; + if(spectatee_status == -1) return; + } active_panel = HUD_PANEL_AMMO; HUD_Panel_UpdateCvars(ammo); @@ -2069,16 +2075,12 @@ void DrawNumIcon_expanding(float iconalign, vector myPos, vector mySize, float x // Powerups (#2) // void HUD_Powerups(void) { - if(!autocvar_hud_panel_powerups && !autocvar__hud_configure) - return; - if(!autocvar__hud_configure) { - if not(getstati(STAT_ITEMS) & (IT_STRENGTH | IT_INVINCIBLE)) - return; - - if (getstati(STAT_HEALTH) <= 0) - return; + if(!autocvar_hud_panel_powerups) return; + if(spectatee_status == -1) return; + if not(getstati(STAT_ITEMS) & (IT_STRENGTH | IT_INVINCIBLE)) return; + if (getstati(STAT_HEALTH) <= 0) return; } active_panel = HUD_PANEL_POWERUPS; @@ -2293,8 +2295,11 @@ void HUD_Powerups(void) { // void HUD_HealthArmor(void) { - if(!autocvar_hud_panel_healtharmor && !autocvar__hud_configure) - return; + if(!autocvar__hud_configure) + { + if(!autocvar_hud_panel_healtharmor) return; + if(spectatee_status == -1) return; + } active_panel = HUD_PANEL_HEALTHARMOR; HUD_Panel_UpdateCvars(healtharmor); @@ -3573,8 +3578,13 @@ void HUD_Radar(void) // void HUD_Score(void) { - if(!autocvar_hud_panel_score && !autocvar__hud_configure) - return; + if(!autocvar__hud_configure) + { + if(!autocvar_hud_panel_score) return; + // FIXME when observing show correctly scores for every game mode + // and remove this check + if(spectatee_status == -1) return; + } active_panel = HUD_PANEL_SCORE; HUD_Panel_UpdateCvars(score); @@ -3703,8 +3713,12 @@ void HUD_Score(void) // Race timer (#8) // void HUD_RaceTimer (void) { - if(!autocvar_hud_panel_racetimer && !(gametype == GAME_RACE || gametype == GAME_CTS) && !autocvar__hud_configure) - return; + if(!autocvar__hud_configure) + { + if(!autocvar_hud_panel_racetimer) return; + if(!(gametype == GAME_RACE || gametype == GAME_CTS)) return; + if(spectatee_status == -1) return; + } active_panel = HUD_PANEL_RACETIMER; HUD_Panel_UpdateCvars(racetimer); diff --git a/qcsrc/client/scoreboard.qc b/qcsrc/client/scoreboard.qc index ec17dfca7..d76838fd2 100644 --- a/qcsrc/client/scoreboard.qc +++ b/qcsrc/client/scoreboard.qc @@ -883,7 +883,7 @@ float HUD_WouldDrawScoreboard() { return 1; else if (intermission == 1) return 1; - else if (getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard")) + else if (spectatee_status != -1 && getstati(STAT_HEALTH) <= 0 && cvar("cl_deathscoreboard")) return 1; else if (scoreboard_showscores_force) return 1; -- 2.39.2