]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/client/View.qc
Merge remote branch 'origin/fruitiex/csqc_polyblend'
[xonotic/xonotic-data.pk3dir.git] / qcsrc / client / View.qc
index 083eec1b888f2eed85ea643e1672c7ec5999c58b..e417ddbed9d136ba018547a368ca78afa6d57803 100644 (file)
@@ -350,6 +350,7 @@ vector freeze_pmove_org, freeze_input_angles;
 entity nightvision_noise, nightvision_noise2;
 
 float pickup_crosshair_time, pickup_crosshair_size;
+float use_nex_charge_pool;
 
 float myhealth, myhealth_prev;
 float myhealth_flash;
@@ -903,8 +904,9 @@ void CSQC_UpdateView(float w, float h)
 
                        wcross_size = drawgetimagesize(wcross_name) * wcross_scale;
 
-                       float nex_charge;
+                       float nex_charge, nex_charge_pool;
                        nex_charge = getstatf(STAT_NEX_CHARGE);
+                       nex_charge_pool = 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;
@@ -915,21 +917,32 @@ void CSQC_UpdateView(float w, float h)
                                bullets = getstati(STAT_BULLETS_LOADED);
                                f = bound(0, bullets / cr_maxbullets, 1);
 
-                               a = cvar("crosshair_campingrifle_bulletcounter_alpha");
+                               a = cvar("crosshair_ring_campingrifle_alpha");
                                DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", f, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                        }
                        else if (activeweapon == WEP_NEX && nex_charge) // ring around crosshair representing velocity-dependent damage for the nex
                        {
                                vector rgb;
-                               // indicate how much we're charging right now with an inner circle
-                               a = cvar("crosshair_nexvelocity_currentcharge_alpha");
-                               nex_charge_movingavg = (1 - cvar("crosshair_nexvelocity_currentcharge_movingavg_rate")) * nex_charge_movingavg + cvar("crosshair_nexvelocity_currentcharge_movingavg_rate") * nex_charge;
+                               if(nex_charge_pool || use_nex_charge_pool)
+                               {
+                                       use_nex_charge_pool = 1;
+
+                                       a = cvar("crosshair_ring_nex_inner_alpha");
+                                       rgb = eX * cvar("crosshair_ring_nex_inner_color_red") + eY * cvar("crosshair_ring_nex_inner_color_green") + eZ * cvar("crosshair_ring_nex_inner_color_blue");
+                                       DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", nex_charge_pool, rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+                               }
+                               else
+                               {
+                                       // indicate how much we're charging right now with an inner circle
+                                       a = cvar("crosshair_ring_nex_inner_alpha");
+                                       nex_charge_movingavg = (1 - cvar("crosshair_ring_nex_currentcharge_movingavg_rate")) * nex_charge_movingavg + cvar("crosshair_ring_nex_currentcharge_movingavg_rate") * nex_charge;
 
-                               rgb = eX * cvar("crosshair_nexvelocity_currentcharge_color_red") + eY * cvar("crosshair_nexvelocity_currentcharge_color_green") + eZ * cvar("crosshair_nexvelocity_currentcharge_color_blue");
-                               DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", bound(0, cvar("crosshair_nexvelocity_currentcharge_scale") * (nex_charge - nex_charge_movingavg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+                                       rgb = eX * cvar("crosshair_ring_nex_inner_color_red") + eY * cvar("crosshair_ring_nex_inner_color_green") + eZ * cvar("crosshair_ring_nex_inner_color_blue");
+                                       DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring_inner.tga", bound(0, cvar("crosshair_ring_nex_currentcharge_scale") * (nex_charge - nex_charge_movingavg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE);
+                               }
 
                                // draw the charge
-                               a = cvar("crosshair_nexvelocity_alpha");
+                               a = cvar("crosshair_ring_nex_outer_alpha");
                                DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", nex_charge, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE);
                        }