case WEP_HLAC: return 3;
case WEP_MINSTANEX: return 3;
case WEP_NEX: return 3;
- case WEP_SNIPERRIFLE: return 1;
+ case WEP_RIFLE: return 1;
case WEP_HAGAR: return 2;
case WEP_ROCKET_LAUNCHER: return 2;
case WEP_SEEKER: return 2;
} else if(msg == MSG_KILL) {
w = DEATH_WEAPONOF(type);
if(WEP_VALID(w)) {
- if((w == WEP_SNIPERRIFLE || w == WEP_MINSTANEX) && type & HITTYPE_HEADSHOT) // all headshot weapons go here
+ if((w == WEP_RIFLE || 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);
entries = bound(1, floor(panel_size_y/height), CENTERPRINT_MAX_ENTRIES);
float i, j, k, n;
- float a, sz, fade, align;
+ float a, sz, fade, align, next_msg_pos_y;
vector pos;
string ts;
pos = panel_pos;
+ if (autocvar_hud_panel_centerprint_flip)
+ pos_y += panel_size_y - fontsize_y;
fade = min(autocvar_hud_panel_centerprint_time/8, 0.25);
align = bound(0, autocvar_hud_panel_centerprint_align, 1);
for (i=0, j=cpm_index; i<CENTERPRINT_MAX_MSGS; ++i, ++j)
drawfontscale = sz * '1 1 0';
n = tokenizebyseparator(centerprint_messages[j], "\n");
+ if (autocvar_hud_panel_centerprint_flip)
+ {
+ // check if the message can be entirely shown
+ for(k = 0; k < n; ++k)
+ {
+ getWrappedLine_remaining = argv(k);
+ ts = getWrappedLine(panel_size_x, fontsize, stringwidth_colors);
+ if (ts != "")
+ pos_y -= fontsize_y * 1.5;
+ else
+ pos_y -= fontsize_y;
+ if (pos_y < panel_pos_y) // check if the next line can be shown
+ return;
+ }
+ next_msg_pos_y = pos_y; // save pos of the next message
+ }
+
for(k = 0; k < n; ++k)
{
getWrappedLine_remaining = argv(k);
}
else
pos_y += fontsize_y;
- if (pos_y > panel_pos_y + panel_size_y - fontsize_y)
+ if (pos_y > panel_pos_y + panel_size_y - fontsize_y) // check if the next line can be shown
{
drawfontscale = '1 1 0';
return;
}
}
}
- if (a < 1)
- pos_y -= 1.5 * fontsize_y * (1 - a*a);
+ if (autocvar_hud_panel_centerprint_flip)
+ {
+ pos_y = next_msg_pos_y;
+ if (a < 1)
+ pos_y += 1.5 * fontsize_y * (1 - a*a);
+ }
+ else
+ {
+ if (a < 1)
+ pos_y -= 1.5 * fontsize_y * (1 - a*a);
+ }
drawfontscale = '1 1 0';
}
}