]> git.rm.cloudns.org Git - voretournament/voretournament.git/commitdiff
Due to the latest commit, screen flashes require the HUD to be enabled in order to...
authorMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 18 Mar 2012 19:02:39 +0000 (21:02 +0200)
committerMirceaKitsune <sonichedgehog_hyperblast00@yahoo.com>
Sun, 18 Mar 2012 19:02:39 +0000 (21:02 +0200)
data/qcsrc/client/View.qc
data/qcsrc/menu/voret/dialog_multiplayer_playersetup_hud.c

index c8aa619496b376537c03670ae89ac04d958bb78b..8a6e09f9f18def4a5386f9518d0e603d0c425b99 100644 (file)
@@ -1153,34 +1153,37 @@ void CSQC_UpdateView(float w, float h)
                if(cvar("viewsize") < 120 && sbar_hudselector)\r
                        CSQC_common_hud();\r
 \r
-       if(cvar("cl_flash_pickup"))\r
-       if(pickup_flash_time < getstatf(STAT_LAST_PICKUP))\r
+       if(sbar_hudselector) // flashes require some HUD components to work\r
        {\r
-               localcmd(strcat("bf ", cvar_string("cl_flash_pickup_color"), " ", cvar_string("cl_flash_pickup"), "\n"));\r
-               pickup_flash_time = getstatf(STAT_LAST_PICKUP);\r
-       }\r
-       if(cvar("cl_flash_vore"))\r
-       {\r
-               float vore_flash_state;\r
-               if(getstati(STAT_VORE_EATEN))\r
-                       vore_flash_state = -1;\r
-               else\r
-                       vore_flash_state = hud_total_prey;\r
-\r
-               if not(spectatee_status && last_spectatee != spectatee_status) // not if we switched players and that detects a different stomach load\r
+               if(cvar("cl_flash_pickup"))\r
+               if(pickup_flash_time < getstatf(STAT_LAST_PICKUP))\r
                {\r
-                       if(vore_flash_state > vore_flash_laststate && vore_flash_state > 0) // stomach load is bigger, so we ate someone\r
-                               localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_pred"), " ", cvar_string("cl_flash_vore"), "\n"));\r
-                       if(vore_flash_state < vore_flash_laststate && vore_flash_state < 0) // -1 means we have been eaten\r
-                               localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_prey"), " ", cvar_string("cl_flash_vore"), "\n"));\r
+                       localcmd(strcat("bf ", cvar_string("cl_flash_pickup_color"), " ", cvar_string("cl_flash_pickup"), "\n"));\r
+                       pickup_flash_time = getstatf(STAT_LAST_PICKUP);\r
                }\r
+               if(cvar("cl_flash_vore"))\r
+               {\r
+                       float vore_flash_state;\r
+                       if(getstati(STAT_VORE_EATEN))\r
+                               vore_flash_state = -1;\r
+                       else\r
+                               vore_flash_state = hud_total_prey;\r
 \r
-               // always update the last vore state, or the flash can be triggered when switching spectated players one frame after\r
-               vore_flash_laststate = vore_flash_state;\r
+                       if not(spectatee_status && last_spectatee != spectatee_status) // not if we switched players and that detects a different stomach load\r
+                       {\r
+                               if(vore_flash_state > vore_flash_laststate && vore_flash_state > 0) // stomach load is bigger, so we ate someone\r
+                                       localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_pred"), " ", cvar_string("cl_flash_vore"), "\n"));\r
+                               if(vore_flash_state < vore_flash_laststate && vore_flash_state < 0) // -1 means we have been eaten\r
+                                       localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_prey"), " ", cvar_string("cl_flash_vore"), "\n"));\r
+                       }\r
+\r
+                       // always update the last vore state, or the flash can be triggered when switching spectated players one frame after\r
+                       vore_flash_laststate = vore_flash_state;\r
+               }\r
+               if(cvar("cl_flash_respawn"))\r
+               if(respawned)\r
+                       localcmd(strcat("bf ", cvar_string("cl_flash_respawn_color"), " ", cvar_string("cl_flash_respawn"), "\n"));\r
        }\r
-       if(cvar("cl_flash_respawn"))\r
-       if(respawned)\r
-               localcmd(strcat("bf ", cvar_string("cl_flash_respawn_color"), " ", cvar_string("cl_flash_respawn"), "\n"));\r
 \r
        if not(getstati(STAT_VORE_EATEN)) // crosshair is useless if we're in the stomach\r
        if not(getstati(STAT_ARMOR) < g_power || time <= power_boot)\r
index 066bd474f280497755dad9d9fd436a59210eec5f..785bb597de111e8274c9ac5cc3feffc973ec936c 100644 (file)
@@ -36,6 +36,7 @@ void fillVoretHudDialog(entity me)
                me.TDempty(me, 0.2);\r
                me.TD(me, 1, 0.5, e = makeVoretCheckBoxEx(0.25, 0, "cl_flash_pickup", "Screen flashes"));\r
                makeMulti(e, "cl_flash_vore cl_flash_respawn");\r
+               setDependent(e, "sbar_hudselector", 1, 1);\r
        me.TR(me);\r
                me.TDempty(me, 0.2);\r
                me.TD(me, 1, 2, e = makeVoretCheckBox(0, "cl_reticle_item_normal", "Zoom reticles"));\r