vector autocvar_hud_panel_bg_color;
float autocvar_hud_panel_bg_color_team;
float autocvar_hud_panel_bg_padding;
+float autocvar_hud_panel_centerprint;
+string autocvar_hud_panel_centerprint_pos;
+string autocvar_hud_panel_centerprint_size;
+string autocvar_hud_panel_centerprint_bg;
+string autocvar_hud_panel_centerprint_bg_color;
+string autocvar_hud_panel_centerprint_bg_color_team;
+string autocvar_hud_panel_centerprint_bg_alpha;
+string autocvar_hud_panel_centerprint_bg_border = "";
+string autocvar_hud_panel_centerprint_bg_padding = "";
+float autocvar_hud_panel_centerprint_align;
+float autocvar_hud_panel_centerprint_fade_in;
+float autocvar_hud_panel_centerprint_fade_out;
+float autocvar_hud_panel_centerprint_fade_subsequent;
+float autocvar_hud_panel_centerprint_fade_subsequent_passone;
+float autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha;
+float autocvar_hud_panel_centerprint_fade_subsequent_passtwo;
+float autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha;
+float autocvar_hud_panel_centerprint_fade_minfontsize;
+float autocvar_hud_panel_centerprint_flip;
+float autocvar_hud_panel_centerprint_fontscale;
+float autocvar_hud_panel_centerprint_time;
float autocvar_hud_panel_chat;
float autocvar_hud_panel_engineinfo;
float autocvar_hud_panel_engineinfo_framecounter_decimals;
float autocvar_hud_panel_healtharmor_progressbar_gfx_damage;
float autocvar_hud_panel_healtharmor_progressbar_gfx_lowhealth;
float autocvar_hud_panel_healtharmor_progressbar_gfx_smooth;
-
-// TEMPORARY hard coded default for compatibility - remove after 0.2 release
-var float autocvar_hud_panel_centerprint = 1;
-noref var string autocvar_hud_panel_centerprint_pos = "0.180000 0.260000";
-noref var string autocvar_hud_panel_centerprint_size = "0.650000 0.210000";
-noref var string autocvar_hud_panel_centerprint_bg = "";
-noref var string autocvar_hud_panel_centerprint_bg_color = "";
-noref var string autocvar_hud_panel_centerprint_bg_color_team = "";
-noref var string autocvar_hud_panel_centerprint_bg_alpha = "";
-noref var string autocvar_hud_panel_centerprint_bg_border = "";
-noref var string autocvar_hud_panel_centerprint_bg_padding = "";
-var float autocvar_hud_panel_centerprint_align = 0.5;
-var float autocvar_hud_panel_centerprint_fadetime = 0.25;
-var float autocvar_hud_panel_centerprint_flip = 1;
-var float autocvar_hud_panel_centerprint_fontscale = 1;
-var float autocvar_hud_panel_centerprint_time = 3;
float autocvar_hud_panel_healtharmor_text;
float autocvar_hud_panel_infomessages;
float autocvar_hud_panel_infomessages_flip;
float centerprint_time[CENTERPRINT_MAX_MSGS];
float centerprint_expire_time[CENTERPRINT_MAX_MSGS];
float centerprint_countdown_num[CENTERPRINT_MAX_MSGS];
-float centerprint_fadetime;
float centerprint_showing;
void centerprint_generic(float new_id, string strMessage, float duration, float countdown_num)
if (!centerprint_showing)
centerprint_showing = TRUE;
- centerprint_fadetime = bound(0, autocvar_hud_panel_centerprint_fadetime, 1);
-
for (i=0, j=cpm_index; i<CENTERPRINT_MAX_MSGS; ++i, ++j)
{
if (j == CENTERPRINT_MAX_MSGS)
if (strMessage == "" && centerprint_messages[j] != "" && centerprint_countdown_num[j] == 0)
{
// fade out the current msg (duration and countdown_num are ignored)
- centerprint_time[j] = centerprint_fadetime;
- if (centerprint_expire_time[j] > time + centerprint_fadetime || centerprint_expire_time[j] < time)
- centerprint_expire_time[j] = time + centerprint_fadetime;
+ centerprint_time[j] = autocvar_hud_panel_centerprint_fade_out;
+ if (centerprint_expire_time[j] > time + autocvar_hud_panel_centerprint_fade_out || centerprint_expire_time[j] < time)
+ centerprint_expire_time[j] = time + autocvar_hud_panel_centerprint_fade_out;
return;
}
break; // found a msg with the same id, at position j
}
// fade the centerprint in/out
- if (centerprint_time[j] < 0 || centerprint_expire_time[j] - centerprint_fadetime > time)
+ if (centerprint_time[j] < 0 || centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_in > time)
{
- a = bound(0, (time - (centerprint_expire_time[j] - centerprint_time[j])) / centerprint_fadetime, 1);
+ a = bound(0, (time - (centerprint_expire_time[j] - centerprint_time[j])) / max(0.0001, autocvar_hud_panel_centerprint_fade_in), 1);
}
- else if (centerprint_expire_time[j] > time)
+ else if ((centerprint_expire_time[j] > time) && autocvar_hud_panel_centerprint_fade_out)
{
- a = (centerprint_expire_time[j] - time) / centerprint_fadetime;
+ a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
}
// also fade it based on positioning
- a = a * bound(0.5, (1 - (i / 2)), 1); // pass one: all messages after the first have half alpha
- a = a * bound(0.5, (1 - (i / 10)), 1); // pass two: after that, gradually lower alpha even more for each message
+ if(autocvar_hud_panel_centerprint_fade_subsequent)
+ {
+ a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passone_minalpha, (1 - (i / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passone))), 1); // pass one: all messages after the first have half alpha
+ a = a * bound(autocvar_hud_panel_centerprint_fade_subsequent_passtwo_minalpha, (1 - (i / max(1, autocvar_hud_panel_centerprint_fade_subsequent_passtwo))), 1); // pass two: after that, gradually lower alpha even more for each message
+ }
// finally set the size based on the new alpha
- sz = 0.75 + a * (1 - 0.75);
+ sz = autocvar_hud_panel_centerprint_fade_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_minfontsize);
drawfontscale = sz * '1 1 0';
if (centerprint_countdown_num[j])