]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a mutator hook to override hud_contents
authorMario <mario@smbclan.net>
Wed, 19 Jul 2017 20:43:15 +0000 (06:43 +1000)
committerMario <mario@smbclan.net>
Wed, 19 Jul 2017 20:43:34 +0000 (06:43 +1000)
qcsrc/client/mutators/events.qh
qcsrc/client/view.qc

index 56947865db01bfcdc9876ac886ad9ee6e2a1342e..0fa65d28ef75d2270450ea2028feda07a3d19c06 100644 (file)
@@ -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);
index 0f8b5949501d0a21c4b3deb76fa73b14c551b896..70de314efd34b8a8259ec77d38267feac012d234 100644 (file)
@@ -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;