3 #include <common/mutators/base.qh>
12 * Called when a client command is parsed
13 * NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return false;
14 * NOTE: return true if you handled the command, return false to continue handling
15 * NOTE: THESE HOOKS MUST NEVER EVER CALL tokenize()
17 * MUTATOR_HOOKFUNCTION(foo, CSQC_ConsoleCommand) {
18 * if (MUTATOR_RETURNVALUE) return false; // command was already handled
19 * if (cmd_name == "echocvar" && cmd_argc >= 2) {
20 * print(cvar_string(argv(1)), "\n");
23 * if (cmd_name == "echostring" && cmd_argc >= 2) {
24 * print(substring(cmd_string, argv_start_index(1), argv_end_index(-1) - argv_start_index(1)), "\n");
30 #define EV_CSQC_ConsoleCommand(i, o) \
31 /** command name */ i(string, cmd_name) \
32 /** also, argv() can be used */ i(int, cmd_argc) \
33 /** whole command, use only if you really have to */ i(string, cmd_string) \
35 MUTATOR_HOOKABLE(CSQC_ConsoleCommand, EV_CSQC_ConsoleCommand);
37 /* Called when the crosshair is being updated */
38 MUTATOR_HOOKABLE(UpdateCrosshair, EV_NO_ARGS);
40 /** Called when a projectile is linked with CSQC */
41 #define EV_Ent_Projectile(i, o) \
42 /** entity id */ i(entity, __self) \
44 MUTATOR_HOOKABLE(Ent_Projectile, EV_Ent_Projectile);
46 /** Called when a projectile's properties are being modified */
47 #define EV_EditProjectile(i, o) \
48 /** entity id */ i(entity, __self) \
50 MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile);
52 /* Called when projectiles are precached */
53 MUTATOR_HOOKABLE(PrecacheProjectiles, EV_NO_ARGS);
55 /** Called when updating the attached tags index */
56 #define EV_TagIndex_Update(i, o) \
57 /** entity id */ i(entity, __self) \
59 MUTATOR_HOOKABLE(TagIndex_Update, EV_TagIndex_Update);
61 /** Called when setting the attached tags */
62 #define EV_TagIndex_Apply(i, o) \
63 /** entity id */ i(entity, __self) \
65 MUTATOR_HOOKABLE(TagIndex_Apply, EV_TagIndex_Apply);
67 /** Called when setting up skeleton bones */
68 #define EV_Skeleton_CheckBones(i, o) \
69 /** entity id */ i(entity, __self) \
71 MUTATOR_HOOKABLE(Skeleton_CheckBones, EV_Skeleton_CheckBones);
73 /** Called when setting up bones from the loaded model */
74 #define EV_Skeleton_CheckModel(i, o) \
75 /** entity id */ i(entity, __self) \
77 MUTATOR_HOOKABLE(Skeleton_CheckModel, EV_Skeleton_CheckModel);
79 /** Called when clearing the global parameters for a model */
80 MUTATOR_HOOKABLE(ClearModelParams, EV_NO_ARGS);
82 /** Called when getting the global parameters for a model */
83 #define EV_GetModelParams(i, o) \
84 /** entity id */ i(string, checkmodel_input) \
85 /** entity id */ i(string, checkmodel_command) \
87 string checkmodel_input, checkmodel_command;
88 MUTATOR_HOOKABLE(GetModelParams, EV_GetModelParams);
90 /** Called checking if 3rd person mode should be forced on */
91 #define EV_WantEventchase(i, o) \
92 /** entity id */ i(entity, __self) \
94 MUTATOR_HOOKABLE(WantEventchase, EV_WantEventchase);
96 #define EV_AnnouncerOption(i, o) \
97 /**/ i(string, ret_string) \
98 /**/ o(string, ret_string) \
100 MUTATOR_HOOKABLE(AnnouncerOption, EV_AnnouncerOption);
102 MUTATOR_HOOKABLE(Ent_Init, EV_NO_ARGS);
104 #define EV_HUD_Draw_overlay(i, o) \
105 /**/ o(vector, MUTATOR_ARGV_0_vector) \
106 /**/ o(float, MUTATOR_ARGV_1_float) \
108 MUTATOR_HOOKABLE(HUD_Draw_overlay, EV_HUD_Draw_overlay);
110 MUTATOR_HOOKABLE(HUD_Powerups_add, EV_NO_ARGS);
112 /** Return true to not draw any vortex beam */
113 #define EV_Particles_VortexBeam(i, o) \
114 /**/ i(vector, vbeam_shotorg) \
115 /**/ i(vector, vbeam_endpos) \
117 vector vbeam_shotorg;
119 MUTATOR_HOOKABLE(Particles_VortexBeam, EV_Particles_VortexBeam);
121 /** Return true to not draw any impact effect */
122 #define EV_Weapon_ImpactEffect(i, o) \
123 /**/ i(entity, w_hitwep) \
126 MUTATOR_HOOKABLE(Weapon_ImpactEffect, EV_Weapon_ImpactEffect);
128 /* NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return false;
130 #define EV_HUD_Command(i, o) \
131 /** also, argv() can be used */ i(int, cmd_argc) \
133 MUTATOR_HOOKABLE(HUD_Command, EV_HUD_Command);