X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fmutators%2Fevents.qh;h=e9778b795ce2e077cb7cef10023712b616743f74;hb=772fb683d951a622cc8520827096ec34fdea4763;hp=ddadde8977165dc21d9845fec70d50e24a433b56;hpb=30648cd6167b20ad5924c03cd39efff9ef5b62df;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index ddadde897..e9778b795 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; @@ -170,3 +175,30 @@ MUTATOR_HOOKABLE(DrawInfoMessages, EV_DrawInfoMessages); /** file */ i(float, MUTATOR_ARGV_0_float) \ /**/ MUTATOR_HOOKABLE(HUD_WriteCvars, EV_HUD_WriteCvars); + +/** 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);