]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Better integration of the vehicle HUD in the main HUD: it now fades in/out like other...
authorterencehill <piuntn@gmail.com>
Fri, 9 Oct 2015 13:37:49 +0000 (15:37 +0200)
committerterencehill <piuntn@gmail.com>
Fri, 9 Oct 2015 13:37:49 +0000 (15:37 +0200)
qcsrc/client/hud.qc
qcsrc/client/view.qc
qcsrc/common/vehicles/cl_vehicles.qc

index dbae62cbdef08c40cde94676b407e014673e5169..76a19a60e137c8f9ec3c0f75c8b32afd2ac61ff8 100644 (file)
@@ -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)
index f982b59d7d66fc890845981290ce89aef0353e99..d8f1ed1328c2344b9e39c6aff089c21c4991fa10 100644 (file)
@@ -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)
index 386c2dea833fe10852a80bf35a3814b85f512d76..b24097c03303a11f7fa30168c155c4214b8a6999 100644 (file)
@@ -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)
        {