From: Mario Date: Wed, 19 Jul 2017 20:43:15 +0000 (+1000) Subject: Add a mutator hook to override hud_contents X-Git-Tag: xonotic-v0.8.5~2560 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=6198f6a367fe5974031453d4c8c929f341cabd21;p=xonotic%2Fxonotic-data.pk3dir.git Add a mutator hook to override hud_contents --- diff --git a/qcsrc/client/mutators/events.qh b/qcsrc/client/mutators/events.qh index 56947865d..0fa65d28e 100644 --- a/qcsrc/client/mutators/events.qh +++ b/qcsrc/client/mutators/events.qh @@ -176,3 +176,6 @@ MUTATOR_HOOKABLE(HUD_WriteCvars, EV_HUD_WriteCvars); /** 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); diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 0f8b59495..70de314ef 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -2111,7 +2111,7 @@ void CSQC_UpdateView(entity this, float w, float h) // improved polyblend - if(autocvar_hud_contents) + if(autocvar_hud_contents && !MUTATOR_CALLHOOK(HUD_Contents)) { float contentalpha_temp, incontent, liquidalpha, contentfadetime; vector liquidcolor;