]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Separate rings for Nex charge / MineLayer mines and reload. You can now see everythin...
authorMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 12 Mar 2011 22:29:45 +0000 (00:29 +0200)
committerMircea Kitsune <sonichedgehog_hyperblast00@yahoo.com>
Sat, 12 Mar 2011 22:29:45 +0000 (00:29 +0200)
defaultXonotic.cfg
qcsrc/client/View.qc
qcsrc/client/autocvars.qh

index e9e2f026cf4d090b13ed89c618ac5bd1e6529158..a67c877751ec9f322b49db7f94287cc58ee1f6a7 100644 (file)
@@ -188,14 +188,11 @@ seta crosshair_fireball_size 1    "crosshair size when wielding the fireball"
 seta crosshair_color_by_health 0 "if enabled, crosshair color will depend on current health"
 
 // ring around crosshair, used for various purposes (such as indicating bullets left in clip, nex charge)
-seta crosshair_ring 1 "main cvar to enable or disable crosshair rings"
+seta crosshair_ring 1 "main cvar to enable or disable normal crosshair rings"
 seta crosshair_ring_inner 0 "allow inner rings to be drawn too"
-seta crosshair_ring_size 2     "bullet counter ring size for Rifle, velocity ring for Nex"
+seta crosshair_ring_size 2     "ring size"
 seta crosshair_ring_alpha 0.2  "ring alpha"
 
-seta crosshair_ring_sniperrifle 1 "draw a ring showing the ammount of ammo left in the sniperrifle
-seta crosshair_ring_sniperrifle_alpha 0.15
-
 seta crosshair_ring_nex 1 "draw a ring showing the current charge of the nexgun"
 seta crosshair_ring_nex_alpha 0.15
 seta crosshair_ring_nex_inner_alpha 0.15
@@ -208,6 +205,10 @@ seta crosshair_ring_nex_currentcharge_movingavg_rate 0.05
 seta crosshair_ring_minelayer 1
 seta crosshair_ring_minelayer_alpha 0.15
 
+seta crosshair_ring_reload 1 "main cvar to enable or disable ammo crosshair rings"
+seta crosshair_ring_reload_size 2      "reload ring size"
+seta crosshair_ring_reload_alpha 0.2   "reload ring alpha"
+
 seta cl_reticle_stretch 0 "whether to stretch reticles so they fit the screen (brakes image proportions)"
 seta cl_reticle_item_nex 1 "draw aiming reticle for the nex weapon's zoom, 0 disables and values between 0 and 1 change alpha"
 seta cl_reticle_item_normal 1 "draw reticle when zooming with the zoom button, 0 disables and values between 0 and 1 change alpha"
index 40c3b957a12eb65bd33d9616c5c2f489b3cccf0e..34c66ca083ca49afe38c53c6ef748947316f9745 100644 (file)
@@ -1068,31 +1068,23 @@ void CSQC_UpdateView(float w, float h)
                        wcross_alpha *= 1 - autocvar__menu_alpha;
                        wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
 
+                       float ring_value, ring_scale, ring_alpha, ring_inner_value, ring_inner_alpha;
+                       string ring_image, ring_inner_image;
+                       vector ring_rgb, ring_inner_rgb;
+
+                       // normal crosshair ring
                        if (autocvar_crosshair_ring)
                        {
-                               float ring_value, ring_alpha, ring_inner_value, ring_inner_alpha;
-                               string ring_image, ring_inner_image;
-                               vector ring_rgb, ring_inner_rgb;
-                               
-                               float ring_scale = autocvar_crosshair_ring_size;
-                               
+                               ring_scale = autocvar_crosshair_ring_size;
+
                                float nex_charge, nex_chargepool;
                                nex_charge = getstatf(STAT_NEX_CHARGE);
                                nex_chargepool = getstatf(STAT_NEX_CHARGEPOOL);
-                               
+
                                if(nex_charge_movingavg == 0) // this should only happen if we have just loaded up the game
                                        nex_charge_movingavg = nex_charge;
 
-                               weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD);
-                               if (weapon_clipload) // ring around crosshair representing ammo left in weapon clip
-                               {
-                                       weapon_clipsize = getstati(STAT_WEAPON_CLIPSIZE);
-                                       ring_value = bound(0, weapon_clipload / weapon_clipsize, 1);
-                                       ring_alpha = autocvar_crosshair_ring_sniperrifle_alpha;
-                                       ring_image = "gfx/crosshair_ring.tga";
-                                       ring_rgb = wcross_color;
-                               }
-                               else if (activeweapon == WEP_NEX && nex_charge && autocvar_crosshair_ring_nex) // ring around crosshair representing velocity-dependent damage for the nex
+                               if (activeweapon == WEP_NEX && nex_charge && autocvar_crosshair_ring_nex) // ring around crosshair representing velocity-dependent damage for the nex
                                {
                                        if (nex_chargepool || use_nex_chargepool) { 
                                                use_nex_chargepool = 1; 
@@ -1119,14 +1111,31 @@ void CSQC_UpdateView(float w, float h)
                                        ring_image = "gfx/crosshair_ring.tga";
                                        ring_rgb = wcross_color;
                                }
-                               
+
                                if (autocvar_crosshair_ring_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)
                                        DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, ring_image, ring_value, ring_rgb, ring_alpha, DRAWFLAG_ADDITIVE);
                        }
 
+                       // ammo crosshair ring
+                       if(autocvar_crosshair_ring_reload)
+                       {
+                               weapon_clipload = getstati(STAT_WEAPON_CLIPLOAD);
+                               if (weapon_clipload) // ring around crosshair representing ammo left in the weapon clip
+                               {
+                                       weapon_clipsize = getstati(STAT_WEAPON_CLIPSIZE);
+                                       ring_value = bound(0, weapon_clipload / weapon_clipsize, 1);
+                                       ring_scale = autocvar_crosshair_ring_reload_size;
+                                       ring_alpha = autocvar_crosshair_ring_reload_alpha;
+                                       ring_image = "gfx/crosshair_ring.tga";
+                                       ring_rgb = wcross_color;
+
+                                       DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, ring_image, ring_value, ring_rgb, ring_alpha, DRAWFLAG_ADDITIVE);
+                               }
+                       }
+
 #define CROSSHAIR_DO_BLUR(M,sz,wcross_name,wcross_alpha) \
                        do \
                        { \
index 867859c571de307787db1182970cb8a201619f30..5a87249cc318166dab3b2b0652081de7f3dc33de 100644 (file)
@@ -121,8 +121,9 @@ float autocvar_crosshair_ring_nex_inner_color_blue;
 float autocvar_crosshair_ring_nex_inner_color_green;
 float autocvar_crosshair_ring_nex_inner_color_red;
 float autocvar_crosshair_ring_size;
-float autocvar_crosshair_ring_sniperrifle;
-float autocvar_crosshair_ring_sniperrifle_alpha;
+float autocvar_crosshair_ring_reload;
+float autocvar_crosshair_ring_reload_size;
+float autocvar_crosshair_ring_reload_alpha;
 float autocvar_crosshair_size;
 float autocvar_ekg;
 float autocvar_fov;