]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/View.qc
Merge branch 'master' into terencehill/newpanelhud
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / View.qc
index edfdb14298ebc131e102a1fcfcad27dbba9df10e..6850790b67794133e6c759701deec5fe886393c8 100644 (file)
@@ -556,10 +556,6 @@ void CSQC_UpdateView(float w, float h)
        // Draw the Engine Status Bar (the default Quake HUD)
        R_SetView(VF_DRAWENGINEHUD, 0);
 
-       // fetch this one only once per frame
-       hud_showbinds = autocvar_hud_showbinds;
-       hud_showbinds_limit = autocvar_hud_showbinds_limit;
-
        // Update the mouse position
        /*
           mousepos_x = vid_conwidth;
@@ -1067,7 +1063,7 @@ void CSQC_UpdateView(float w, float h)
                        wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
 
                        // crosshair rings for weapon stats
-                       if (autocvar_crosshair_ring)
+                       if ((autocvar_crosshair_ring) || (autocvar_crosshair_ring_reload))
                        {
                                // declarations and stats
                                float ring_value, ring_scale, ring_alpha, ring_inner_value, ring_inner_alpha;
@@ -1100,9 +1096,9 @@ void CSQC_UpdateView(float w, float h)
                                        }
                                                
                                        ring_inner_alpha = wcross_alpha * autocvar_crosshair_ring_nex_inner_alpha;
-                                       ring_inner_image = "gfx/crosshair_ring_inner.tga";
                                        ring_inner_rgb = eX * autocvar_crosshair_ring_nex_inner_color_red + eY * autocvar_crosshair_ring_nex_inner_color_green + eZ * autocvar_crosshair_ring_nex_inner_color_blue;
-
+                                       ring_inner_image = "gfx/crosshair_ring_inner.tga";
+                                       
                                        // draw the outer ring to show the current charge of the weapon
                                        ring_value = nex_charge;
                                        ring_alpha = wcross_alpha * autocvar_crosshair_ring_nex_alpha;
@@ -1119,20 +1115,32 @@ void CSQC_UpdateView(float w, float h)
 
                                if(autocvar_crosshair_ring_reload && weapon_clipsize) // forces there to be only an ammo ring 
                                {
-                                       ring_value = bound(0, weapon_clipload / weapon_clipsize, 1);
-                                       ring_scale = autocvar_crosshair_ring_reload_size;
-                                       ring_alpha = autocvar_crosshair_ring_reload_alpha;
-                                       ring_rgb = wcross_color;
-                                       
-                                       // Note: This is to stop Taoki from complaining that the image doesn't match all potential balances.
-                                       // if a new image for another weapon is added, add the code (and its respective file/value) here
-                                       if ((activeweapon == WEP_SNIPERRIFLE) && (weapon_clipsize == 8))
-                                               ring_image = "gfx/crosshair_ring_sniperrifle.tga";
+                                       // if the main ring is already used by another weapon, instead use the inner one for ammo.
+                                       // inner ring is secondary anyway and doesn't matter as much as main ring, so overriding it is no issue.
+                                       if(ring_value && autocvar_crosshair_ring_reload_inner)
+                                       {
+                                               ring_inner_value = bound(0, weapon_clipload / weapon_clipsize, 1);
+                                               ring_inner_alpha = autocvar_crosshair_ring_reload_alpha;
+                                               ring_inner_rgb = wcross_color;
+                                               ring_inner_image = "gfx/crosshair_ring_inner.tga";
+                                       }
                                        else
-                                               ring_image = "gfx/crosshair_ring.tga";
+                                       {
+                                               ring_value = bound(0, weapon_clipload / weapon_clipsize, 1);
+                                               ring_scale = autocvar_crosshair_ring_reload_size;
+                                               ring_alpha = autocvar_crosshair_ring_reload_alpha;
+                                               ring_rgb = wcross_color;
+                                       
+                                               // Note: This is to stop Taoki from complaining that the image doesn't match all potential balances.
+                                               // if a new image for another weapon is added, add the code (and its respective file/value) here
+                                               if ((activeweapon == WEP_SNIPERRIFLE) && (weapon_clipsize == 80))
+                                                       ring_image = "gfx/crosshair_ring_sniperrifle.tga";
+                                               else
+                                                       ring_image = "gfx/crosshair_ring.tga";
+                                       }
                                }
 
-                               if (autocvar_crosshair_ring_inner && ring_inner_value) // lets draw a ring inside a ring so you can ring while you ring
+                               if ((autocvar_crosshair_ring_inner || autocvar_crosshair_ring_reload_inner) && ring_inner_value) // lets draw a ring inside a ring so you can ring while you ring
                                        DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, ring_inner_image, ring_inner_value, ring_inner_rgb, ring_inner_alpha, DRAWFLAG_ADDITIVE);
 
                                if (ring_value)
@@ -1243,6 +1251,8 @@ void CSQC_UpdateView(float w, float h)
                cvar_set("vid_conheight", h0);
        }
 
+       prev_spectatee_status = spectatee_status;
+
        if(autocvar__hud_configure)
                HUD_Panel_Mouse();