else
print (sprintf(_("^1%s^1 is now conserved for centuries to come\n"), s1));
}
- } else if(type == DEATH_TURRET) {
+ } else if(DEATH_ISTURRET(type)) {
HUD_KillNotify_Push(s1, "", 0, DEATH_GENERIC);
if(alsoprint)
- print (sprintf(_("^1%s^1 was mowed down by a turret \n"), s1));
+ {
+ if(gentle)
+ print (sprintf(_("^1%s^1 ran into a turret\n"), s1));
+ else
+ {
+ switch(type)
+ {
+ case DEATH_TURRET_EWHEEL:
+ print (sprintf(_("^1%s^1 was laserd down by a eWheel turret \n"), s1));
+ break;
+ case DEATH_TURRET_FLAC:
+ print (sprintf(_("^1%s^1 got caught in the flac \n"), s1));
+ break;
+ case DEATH_TURRET_MACHINEGUN:
+ print (sprintf(_("^1%s^1 was riddeld full of riddled by a machinegun turret \n"), s1));
+ break;
+ case DEATH_TURRET_WALKER_GUN:
+ print (sprintf(_("^1%s^1 got served a led enrichment by a walker turret \n"), s1));
+ break;
+ case DEATH_TURRET_WALKER_MEELE:
+ print (sprintf(_("^1%s^1 was impaled by a walker turret \n"), s1));
+ break;
+ case DEATH_TURRET_WALKER_ROCKET:
+ print (sprintf(_("^1%s^1 was rocketed to hell by a walker turret \n"), s1));
+ break;
+ case DEATH_TURRET_HELLION:
+ print (sprintf(_("^1%s^1 was blasted away hellion turret \n"), s1));
+ break;
+ case DEATH_TURRET_HK:
+ print (sprintf(_("^1%s^1 could not hide from the hunter turret \n"), s1));
+ break;
+ case DEATH_TURRET_MLRS:
+ print (sprintf(_("^1%s^1 got turned into smoldering gibs by a mlrs turret \n"), s1));
+ break;
+ case DEATH_TURRET_PLASMA:
+ print (sprintf(_("^1%s^1 got served some superheated plasma from a plasma turret \n"), s1));
+ break;
+ case DEATH_TURRET_PHASER:
+ print (sprintf(_("^1%s^1 was phased out \n"), s1));
+ break;
+ case DEATH_TURRET_TESLA:
+ print (sprintf(_("^1%s^1 was electrocuted by a tesla turret \n"), s1));
+ break;
+ }
+ }
+ }
} else if (type == DEATH_CUSTOM) {
HUD_KillNotify_Push(s1, "", 0, DEATH_CUSTOM);
if(alsoprint)
{
if (!autocvar__hud_configure)
{
- if (autocvar_hud_panel_radar == 0) return;
- if (autocvar_hud_panel_radar != 2 && !teamplay) return;
+ if (hud_panel_radar_maximized)
+ {
+ if (!hud_draw_maximized) return;
+ }
+ else
+ {
+ if (autocvar_hud_panel_radar == 0) return;
+ if (autocvar_hud_panel_radar != 2 && !teamplay) return;
+ }
}
else
hud_configure_active_panel = HUD_PANEL_RADAR;
HUD_Panel_UpdateCvars(radar);
HUD_Panel_ApplyFadeAlpha();
+
+ if (hud_panel_radar_maximized && !autocvar__hud_configure)
+ {
+ panel_size = autocvar_hud_panel_radar_maximized_size;
+ panel_size_x = bound(0.2, panel_size_x, 1) * vid_conwidth;
+ panel_size_y = bound(0.2, panel_size_y, 1) * vid_conheight;
+ panel_pos_x = (vid_conwidth - panel_size_x) / 2;
+ panel_pos_y = (vid_conheight - panel_size_y) / 2;
+
+ panel_bg = strcat(hud_skin_path, "/border_default"); // always use the default border when maximized
+ if(precache_pic(panel_bg) == "") { panel_bg = "gfx/hud/default/border_default"; } // fallback
+ }
+
vector pos, mySize;
pos = panel_pos;
mySize = panel_size;
mySize -= '2 2 0' * panel_bg_padding;
}
- local float color2;
- local entity tm;
+ float color2;
+ entity tm;
float scale2d, normalsize, bigsize;
float f;
void HUD_VoteWindow(void)
{
- if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE))
+ if(autocvar_cl_allow_uid2name == -1 && (gametype == GAME_CTS || gametype == GAME_RACE || (serverflags & SERVERFLAG_PLAYERSTATS)))
{
vote_active = 1;
if (autocvar__hud_configure)
print(_("^1You must answer before entering hud configure mode\n"));
cvar_set("_hud_configure", "0");
}
- vote_called_vote = strzone(_("^2Name ^7instead of \"^1Unregistered player^7\" in stats"));
+ if(vote_called_vote)
+ strunzone(vote_called_vote);
+ vote_called_vote = strzone(_("^2Name ^7instead of \"^1Anonymous player^7\" in stats"));
uid2name_dialog = 1;
}
cvar_set("con_chatrect", "0");
return;
}
+ if(autocvar__con_chat_maximized)
+ if(!hud_draw_maximized) return;
}
else
hud_configure_active_panel = HUD_PANEL_CHAT;
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] = 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);
return;
}
break; // found a msg with the same id, at position j
if (scoreboard_bottom >= 0.96 * vid_conheight)
return;
vector target_pos;
+
target_pos = eY * scoreboard_bottom + eX * 0.5 * (vid_conwidth - panel_size_x);
- panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
- panel_size_y = min(panel_size_y, vid_conheight - scoreboard_bottom);
+
+ if(target_pos_y > panel_pos_y)
+ {
+ panel_pos = panel_pos + (target_pos - panel_pos) * sqrt(scoreboard_fade_alpha);
+ panel_size_y = min(panel_size_y, vid_conheight - scoreboard_bottom);
+ }
}
HUD_Panel_DrawBg(1);
else
continue;
}
- if (centerprint_time[j] < 0 || centerprint_expire_time[j] - centerprint_fadetime > time)
- {
- a = bound(0, (time - (centerprint_expire_time[j] - centerprint_time[j])) / centerprint_fadetime, 1);
- }
+
+ // fade the centerprint in/out
+ if (centerprint_time[j] < 0 || centerprint_expire_time[j] - autocvar_hud_panel_centerprint_fade_out > time)
+ 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)
+ a = (centerprint_expire_time[j] - time) / max(0.0001, autocvar_hud_panel_centerprint_fade_out);
+
+ // set the size from fading in/out before subsequent fading
+ sz = autocvar_hud_panel_centerprint_fade_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_minfontsize);
+
+ // also fade it based on positioning
+ if(autocvar_hud_panel_centerprint_fade_subsequent)
{
- a = (centerprint_expire_time[j] - time) / centerprint_fadetime;
+ 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
}
- a = a * (bound(0.5, (1 - (i / 2)), 1) * bound(0.5, (1 - (i / 10)), 1));
-
- sz = 0.5 + a * (1 - 0.5);
-
+ // finally set the size based on the new alpha from subsequent fading
+ sz = autocvar_hud_panel_centerprint_fade_subsequent_minfontsize + a * (1 - autocvar_hud_panel_centerprint_fade_subsequent_minfontsize);
drawfontscale = sz * '1 1 0';
+
if (centerprint_countdown_num[j])
n = tokenizebyseparator(sprintf(centerprint_messages[j], centerprint_countdown_num[j]), "\n");
else
{
pos_y = current_msg_pos_y - CENTERPRINT_SPACING * fontsize_y;
if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages
- pos_y += (msg_size + CENTERPRINT_SPACING * fontsize_y);
+ pos_y += (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz));
}
else
{
pos_y += CENTERPRINT_SPACING * fontsize_y;
if (a < 1 && centerprint_msgID[j] == 0) // messages with id can be replaced just after they are faded out, so never move over them the next messages
- pos_y -= (msg_size + CENTERPRINT_SPACING * fontsize_y);
+ pos_y -= (msg_size + CENTERPRINT_SPACING * fontsize_y) * (1 - sqrt(sz));
}
}
drawfontscale = '1 1 0';
}
}
+ hud_draw_maximized = 0;
// draw panels in order specified by panel_order array
- for(i = HUD_PANEL_NUM - 1; i >= 0; --i) {
- if(i != HUD_PANEL_CHAT || !autocvar__con_chat_maximized) // don't draw maximized chat panel twice!
- HUD_DrawPanel(panel_order[i]);
- }
+ for(i = HUD_PANEL_NUM - 1; i >= 0; --i)
+ HUD_DrawPanel(panel_order[i]);
- // draw chat panel on top if it is maximized
+ hud_draw_maximized = 1; // panels that may be maximized must check this var
+ // draw maximized panels on top
+ if(hud_panel_radar_maximized)
+ HUD_Radar();
if(autocvar__con_chat_maximized)
- HUD_Chat(); // HUD_DrawPanel(HUD_PANEL_CHAT);
+ HUD_Chat();
if(autocvar__hud_configure)
{