]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Hakk arround lack of vehicle panelhud. now all relevant info is dispalyed in vehicles too
authorJakob MG <jakob_mg@hotmail.com>
Mon, 13 Jun 2011 14:13:54 +0000 (16:13 +0200)
committerJakob MG <jakob_mg@hotmail.com>
Mon, 13 Jun 2011 14:13:54 +0000 (16:13 +0200)
qcsrc/client/View.qc
qcsrc/client/hud.qc
qcsrc/client/main.qh

index 31fee2c95a325d26d6df35d39344dfaa7f0dbe6e..777a192fa15e74b04713e512caec7b7c34bd28f8 100644 (file)
@@ -368,7 +368,6 @@ void CSQC_UpdateView(float w, float h)
        vector v, vo;
        vector vf_size, vf_min;
        float a;
-       float hud;
        hud = getstati(STAT_HUD);
 
        button_attack2 = (input_buttons & BUTTON_3);
@@ -859,18 +858,8 @@ void CSQC_UpdateView(float w, float h)
                sound(world, CHAN_AUTO, "misc/typehit.wav", VOL_BASE, ATTN_NONE);
                nextsound_typehit_time = time + autocvar_cl_hitsound_antispam_time;
        }
-    if(hud && !intermission)
-    {        
-        if(hud == HUD_SPIDERBOT)
-            CSQC_SPIDER_HUD();
-        else if(hud == HUD_WAKIZASHI)
-            CSQC_WAKIZASHI_HUD();
-        else if(hud == HUD_RAPTOR)
-            CSQC_RAPTOR_HUD();
-        else if(hud == HUD_BUMBLEBEE)
-            CSQC_BUMBLE_HUD();
-    }
-       else
+
+       //else
        {
                if(gametype == GAME_FREEZETAG)
                {
@@ -888,7 +877,7 @@ void CSQC_UpdateView(float w, float h)
                                CSQC_common_hud();
 
                // crosshair goes VERY LAST
-               if(!scoreboard_active && !camera_active && intermission != 2 && spectatee_status != -1) {
+               if(!scoreboard_active && !camera_active && intermission != 2 && spectatee_status != -1 && hud == HUD_NORMAL) {
                        string wcross_style;
                        float wcross_alpha, wcross_resolution;
                        wcross_style = autocvar_crosshair;
@@ -1289,7 +1278,18 @@ void CSQC_UpdateView(float w, float h)
 
        if(autocvar__hud_configure)
                HUD_Panel_Mouse();
-
+    
+    if(hud && !intermission)
+    {        
+        if(hud == HUD_SPIDERBOT)
+            CSQC_SPIDER_HUD();
+        else if(hud == HUD_WAKIZASHI)
+            CSQC_WAKIZASHI_HUD();
+        else if(hud == HUD_RAPTOR)
+            CSQC_RAPTOR_HUD();
+        else if(hud == HUD_BUMBLEBEE)
+            CSQC_BUMBLE_HUD();
+    }
        // let's reset the view back to normal for the end
        R_SetView(VF_MIN, '0 0 0');
        R_SetView(VF_SIZE, '1 0 0' * w + '0 1 0' * h);
@@ -1298,62 +1298,51 @@ void CSQC_UpdateView(float w, float h)
 
 void CSQC_common_hud(void)
 {
-       // HUD_SortFrags(); done in HUD_Draw
-       float hud;
-       hud = getstati(STAT_HUD);
-
-    if(intermission)
-        hud = HUD_NORMAL;
-
-       //hud = 10;
-       switch(hud)
-       {
-               case HUD_NORMAL:
-                       // do some accuracy var caching
-                       float i;
-                       if(!(gametype == GAME_RACE || gametype == GAME_CTS))
-                       {
-                               if(autocvar_accuracy_color_levels != acc_color_levels)
-                               {
-                                       if(acc_color_levels)
-                                               strunzone(acc_color_levels);
-                                       acc_color_levels = strzone(autocvar_accuracy_color_levels);
-                                       acc_levels = tokenize(acc_color_levels);
-                                       if (acc_levels > MAX_ACCURACY_LEVELS)
-                                               acc_levels = MAX_ACCURACY_LEVELS;
-
-                                       for (i = 0; i < acc_levels; ++i)
-                                               acc_lev[i] = stof(argv(i)) / 100.0;
-                               }
-                               // let know that acc_col[] needs to be loaded
-                               acc_col_x[0] = -1;
-                       }
-
-                       HUD_Main(); // always run these functions for alpha checks
-                       HUD_DrawScoreboard();
+    // do some accuracy var caching
+    float i;
+    if(!(gametype == GAME_RACE || gametype == GAME_CTS))
+    {
+        if(autocvar_accuracy_color_levels != acc_color_levels)
+        {
+            if(acc_color_levels)
+                strunzone(acc_color_levels);
+            acc_color_levels = strzone(autocvar_accuracy_color_levels);
+            acc_levels = tokenize(acc_color_levels);
+            if (acc_levels > MAX_ACCURACY_LEVELS)
+                acc_levels = MAX_ACCURACY_LEVELS;
+
+            for (i = 0; i < acc_levels; ++i)
+                acc_lev[i] = stof(argv(i)) / 100.0;
+        }
+        // let know that acc_col[] needs to be loaded
+        acc_col_x[0] = -1;
+    }
 
-                       if (scoreboard_active) // scoreboard/accuracy
-                       {
-                               HUD_Reset();
-                               // HUD_DrawScoreboard takes care of centerprint_start
-                       }
-                       else if (intermission == 2) // map voting screen
-                       {
-                               HUD_FinaleOverlay();
-                               HUD_Reset();
+    HUD_Main(); // always run these functions for alpha checks
+    HUD_DrawScoreboard();
 
-                               centerprint_start_x = 0;
-                               centerprint_start_y = autocvar_scr_centerpos * vid_conheight;
-                       }
-                       else // hud
-                       {
-                               centerprint_start_x = 0;
-                               centerprint_start_y = autocvar_scr_centerpos * vid_conheight;
-                       }
+    if (scoreboard_active) // scoreboard/accuracy
+    {
+        HUD_Reset();
+        // HUD_DrawScoreboard takes care of centerprint_start
+    }
+    else if (intermission == 2) // map voting screen
+    {
+        HUD_FinaleOverlay();
+        HUD_Reset();
 
-                       HUD_DrawCenterPrint();
-                       break;
+        centerprint_start_x = 0;
+        centerprint_start_y = autocvar_scr_centerpos * vid_conheight;
+    }
+    else // hud
+    {
+        centerprint_start_x = 0;
+        centerprint_start_y = autocvar_scr_centerpos * vid_conheight;
+    }
 
+       /*
+       switch(hud)
+       {
                case HUD_SPIDERBOT:
                        CSQC_SPIDER_HUD();
                        break;
@@ -1365,8 +1354,11 @@ void CSQC_common_hud(void)
         case HUD_BUMBLEBEE:
             CSQC_BUMBLE_HUD();
             break;
-
        }
+       */
+       
+    HUD_DrawCenterPrint();
+    
 }
 
 
index 7189cbd79230c0735a09b1aeea887d36c3dff2d9..6b11719567d055e4234fd81ddb8344f3ba4316e8 100644 (file)
@@ -614,7 +614,7 @@ void HUD_Weapons(void)
 {
        float f, screen_ar;
        float center_x, center_y;
-
+    if(hud != HUD_NORMAL) return;
        if(!autocvar__hud_configure)
        {
                if(!autocvar_hud_panel_weapons) return;
@@ -1019,6 +1019,7 @@ void DrawAmmoItem(vector myPos, vector mySize, float itemcode, float currently_s
 
 void HUD_Ammo(void)
 {
+    if(hud != HUD_NORMAL) return;
        if(!autocvar__hud_configure)
        {
                if(!autocvar_hud_panel_ammo) return;
@@ -1319,6 +1320,7 @@ void HUD_HealthArmor(void)
        if(!autocvar__hud_configure)
        {
                if(!autocvar_hud_panel_healtharmor) return;
+               if(hud != HUD_NORMAL) return;
                if(spectatee_status == -1) return;
 
                health = getstati(STAT_HEALTH);
index af849e18c57c92dce1d1580b3342962b5b23403d..6788daad18d229f17499c3f7f38b425d839252d5 100644 (file)
@@ -164,3 +164,5 @@ float g_balance_electro_secondary_bouncestop;
 float g_trueaim_minrange;
 
 entity entcs_receiver[255]; // 255 is the engine limit on maxclients
+
+float hud;