From: Mario Date: Wed, 6 Jul 2016 05:28:12 +0000 (+1000) Subject: Add a mutator hook to grappling hook drawing, to allow customising the hook texture... X-Git-Tag: xonotic-v0.8.2~700^2~93 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=fcab23cde105b3f53c23b48db8ca22febba5f90b;p=xonotic%2Fxonotic-data.pk3dir.git Add a mutator hook to grappling hook drawing, to allow customising the hook texture/colour --- diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index 9a2e8b137..2c55bed1b 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -124,3 +124,14 @@ MUTATOR_HOOKABLE(Weapon_ImpactEffect, EV_Weapon_ImpactEffect); /** argc (also, argv() can be used) */ i(int, MUTATOR_ARGV_0_int) \ /**/ MUTATOR_HOOKABLE(HUD_Command, EV_HUD_Command); + +/** Draw the grapple hook, allows changing hook texture and colour */ +#define EV_DrawGrapplingHook(i, o) \ + /** hook */ i(entity, MUTATOR_ARGV_0_entity) \ + /** texture */ i(string, MUTATOR_ARGV_1_string) \ + /***/ o(string, MUTATOR_ARGV_1_string) \ + /** colour */ i(vector, MUTATOR_ARGV_2_vector) \ + /***/ o(vector, MUTATOR_ARGV_2_vector) \ + /** team */ i(float, MUTATOR_ARGV_3_float) \ + /**/ +MUTATOR_HOOKABLE(DrawGrapplingHook, EV_DrawGrapplingHook); diff --git a/qcsrc/common/weapons/weapon/hook.qc b/qcsrc/common/weapons/weapon/hook.qc index 553e7e280..f46e592e2 100644 --- a/qcsrc/common/weapons/weapon/hook.qc +++ b/qcsrc/common/weapons/weapon/hook.qc @@ -441,6 +441,10 @@ void Draw_GrapplingHook(entity this) break; } + MUTATOR_CALLHOOK(DrawGrapplingHook, this, tex, rgb, t); + tex = M_ARGV(1, string); + rgb = M_ARGV(2, vector); + Draw_GrapplingHook_trace_callback_tex = tex; Draw_GrapplingHook_trace_callback_rnd = offset; Draw_GrapplingHook_trace_callback_rgb = rgb;