X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;ds=sidebyside;f=qcsrc%2Fclient%2Fmutators%2Fevents.qh;h=0629c2a9f0dd17a7897c73f6ff68dc818748c4ac;hb=90d9f7c775306324957323d53d5a4ad995d999e3;hp=74090e14d6992749c8b747c04894a20279c8d7bf;hpb=432126e0c7bf5c11c11d9d6db7b311b0ad64c585;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index 74090e14d..0629c2a9f 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -2,6 +2,11 @@ #include +// register all possible hooks here + +// to use a hook, first register your mutator using REGISTER_MUTATOR +// then create your function using MUTATOR_HOOKFUNCTION + /** * Called when a client command is parsed * NOTE: hooks MUST start with if (MUTATOR_RETURNVALUE) return false; @@ -157,3 +162,37 @@ MUTATOR_HOOKABLE(DrawCrosshair, EV_NO_ARGS); /** Return true to not draw scoreboard */ MUTATOR_HOOKABLE(DrawScoreboard, EV_NO_ARGS); + +/** Called when drawing info messages, allows adding new info messages */ +#define EV_DrawInfoMessages(i, o) \ + /** pos */ i(vector, MUTATOR_ARGV_0_vector) \ + /** mySize */ i(vector, MUTATOR_ARGV_1_vector) \ + /**/ +MUTATOR_HOOKABLE(DrawInfoMessages, EV_DrawInfoMessages); + +/** Called when the view model is being animated (setorigin is called after the hook, so you only need to modify origin here if desired) */ +#define EV_DrawViewModel(i, o) \ + /** entity id */ i(entity, MUTATOR_ARGV_0_entity) \ + /**/ +MUTATOR_HOOKABLE(DrawViewModel, EV_DrawViewModel); + +/** Called when updating the view's liquid contents, return true to disable the standard checks and apply your own */ +MUTATOR_HOOKABLE(HUD_Contents, EV_NO_ARGS); + +/** Return true to disable player model/color forcing */ +#define EV_ForcePlayermodels_Skip(i, o) \ + /** entity id */ i(entity, MUTATOR_ARGV_0_entity) \ + /** is local */ i(bool, MUTATOR_ARGV_1_bool) \ + /**/ +MUTATOR_HOOKABLE(ForcePlayermodels_Skip, EV_ForcePlayermodels_Skip); + +/** Called when damage info is received on the client, useful for playing explosion effects */ +#define EV_DamageInfo(i, o) \ + /** entity id */ i(entity, MUTATOR_ARGV_0_entity) \ + /** death type */ i(int, MUTATOR_ARGV_1_int) \ + /** hit origin */ i(vector, MUTATOR_ARGV_2_vector) \ + /**/ +MUTATOR_HOOKABLE(DamageInfo, EV_DamageInfo); + +/** Return true to not draw zoom reticle */ +MUTATOR_HOOKABLE(DrawReticle, EV_NO_ARGS);