From: MirceaKitsune Date: Sun, 18 Mar 2012 19:02:39 +0000 (+0200) Subject: Due to the latest commit, screen flashes require the HUD to be enabled in order to... X-Git-Url: https://de.git.xonotic.org/?a=commitdiff_plain;h=2dc434f346fd63cb9d909788c9c1fa3e9355c56e;p=voretournament%2Fvoretournament.git Due to the latest commit, screen flashes require the HUD to be enabled in order to work --- diff --git a/data/qcsrc/client/View.qc b/data/qcsrc/client/View.qc index c8aa6194..8a6e09f9 100644 --- a/data/qcsrc/client/View.qc +++ b/data/qcsrc/client/View.qc @@ -1153,34 +1153,37 @@ void CSQC_UpdateView(float w, float h) if(cvar("viewsize") < 120 && sbar_hudselector) CSQC_common_hud(); - if(cvar("cl_flash_pickup")) - if(pickup_flash_time < getstatf(STAT_LAST_PICKUP)) + if(sbar_hudselector) // flashes require some HUD components to work { - localcmd(strcat("bf ", cvar_string("cl_flash_pickup_color"), " ", cvar_string("cl_flash_pickup"), "\n")); - pickup_flash_time = getstatf(STAT_LAST_PICKUP); - } - if(cvar("cl_flash_vore")) - { - float vore_flash_state; - if(getstati(STAT_VORE_EATEN)) - vore_flash_state = -1; - else - vore_flash_state = hud_total_prey; - - if not(spectatee_status && last_spectatee != spectatee_status) // not if we switched players and that detects a different stomach load + if(cvar("cl_flash_pickup")) + if(pickup_flash_time < getstatf(STAT_LAST_PICKUP)) { - if(vore_flash_state > vore_flash_laststate && vore_flash_state > 0) // stomach load is bigger, so we ate someone - localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_pred"), " ", cvar_string("cl_flash_vore"), "\n")); - if(vore_flash_state < vore_flash_laststate && vore_flash_state < 0) // -1 means we have been eaten - localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_prey"), " ", cvar_string("cl_flash_vore"), "\n")); + localcmd(strcat("bf ", cvar_string("cl_flash_pickup_color"), " ", cvar_string("cl_flash_pickup"), "\n")); + pickup_flash_time = getstatf(STAT_LAST_PICKUP); } + if(cvar("cl_flash_vore")) + { + float vore_flash_state; + if(getstati(STAT_VORE_EATEN)) + vore_flash_state = -1; + else + vore_flash_state = hud_total_prey; - // always update the last vore state, or the flash can be triggered when switching spectated players one frame after - vore_flash_laststate = vore_flash_state; + if not(spectatee_status && last_spectatee != spectatee_status) // not if we switched players and that detects a different stomach load + { + if(vore_flash_state > vore_flash_laststate && vore_flash_state > 0) // stomach load is bigger, so we ate someone + localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_pred"), " ", cvar_string("cl_flash_vore"), "\n")); + if(vore_flash_state < vore_flash_laststate && vore_flash_state < 0) // -1 means we have been eaten + localcmd(strcat("bf ", cvar_string("cl_flash_vore_color_prey"), " ", cvar_string("cl_flash_vore"), "\n")); + } + + // always update the last vore state, or the flash can be triggered when switching spectated players one frame after + vore_flash_laststate = vore_flash_state; + } + if(cvar("cl_flash_respawn")) + if(respawned) + localcmd(strcat("bf ", cvar_string("cl_flash_respawn_color"), " ", cvar_string("cl_flash_respawn"), "\n")); } - if(cvar("cl_flash_respawn")) - if(respawned) - localcmd(strcat("bf ", cvar_string("cl_flash_respawn_color"), " ", cvar_string("cl_flash_respawn"), "\n")); if not(getstati(STAT_VORE_EATEN)) // crosshair is useless if we're in the stomach if not(getstati(STAT_ARMOR) < g_power || time <= power_boot) diff --git a/data/qcsrc/menu/voret/dialog_multiplayer_playersetup_hud.c b/data/qcsrc/menu/voret/dialog_multiplayer_playersetup_hud.c index 066bd474..785bb597 100644 --- a/data/qcsrc/menu/voret/dialog_multiplayer_playersetup_hud.c +++ b/data/qcsrc/menu/voret/dialog_multiplayer_playersetup_hud.c @@ -36,6 +36,7 @@ void fillVoretHudDialog(entity me) me.TDempty(me, 0.2); me.TD(me, 1, 0.5, e = makeVoretCheckBoxEx(0.25, 0, "cl_flash_pickup", "Screen flashes")); makeMulti(e, "cl_flash_vore cl_flash_respawn"); + setDependent(e, "sbar_hudselector", 1, 1); me.TR(me); me.TDempty(me, 0.2); me.TD(me, 1, 2, e = makeVoretCheckBox(0, "cl_reticle_item_normal", "Zoom reticles"));