From: terencehill Date: Fri, 9 Oct 2015 13:37:49 +0000 (+0200) Subject: Better integration of the vehicle HUD in the main HUD: it now fades in/out like other... X-Git-Tag: xonotic-v0.8.2~1799^2~8 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=7f06c49c45b5bdb9ce6ba6fb42cb4e14dff64ea2;p=xonotic%2Fxonotic-data.pk3dir.git Better integration of the vehicle HUD in the main HUD: it now fades in/out like other HUD panels and no longer cover maximized panels --- diff --git a/qcsrc/client/hud.qc b/qcsrc/client/hud.qc index dbae62cbd..76a19a60e 100644 --- a/qcsrc/client/hud.qc +++ b/qcsrc/client/hud.qc @@ -4695,6 +4695,19 @@ Main HUD system ================== */ +void HUD_Vehicle() +{ + if(autocvar__hud_configure) return; + if(intermission == 2) return; + + if(hud == HUD_BUMBLEBEE_GUN) + CSQC_BUMBLE_GUN_HUD(); + else { + Vehicle info = get_vehicleinfo(hud); + info.vr_hud(info); + } +} + bool HUD_Panel_CheckFlags(int showflags) { if ( HUD_Minigame_Showpanels() ) @@ -4709,14 +4722,14 @@ void HUD_Panel_Draw(entity panent) panel.panel_draw(); } -void HUD_Reset (void) +void HUD_Reset(void) { // reset gametype specific icons if(gametype == MAPINFO_TYPE_CTF) HUD_Mod_CTF_Reset(); } -void HUD_Main (void) +void HUD_Main(void) { int i; // global hud theAlpha fade @@ -4845,6 +4858,8 @@ void HUD_Main (void) for(i = hud_panels_COUNT - 1; i >= 0; --i) HUD_Panel_Draw(hud_panels[panel_order[i]]); + HUD_Vehicle(); + hud_draw_maximized = 1; // panels that may be maximized must check this var // draw maximized panels on top if(hud_panel_radar_maximized) diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index f982b59d7..d8f1ed132 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -455,19 +455,6 @@ bool WantEventchase() return false; } -void HUD_Vehicle() -{ - if(!hud || intermission) - return; - - if(hud == HUD_BUMBLEBEE_GUN) - CSQC_BUMBLE_GUN_HUD(); - else { - Vehicle info = get_vehicleinfo(hud); - info.vr_hud(info); - } -} - void HUD_Crosshair_Vehicle() { if(!hud || intermission) @@ -1034,7 +1021,6 @@ void HUD_Draw() Accuracy_LoadLevels(); HUD_Main(); - HUD_Vehicle(); HUD_DrawScoreboard(); if (scoreboard_active || intermission == 2) diff --git a/qcsrc/common/vehicles/cl_vehicles.qc b/qcsrc/common/vehicles/cl_vehicles.qc index 386c2dea8..b24097c03 100644 --- a/qcsrc/common/vehicles/cl_vehicles.qc +++ b/qcsrc/common/vehicles/cl_vehicles.qc @@ -122,14 +122,11 @@ void Vehicles_drawHUD( vector colorAmmo2) { SELFPARAM(); - if(scoreboard_active) - return; - // Initialize vector tmpSize = '0 0 0'; vector tmpPos = '0 0 0'; - float hudAlpha = autocvar_hud_panel_fg_alpha; + float hudAlpha = autocvar_hud_panel_fg_alpha * hud_fade_alpha; float barAlpha = autocvar_hud_progressbar_alpha * hudAlpha; float blinkValue = 0.55 + sin(time * 7) * 0.45; @@ -154,9 +151,9 @@ void Vehicles_drawHUD( vehicleHud_Pos.y = vid_conheight - vehicleHud_Size.y; if(teamplay && autocvar_hud_panel_bg_color_team) - drawpic(vehicleHud_Pos, frame, vehicleHud_Size, myteamcolors * autocvar_hud_panel_bg_color_team, autocvar_hud_panel_bg_alpha, DRAWFLAG_NORMAL); + drawpic(vehicleHud_Pos, frame, vehicleHud_Size, myteamcolors * autocvar_hud_panel_bg_color_team, autocvar_hud_panel_bg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL); else - drawpic(vehicleHud_Pos, frame, vehicleHud_Size, autocvar_hud_panel_bg_color, autocvar_hud_panel_bg_alpha, DRAWFLAG_NORMAL); + drawpic(vehicleHud_Pos, frame, vehicleHud_Size, autocvar_hud_panel_bg_color, autocvar_hud_panel_bg_alpha * hud_fade_alpha, DRAWFLAG_NORMAL); if(!autocvar__vehicles_shownchasemessage && time < vh_notice_time) {