X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fcenterprint.qc;h=9dd5f05ff57d6152ba66c05ebdd154a1c2beb79c;hb=9185b58da6fe5f2b095d7066577e1e024b4d2798;hp=e2e82acffe4efa33ab7275d2bfdb776399da0f70;hpb=c13fdf2b49eff1d26abc73d42e33636162a9b527;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/centerprint.qc b/qcsrc/client/hud/panel/centerprint.qc index e2e82acff..9dd5f05ff 100644 --- a/qcsrc/client/hud/panel/centerprint.qc +++ b/qcsrc/client/hud/panel/centerprint.qc @@ -1,6 +1,6 @@ #include "centerprint.qh" -#include +#include "scoreboard.qh" // CenterPrint (#16) @@ -57,8 +57,7 @@ void centerprint_generic(int new_id, string strMessage, float duration, int coun { // fade out the current msg (duration and countdown_num are ignored) centerprint_time[j] = min(5, autocvar_hud_panel_centerprint_fade_out); - if (centerprint_expire_time[j] > time + min(5, autocvar_hud_panel_centerprint_fade_out) || centerprint_expire_time[j] < time) - centerprint_expire_time[j] = time + min(5, autocvar_hud_panel_centerprint_fade_out); + centerprint_expire_time[j] = -1; // don't use the variable time here! return; } break; // found a msg with the same id, at position j @@ -80,14 +79,14 @@ void centerprint_generic(int new_id, string strMessage, float duration, int coun if (duration < 0) { centerprint_time[j] = -1; - centerprint_expire_time[j] = time; + centerprint_expire_time[j] = -1; // don't use the variable time here! } else { if(duration == 0) duration = max(1, autocvar_hud_panel_centerprint_time); centerprint_time[j] = duration; - centerprint_expire_time[j] = time + duration; + centerprint_expire_time[j] = -1; // don't use the variable time here! } centerprint_countdown_num[j] = countdown_num; } @@ -155,13 +154,14 @@ void HUD_CenterPrint () } // this panel fades only when the menu does - float hud_fade_alpha_save = 0; - if(scoreboard_fade_alpha) - { - hud_fade_alpha_save = hud_fade_alpha; + float hud_fade_alpha_save = hud_fade_alpha; + if(hud_configure_menu_open == 1) + hud_fade_alpha = 1; + else hud_fade_alpha = 1 - autocvar__menu_alpha; - } + HUD_Panel_UpdateCvars(); + hud_fade_alpha = hud_fade_alpha_save; if ( HUD_Radar_Clickable() ) { @@ -171,17 +171,13 @@ void HUD_CenterPrint () panel_pos = eY * hud_panel_radar_bottom + eX * 0.5 * (vid_conwidth - panel_size_x); panel_size_y = min(panel_size_y, vid_conheight - hud_panel_radar_bottom); } - else if(scoreboard_fade_alpha) + else if(!autocvar__hud_configure && scoreboard_fade_alpha) { - hud_fade_alpha = hud_fade_alpha_save; - // move the panel below the scoreboard if (scoreboard_bottom >= 0.96 * vid_conheight) return; vector target_pos; - target_pos = eY * scoreboard_bottom + eX * 0.5 * (vid_conwidth - panel_size.x); - if(target_pos.y > panel_pos.y) { panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha); @@ -228,6 +224,13 @@ void HUD_CenterPrint () { if (j == CENTERPRINT_MAX_MSGS) j = 0; + if (centerprint_expire_time[j] == -1) + { + // here we are sure the time variable is not altered by CSQC_Ent_Update + centerprint_expire_time[j] = time; + if (centerprint_time[j] > 0) + centerprint_expire_time[j] += centerprint_time[j]; + } if (centerprint_expire_time[j] <= time) { if (centerprint_countdown_num[j] && centerprint_time[j] > 0)