bool autocvar_cl_unpress_zoom_on_weapon_switch = 1;
bool autocvar_cl_unpress_attack_on_weapon_switch = 1;
bool autocvar_con_chat;
-float autocvar_con_chatpos;
bool autocvar_con_chatrect;
float autocvar_con_chatsize;
float autocvar_con_chattime;
//
void HUD_Chat(void)
{
- //if(intermission == 2) return;
if(!autocvar__hud_configure)
{
if (!autocvar_hud_panel_chat)
HUD_Panel_UpdateCvars();
+ if(intermission == 2)
+ {
+ // reserve some more space to the mapvote panel
+ // by resizing and moving chat panel to the bottom
+ panel_size.y = min(panel_size.y, vid_conheight * 0.2);
+ panel_pos.y = vid_conheight - panel_size.y - panel_bg_border * 2;
+ chat_posy = panel_pos.y;
+ chat_sizey = panel_size.y;
+ }
if(autocvar__con_chat_maximized && !autocvar__hud_configure) // draw at full screen height if maximized
{
panel_pos.y = panel_bg_border;
class(HUDPanel) .void() panel_draw;
+// chat panel can be reduced / moved while the mapvote is active
+// let know the mapvote panel about chat pos and size
+float chat_posy;
+float chat_sizey;
+
float current_player;
float GetPlayerColorForce(int i);
}
center = (vid_conwidth - 1)/2;
- xmin = vid_conwidth*0.05; // 5% border must suffice
+ xmin = vid_conwidth * 0.08;
xmax = vid_conwidth - xmin;
ymin = 20;
- i = autocvar_con_chatpos; // *autocvar_con_chatsize;
- if(i < 0)
- ymax = vid_conheight + (i - autocvar_con_chat) * autocvar_con_chatsize;
- if(i >= 0 || ymax < (vid_conheight*0.5))
- ymax = vid_conheight - ymin;
+ ymax = vid_conheight - ymin;
+
+ if(chat_posy + chat_sizey / 2 < vid_conheight / 2)
+ ymin += chat_sizey;
+ else
+ ymax -= chat_sizey;
hud_fontsize = HUD_GetFontsize("hud_fontsize");
pos.y += hud_fontsize.y * 1.5;
pos.y += hud_fontsize.y * 0.5;
+ HUD_Panel_UpdateCvars();
+
// base for multi-column stuff...
pos.y += hud_fontsize.y;
pos.x = xmin;
ymin = pos.y;
+ float abstain_spacing = panel_bg_border + hud_fontsize.y;
if(mv_abstain)
+ {
mv_num_maps -= 1;
-
- HUD_Panel_UpdateCvars();
+ ymax -= abstain_spacing;
+ }
// higher than the image itself ratio for mapvote items to reserve space for long map names
int item_aspect = (gametypevote) ? 3/1 : 5/3;
if(mv_abstain && i < mv_num_maps) {
tmp = mv_votes[i];
- pos.y = ymax + 2 * hud_fontsize.y;
+ pos.y = ymax + abstain_spacing;
pos.x = (xmax+xmin)*0.5;
MapVote_DrawAbstain(pos, dist.x, xmax - xmin, tmp, i);
}