Xonotic
events.qh
Go to the documentation of this file.
1 #pragma once
2 
4 
5 // register all possible hooks here
6 
7 // to use a hook, first register your mutator using REGISTER_MUTATOR
8 // then create your function using MUTATOR_HOOKFUNCTION
9 
31 #define EV_CSQC_ConsoleCommand(i, o) \
32  i(string, MUTATOR_ARGV_0_string) \
33  i(int, MUTATOR_ARGV_1_int) \
34  i(string, MUTATOR_ARGV_2_string) \
35 
37 
38 /* Called when the crosshair is being updated */
39 MUTATOR_HOOKABLE(UpdateCrosshair, EV_NO_ARGS);
40 
42 #define EV_Ent_Projectile(i, o) \
43  i(entity, MUTATOR_ARGV_0_entity) \
44 
45 MUTATOR_HOOKABLE(Ent_Projectile, EV_Ent_Projectile);
46 
48 #define EV_EditProjectile(i, o) \
49  i(entity, MUTATOR_ARGV_0_entity) \
50 
51 MUTATOR_HOOKABLE(EditProjectile, EV_EditProjectile);
52 
53 /* Called when projectiles are precached */
54 MUTATOR_HOOKABLE(PrecacheProjectiles, EV_NO_ARGS);
55 
57 #define EV_TagIndex_Update(i, o) \
58  i(entity, MUTATOR_ARGV_0_entity) \
59 
60 MUTATOR_HOOKABLE(TagIndex_Update, EV_TagIndex_Update);
61 
63 #define EV_TagIndex_Apply(i, o) \
64  i(entity, MUTATOR_ARGV_0_entity) \
65 
66 MUTATOR_HOOKABLE(TagIndex_Apply, EV_TagIndex_Apply);
67 
69 #define EV_Skeleton_CheckBones(i, o) \
70  i(entity, MUTATOR_ARGV_0_entity) \
71 
72 MUTATOR_HOOKABLE(Skeleton_CheckBones, EV_Skeleton_CheckBones);
73 
75 #define EV_Skeleton_CheckModel(i, o) \
76  i(entity, MUTATOR_ARGV_0_entity) \
77 
78 MUTATOR_HOOKABLE(Skeleton_CheckModel, EV_Skeleton_CheckModel);
79 
81 MUTATOR_HOOKABLE(ClearModelParams, EV_NO_ARGS);
82 
84 #define EV_GetModelParams(i, o) \
85  i(string, MUTATOR_ARGV_0_string) \
86  i(string, MUTATOR_ARGV_1_string) \
87 
88 MUTATOR_HOOKABLE(GetModelParams, EV_GetModelParams);
89 
91 #define EV_WantEventchase(i, o) \
92  i(entity, MUTATOR_ARGV_0_entity) \
93 
95 
97 #define EV_CustomizeEventchase(i, o) \
98  i(entity, MUTATOR_ARGV_0_entity) \
99  /* current_view_origin_override */ o(vector, MUTATOR_ARGV_0_vector) \
100  /* view_offset_override */ o(vector, MUTATOR_ARGV_1_vector) \
101  /* chase_distance_override */ o(float, MUTATOR_ARGV_0_float) \
102 
103 MUTATOR_HOOKABLE(CustomizeEventchase, EV_CustomizeEventchase);
104 
105 #define EV_AnnouncerOption(i, o) \
106  i(string, MUTATOR_ARGV_0_string) \
107  o(string, MUTATOR_ARGV_0_string) \
108 
110 
111 MUTATOR_HOOKABLE(Ent_Init, EV_NO_ARGS);
112 
113 #define EV_HUD_Draw_overlay(i, o) \
114  o(vector, MUTATOR_ARGV_0_vector) \
115  o(float, MUTATOR_ARGV_1_float) \
116 
117 MUTATOR_HOOKABLE(HUD_Draw_overlay, EV_HUD_Draw_overlay);
118 
119 MUTATOR_HOOKABLE(HUD_Powerups_add, EV_NO_ARGS);
120 
122 MUTATOR_HOOKABLE(HUD_Physics_showoptional, EV_NO_ARGS);
123 
125 MUTATOR_HOOKABLE(HUD_StrafeHUD_showoptional, EV_NO_ARGS);
126 
128 MUTATOR_HOOKABLE(HUD_Score_show, EV_NO_ARGS);
129 
131 #define EV_Particles_VortexBeam(i, o) \
132  i(vector, MUTATOR_ARGV_0_vector) \
133  i(vector, MUTATOR_ARGV_1_vector) \
134 
135 MUTATOR_HOOKABLE(Particles_VortexBeam, EV_Particles_VortexBeam);
136 
138 #define EV_Weapon_ImpactEffect(i, o) \
139  i(entity, MUTATOR_ARGV_0_entity) \
140  i(entity, MUTATOR_ARGV_1_entity) \
141 
142 MUTATOR_HOOKABLE(Weapon_ImpactEffect, EV_Weapon_ImpactEffect);
143 
144 /* NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return false;
145 */
146 #define EV_HUD_Command(i, o) \
147  i(int, MUTATOR_ARGV_0_int) \
148 
149 MUTATOR_HOOKABLE(HUD_Command, EV_HUD_Command);
150 
152 #define EV_DrawGrapplingHook(i, o) \
153  i(entity, MUTATOR_ARGV_0_entity) \
154  i(string, MUTATOR_ARGV_1_string) \
155  /***/ o(string, MUTATOR_ARGV_1_string) \
156  i(vector, MUTATOR_ARGV_2_vector) \
157  /***/ o(vector, MUTATOR_ARGV_2_vector) \
158  i(float, MUTATOR_ARGV_3_float) \
159 
160 MUTATOR_HOOKABLE(DrawGrapplingHook, EV_DrawGrapplingHook);
161 
163 #define EV_Ent_Update(i, o) \
164  i(entity, MUTATOR_ARGV_0_entity) \
165  i(bool, MUTATOR_ARGV_1_bool) \
166 
167 MUTATOR_HOOKABLE(Ent_Update, EV_Ent_Update);
168 
170 MUTATOR_HOOKABLE(DrawCrosshair, EV_NO_ARGS);
171 
173 MUTATOR_HOOKABLE(DrawScoreboard, EV_NO_ARGS);
174 
176 MUTATOR_HOOKABLE(DrawScoreboard_Force, EV_NO_ARGS);
177 
179 MUTATOR_HOOKABLE(DrawDeathScoreboard, EV_NO_ARGS);
180 
182 MUTATOR_HOOKABLE(DrawScoreboardAccuracy, EV_NO_ARGS);
183 
185 MUTATOR_HOOKABLE(DrawScoreboardItemStats, EV_NO_ARGS);
186 
188 #define EV_DrawInfoMessages(i, o) \
189  i(vector, MUTATOR_ARGV_0_vector) \
190  /***/ o(vector, MUTATOR_ARGV_0_vector) \
191  i(vector, MUTATOR_ARGV_1_vector) \
192  i(int, MUTATOR_ARGV_2_int) \
193  /***/ o(int, MUTATOR_ARGV_2_int) \
194 
195 MUTATOR_HOOKABLE(DrawInfoMessages, EV_DrawInfoMessages);
196 
198 #define EV_DrawViewModel(i, o) \
199  i(entity, MUTATOR_ARGV_0_entity) \
200 
201 MUTATOR_HOOKABLE(DrawViewModel, EV_DrawViewModel);
202 
205 
207 #define EV_ForcePlayermodels_Skip(i, o) \
208  i(entity, MUTATOR_ARGV_0_entity) \
209  i(bool, MUTATOR_ARGV_1_bool) \
210 
211 MUTATOR_HOOKABLE(ForcePlayermodels_Skip, EV_ForcePlayermodels_Skip);
212 
214 #define EV_ForcePlayercolors_Skip(i, o) \
215  i(entity, MUTATOR_ARGV_0_entity) \
216  i(bool, MUTATOR_ARGV_1_bool) \
217 
218 MUTATOR_HOOKABLE(ForcePlayercolors_Skip, EV_ForcePlayercolors_Skip);
219 
221 #define EV_DamageInfo(i, o) \
222  i(entity, MUTATOR_ARGV_0_entity) \
223  i(int, MUTATOR_ARGV_1_int) \
224  i(vector, MUTATOR_ARGV_2_vector) \
225 
226 MUTATOR_HOOKABLE(DamageInfo, EV_DamageInfo);
227 
230 
232 #define EV_ShowRankings(i, o) \
233  o(string, MUTATOR_ARGV_0_string) \
234 
235 MUTATOR_HOOKABLE(ShowRankings, EV_ShowRankings);
236 
238 #define EV_ShowNames_Draw(i, o) \
239  i(entity, MUTATOR_ARGV_0_entity) \
240  i(float, MUTATOR_ARGV_1_float) \
241  /***/ o(float, MUTATOR_ARGV_1_float) \
242 
243 MUTATOR_HOOKABLE(ShowNames_Draw, EV_ShowNames_Draw);
244 
246 MUTATOR_HOOKABLE(ShowRaceTimer, EV_NO_ARGS);
247 
249 MUTATOR_HOOKABLE(TeamRadar_Draw, EV_NO_ARGS);
#define EV_ForcePlayermodels_Skip(i, o)
Return true to disable player model forcing.
Definition: events.qh:207
#define EV_Skeleton_CheckBones(i, o)
Called when setting up skeleton bones.
Definition: events.qh:69
void DrawReticle(entity this)
Definition: crosshair.qc:678
#define EV_ForcePlayercolors_Skip(i, o)
Return true to disable player color forcing.
Definition: events.qh:214
int WantEventchase(entity this, bool want_vehiclechase)
Definition: view.qc:590
#define EV_Ent_Update(i, o)
Called when an entity is updated (either by SVQC networking or PVS)
Definition: events.qh:163
#define EV_HUD_Command(i, o)
Definition: events.qh:146
#define EV_Particles_VortexBeam(i, o)
Return true to not draw any vortex beam.
Definition: events.qh:131
#define EV_DamageInfo(i, o)
Called when damage info is received on the client, useful for playing explosion effects.
Definition: events.qh:221
#define EV_TagIndex_Update(i, o)
Called when updating the attached tags index.
Definition: events.qh:57
#define EV_CustomizeEventchase(i, o)
allow customizing 3rd person mode effect
Definition: events.qh:97
#define EV_Weapon_ImpactEffect(i, o)
Return true to not draw any impact effect.
Definition: events.qh:138
#define EV_ShowNames_Draw(i, o)
Called when drawing a player's nameplate, return true to hide it.
Definition: events.qh:238
MUTATOR_HOOKABLE(CSQC_ConsoleCommand, EV_CSQC_ConsoleCommand)
#define EV_CSQC_ConsoleCommand(i, o)
Called when a client command is parsed NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return fa...
Definition: events.qh:31
#define EV_DrawInfoMessages(i, o)
Called when drawing info messages, allows adding new info messages.
Definition: events.qh:188
#define EV_EditProjectile(i, o)
Called when a projectile's properties are being modified.
Definition: events.qh:48
#define EV_DrawGrapplingHook(i, o)
Draw the grapple hook, allows changing hook texture and colour.
Definition: events.qh:152
#define EV_DrawViewModel(i, o)
Called when the view model is being animated (setorigin is called after the hook, so you only need to...
Definition: events.qh:198
bool CSQC_ConsoleCommand(string command)
Definition: cl_cmd.qc:634
#define EV_Ent_Projectile(i, o)
Called when a projectile is linked with CSQC.
Definition: events.qh:42
string AnnouncerOption()
Definition: announcer.qc:10
#define EV_WantEventchase(i, o)
Called checking if 3rd person mode should be forced on.
Definition: events.qh:91
#define EV_HUD_Draw_overlay(i, o)
Definition: events.qh:113
#define EV_AnnouncerOption(i, o)
Definition: events.qh:105
#define EV_ShowRankings(i, o)
Return true to show leaderboard rankings, needs title argument set.
Definition: events.qh:232
#define EV_TagIndex_Apply(i, o)
Called when setting the attached tags.
Definition: events.qh:63
#define EV_NO_ARGS(i, o)
Definition: events.qh:3
#define EV_GetModelParams(i, o)
Called when getting the global parameters for a model.
Definition: events.qh:84
#define EV_Skeleton_CheckModel(i, o)
Called when setting up bones from the loaded model.
Definition: events.qh:75
void HUD_Contents()
Definition: view.qc:1044