]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a mutator hook to grappling hook drawing, to allow customising the hook texture...
authorMario <mario@smbclan.net>
Wed, 6 Jul 2016 05:28:12 +0000 (15:28 +1000)
committerMario <mario@smbclan.net>
Wed, 6 Jul 2016 05:28:12 +0000 (15:28 +1000)
qcsrc/client/mutators/events.qh
qcsrc/common/weapons/weapon/hook.qc

index 9a2e8b1373be23d9d79db6e53fe9326384beb8b3..2c55bed1b2d5f26f887ae80e1b96a772ad1f2af3 100644 (file)
@@ -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);
index 553e7e280f80330a052d0e59b2f649963cd5a72c..f46e592e293b3f283e3d5140b34a3574a5afcc63 100644 (file)
@@ -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;