From 76391ac91fb339d2f39c30869b209c3cff11b5b5 Mon Sep 17 00:00:00 2001 From: FruitieX Date: Fri, 5 Nov 2010 12:40:31 +0200 Subject: [PATCH] some initial code for displaying how fast the nex charges --- defaultXonotic.cfg | 6 ++++++ gfx/crosshair_ring_inner.tga | Bin 0 -> 5304 bytes qcsrc/client/View.qc | 11 +++++++++++ 3 files changed, 17 insertions(+) create mode 100644 gfx/crosshair_ring_inner.tga diff --git a/defaultXonotic.cfg b/defaultXonotic.cfg index b340e5ddec..636d472556 100644 --- a/defaultXonotic.cfg +++ b/defaultXonotic.cfg @@ -218,6 +218,12 @@ seta crosshair_fireball_size 1 "crosshair size when wielding the fireball" seta crosshair_ring_size 2 "bullet counter ring size for Rifle, velocity ring for Nex" seta crosshair_campingrifle_bulletcounter_alpha 0.15 seta crosshair_nexvelocity_alpha 0.15 +seta crosshair_nexvelocity_scale 30 +seta crosshair_nexvelocity_currentcharge_rate 0.05 +seta crosshair_nexvelocity_currentcharge_alpha 0.15 +seta crosshair_nexvelocity_currentcharge_color_red 0.8 +seta crosshair_nexvelocity_currentcharge_color_green 0 +seta crosshair_nexvelocity_currentcharge_color_blue 0 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 recticle for the nex weapon's zoom, 0 disables and values between 0 and 1 change alpha" seta cl_reticle_item_normal 1 "draw recticle when zooming with the zoom button, 0 disables and values between 0 and 1 change alpha" diff --git a/gfx/crosshair_ring_inner.tga b/gfx/crosshair_ring_inner.tga new file mode 100644 index 0000000000000000000000000000000000000000..3d1a570b4e527081ab391ef8c0bf95580187de77 GIT binary patch literal 5304 zcmb`L&ue2<6vtzoMRXCAEF`N4l0_G~a8Wm*yIKMg!C$ls140*%S#%?0Az6(0qv}jj zJ9RXf8RL{zs+3G|$}or)DIyac9>ee$1R>xbV8n$TMy8!N=X>J$USG*;Uy6Zq^WHh1 zbMCqK-FM%;HiD@A#RUZT!C*o48x4bq=+Zd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qc index 074a3be5ee..510384c1d4 100644 --- a/qcsrc/client/View.qc +++ b/qcsrc/client/View.qc @@ -350,6 +350,7 @@ vector freeze_pmove_org, freeze_input_angles; entity nightvision_noise, nightvision_noise2; float pickup_crosshair_time, pickup_crosshair_size; +float nex_charge_change, nex_charge_current_avg; void CSQC_UpdateView(float w, float h) { @@ -869,6 +870,16 @@ void CSQC_UpdateView(float w, float h) } 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_change = (1 - cvar("crosshair_nexvelocity_currentcharge_rate")) * nex_charge_change + cvar("crosshair_nexvelocity_currentcharge_rate") * nex_charge; + nex_charge_current_avg = cvar("crosshair_nexvelocity_currentcharge_rate") * nex_charge_current_avg + (1 - cvar("crosshair_nexvelocity_currentcharge_rate")) * nex_charge_change; + + 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_scale") * (nex_charge - nex_charge_current_avg), 1), rgb, wcross_alpha * a, DRAWFLAG_ADDITIVE); + + // draw the charge a = cvar("crosshair_nexvelocity_alpha"); DrawCircleClippedPic(wcross_origin, wcross_size_x * ring_scale, "gfx/crosshair_ring.tga", nex_charge, wcross_color, wcross_alpha * a, DRAWFLAG_ADDITIVE); } -- 2.39.2