} else if(msg == MSG_KILL) {
w = DEATH_WEAPONOF(type);
if(WEP_VALID(w)) {
- HUD_KillNotify_Push(s1, s2, 1, type);
+ if((w == WEP_CAMPINGRIFLE || w == WEP_MINSTANEX) && type & HITTYPE_HEADSHOT) // all headshot weapons go here
+ HUD_KillNotify_Push(s1, s2, 1, DEATH_HEADSHOT);
+ else
+ HUD_KillNotify_Push(s1, s2, 1, type);
+
if (alsoprint)
print("^1", sprintf(Weapon_KillMessage(type), strcat(s2, "^1"), strcat(s1, "^1")), "\n"); // default order: victim, killer
}
float width_attacker;
string attacker, victim;
- float k, i, j, w;
- float flip = cvar("hud_panel_notify_flip");
- for(k = 0, j = kn_index; k < entries; ++k, ++j)
+ float i, j, w, step, limit;
+ if(cvar("hud_panel_notify_flip")) //order items from the top down
+ {
+ i = 0;
+ step = +1;
+ limit = entries;
+ }
+ else //order items from the bottom up
+ {
+ i = entries - 1;
+ step = -1;
+ limit = -1;
+ }
+
+ for(j = kn_index; i != limit; i += step, ++j)
{
+ if(autocvar__hud_configure)
+ {
+ if (step == +1)
+ a = i;
+ else // inverse order
+ a = entries - 1 - i;
+ attacker = textShortenToWidth(strcat("Player", ftos(a+1)), 0.48 * mySize_x - height, fontsize, stringwidth_colors);
+ victim = textShortenToWidth(strcat("Player", ftos(a+2)), 0.48 * mySize_x - height, fontsize, stringwidth_colors);
+ s = strcat("weapon", get_weaponinfo(WEP_FIRST + mod(floor(a*2.4), WEP_LAST)).netname);
+ a = bound(0, (when - a) / 4, 1);
+ goto hud_config_notifyprint;
+ }
+
if (j == KN_MAX_ENTRIES)
j = 0;
- s = "";
- if(flip)
- i = k;
- else // rather nasty hack for ordering items from the bottom up
- i = entries - k - 1;
-
- if(fadetime)
+ if(killnotify_times[j] + when > time)
+ a = 1;
+ else if(fadetime)
{
- if(killnotify_times[j] + when > time)
- a = 1;
- else
- a = bound(0, (killnotify_times[j] + when + fadetime - time) / fadetime, 1);
+ a = bound(0, (killnotify_times[j] + when + fadetime - time) / fadetime, 1);
+ if(!a)
+ {
+ break;
+ }
}
else
{
- if(killnotify_times[j] + when > time)
- a = 1;
- else
- a = 0;
+ break;
}
+ s = "";
+
w = -1;
w = DEATH_WEAPONOF(killnotify_deathtype[j]);
// TODO: maybe print in team colors?
//
// Y [used by] X
- if(killnotify_actiontype[j] == 0 && !autocvar__hud_configure)
+ if(killnotify_actiontype[j] == 0)
{
- attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
- pos_attacker = pos + eX * (0.52 * mySize_x + height) + eY * (0.5 * fontsize_y + i * height);
- weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
-
if(killnotify_deathtype[j] == DEATH_GENERIC)
{
s = "notify_death";
s = "notify_blue_captured";
}
}
- if(s != "" && a)
+ attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
+ pos_attacker = pos + eX * (0.52 * mySize_x + height) + eY * (0.5 * fontsize_y + i * height);
+ weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
+
+ if(s != "")
{
drawpic_aspect_skin(weap_pos, s, '2 1 0' * height, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
// X [did action to] Y
else
{
- if(autocvar__hud_configure)
- {
- attacker = textShortenToWidth("Player1", 0.48 * mySize_x - height, fontsize, stringwidth_colors);
- victim = textShortenToWidth("Player2", 0.48 * mySize_x - height, fontsize, stringwidth_colors);
- a = bound(0, (when - k) / 4, 1);
- }
- else
- {
- attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
- victim = textShortenToWidth(killnotify_victims[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
- }
- width_attacker = stringwidth(attacker, TRUE, fontsize);
- pos_attacker = pos + eX * (0.48 * mySize_x - height - width_attacker) + eY * (0.5 * fontsize_y + i * height);
- pos_victim = pos + eX * (0.52 * mySize_x + height) + eY * (0.5 * fontsize_y + i * height);
- weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
-
- if(autocvar__hud_configure) // example actions for config mode
- {
- s = "weaponelectro";
- }
- else if(killnotify_deathtype[j] & HITTYPE_SECONDARY && w == WEP_LASER)
+ if(killnotify_deathtype[j] & HITTYPE_SECONDARY && w == WEP_LASER)
{
s = "notify_melee_laser";
}
{
s = "notify_void";
}
+ else if(killnotify_deathtype[j] == DEATH_HEADSHOT)
+ {
+ s = "notify_headshot";
+ }
else if(killnotify_deathtype[j] == RACE_SERVER_RECORD)
{
s = "race_newrecordserver";
{
s = "race_newfail";
}
- if(s != "" && a)
+
+ attacker = textShortenToWidth(killnotify_attackers[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
+ victim = textShortenToWidth(killnotify_victims[j], 0.48 * mySize_x - height, fontsize, stringwidth_colors);
+:hud_config_notifyprint
+ width_attacker = stringwidth(attacker, TRUE, fontsize);
+ pos_attacker = pos + eX * (0.48 * mySize_x - height - width_attacker) + eY * (0.5 * fontsize_y + i * height);
+ pos_victim = pos + eX * (0.52 * mySize_x + height) + eY * (0.5 * fontsize_y + i * height);
+ weap_pos = pos + eX * 0.5 * mySize_x - eX * height + eY * i * height;
+
+ if(s != "")
{
drawpic_aspect_skin(weap_pos, s, '2 1 0' * height, '1 1 1', panel_fg_alpha * a, DRAWFLAG_NORMAL);
drawcolorcodedstring(pos_attacker, attacker, fontsize, panel_fg_alpha * a, DRAWFLAG_NORMAL);
}
// draw the progress bars
- drawsetcliparea(pos_x, pos_y, mySize_x * 0.5 * (vote_yescount/vote_needed), mySize_y);
- drawpic_skin(pos + eY * (5/8) * mySize_y, "voteprogress_prog", eX * mySize_x + eY * (3/8) * mySize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+ if(vote_yescount && vote_needed)
+ {
+ drawsetcliparea(pos_x, pos_y, mySize_x * 0.5 * (vote_yescount/vote_needed), mySize_y);
+ drawpic_skin(pos + eY * (5/8) * mySize_y, "voteprogress_prog", eX * mySize_x + eY * (3/8) * mySize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+ }
- drawsetcliparea(pos_x + mySize_x - mySize_x * 0.5 * (vote_nocount/vote_needed), pos_y, mySize_x * 0.5, mySize_y);
- drawpic_skin(pos + eY * (5/8) * mySize_y, "voteprogress_prog", eX * mySize_x + eY * (3/8) * mySize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+ if(vote_nocount && vote_needed)
+ {
+ drawsetcliparea(pos_x + mySize_x - mySize_x * 0.5 * (vote_nocount/vote_needed), pos_y, mySize_x * 0.5, mySize_y);
+ drawpic_skin(pos + eY * (5/8) * mySize_y, "voteprogress_prog", eX * mySize_x + eY * (3/8) * mySize_y, '1 1 1', a, DRAWFLAG_NORMAL);
+ }
drawresetcliparea();