7 if(!autocvar__hud_configure)
9 if (!autocvar_hud_panel_chat)
11 if (!autocvar_con_chatrect)
12 cvar_set("con_chatrect", "0");
15 if(autocvar__con_chat_maximized)
17 if(!hud_draw_maximized) return;
19 else if(chat_panel_modified)
21 panel.update_time = time; // forces reload of panel attributes
22 chat_panel_modified = false;
26 HUD_Panel_LoadCvars();
30 // reserve some more space to the mapvote panel
31 // by resizing and moving chat panel to the bottom
32 panel_size.y = min(panel_size.y, vid_conheight * 0.2);
33 panel_pos.y = vid_conheight - panel_size.y - panel_bg_border * 2;
34 chat_posy = panel_pos.y;
35 chat_sizey = panel_size.y;
37 if(autocvar__con_chat_maximized && !autocvar__hud_configure) // draw at full screen height if maximized
39 panel_pos.y = panel_bg_border;
40 panel_size.y = vid_conheight - panel_bg_border * 2;
41 if(panel.current_panel_bg == "0") // force a border when maximized
44 panel_bg = strcat(hud_skin_path, "/border_default");
45 if(precache_pic(panel_bg) == "")
46 panel_bg = "gfx/hud/default/border_default";
47 if(panel.current_panel_bg)
48 strunzone(panel.current_panel_bg);
49 panel.current_panel_bg = strzone(panel_bg);
50 chat_panel_modified = true;
52 panel_bg_alpha = max(0.75, panel_bg_alpha);
59 // chat messages don't scale properly since they are displayed directly by the engine
65 pos += '1 1 0' * panel_bg_padding;
66 mySize -= '2 2 0' * panel_bg_padding;
69 if (!autocvar_con_chatrect)
70 cvar_set("con_chatrect", "1");
72 cvar_set("con_chatrect_x", ftos(pos.x/vid_conwidth));
73 cvar_set("con_chatrect_y", ftos(pos.y/vid_conheight));
75 cvar_set("con_chatwidth", ftos(mySize.x/vid_conwidth));
76 cvar_set("con_chat", ftos(floor(mySize.y/autocvar_con_chatsize - 0.5)));
78 if(autocvar__hud_configure)
80 vector chatsize = '1 1 0' * autocvar_con_chatsize;
81 cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such
82 string str = textShortenToWidth(_("^3Player^7: This is the chat area."), mySize.x, chatsize, stringwidth_colors);
83 for(int i = 0; i < autocvar_con_chat; ++i)
85 // engine displays chat text at full alpha
86 drawcolorcodedstring(pos, str, chatsize, 1, DRAWFLAG_NORMAL);