From: MirceaKitsune Date: Tue, 15 Nov 2011 20:25:37 +0000 (+0200) Subject: Add reboot time for the HUD X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;ds=sidebyside;h=05c78eec5929f4cbadd6c3aa9be43ab8bb67c412;p=voretournament%2Fvoretournament.git Add reboot time for the HUD --- diff --git a/data/qcsrc/client/sbar.qc b/data/qcsrc/client/sbar.qc index a4f03db8..ec49dc45 100644 --- a/data/qcsrc/client/sbar.qc +++ b/data/qcsrc/client/sbar.qc @@ -2784,6 +2784,8 @@ float vote_prev; // previous state of vote_active to check for a change float vote_alpha; float vote_change; // "time" when vote_active changed +float power_boot; + vector stomachstatus_colorfade_current; vector StomachStatus_ColorFade(vector target_color) { @@ -3079,16 +3081,22 @@ void Sbar_Draw (void) fade = bound(0.7, fade, 1); if(getstati(STAT_HEALTH) > 0) - if(getstati(STAT_ARMOR) < g_power) { - vector warn_pos; - warn_pos_x = vid_conwidth / 2; - warn_pos_y = vid_conheight - vid_conheight / 2.5; - - drawpic(warn_pos - '128 0 0', "gfx/hud/sb_power_fail", '256 256 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); - drawpic(warn_pos - '16 0 0' + '0 150 0', "gfx/hud/sb_power_fail_icon", '32 32 0', '1 1 1', sbar_alpha_fg * (0.5 + sin(time * 5) / 2), DRAWFLAG_NORMAL); + if(getstati(STAT_ARMOR) < g_power) + { + vector warn_pos; + warn_pos_x = vid_conwidth / 2; + warn_pos_y = vid_conheight - vid_conheight / 2.5; + drawpic(warn_pos - '128 0 0', "gfx/hud/sb_power_fail", '256 256 0', '1 1 1', sbar_alpha_fg, DRAWFLAG_NORMAL); + drawpic(warn_pos - '16 0 0' + '0 150 0', "gfx/hud/sb_power_fail_icon", '32 32 0', '1 1 1', sbar_alpha_fg * (0.5 + sin(time * 5) / 2), DRAWFLAG_NORMAL); - return; + power_boot = time + g_power_reboot; + return; + } + else if(time < power_boot) + { + return; + } } if(g_vore) // only when the vore system is active