X-Git-Url: http://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fchat.qc;h=5f309d0b0224bd4c019f9f4d51b29a9f851368a9;hb=5a95a7be13adcf53cc5aedb89ac41c5416fb4304;hp=f3655e940107f101933d096b791a60239b1652f9;hpb=7785114f6fb42a3a52c39413bf6e725607d338b2;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/chat.qc b/qcsrc/client/hud/panel/chat.qc index f3655e940..5f309d0b0 100644 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@ -1,5 +1,9 @@ #include "chat.qh" +#include +#include +#include + // Chat (#12) void HUD_Chat() @@ -44,9 +48,7 @@ void HUD_Chat() panel_bg = strcat(hud_skin_path, "/border_default"); if(precache_pic(panel_bg) == "") panel_bg = "gfx/hud/default/border_default"; - if(panel.current_panel_bg) - strunzone(panel.current_panel_bg); - panel.current_panel_bg = strzone(panel_bg); + strcpy(panel.current_panel_bg, panel_bg); chat_panel_modified = true; } panel_bg_alpha = max(0.75, panel_bg_alpha); @@ -77,17 +79,13 @@ void HUD_Chat() if(autocvar__hud_configure) { - vector chatsize; - chatsize = '1 1 0' * autocvar_con_chatsize; + vector chatsize = '1 1 0' * autocvar_con_chatsize; cvar_set("con_chatrect_x", "9001"); // over 9000, we'll fake it instead for more control over alpha and such - float i, a; - for(i = 0; i < autocvar_con_chat; ++i) + string str = textShortenToWidth(_("^3Player^7: This is the chat area."), mySize.x, chatsize, stringwidth_colors); + for(int i = 0; i < autocvar_con_chat; ++i) { - if(i == autocvar_con_chat - 1) - a = panel_fg_alpha; - else - a = panel_fg_alpha * floor(((i + 1) * 7 + autocvar_con_chattime)/45); - drawcolorcodedstring(pos, textShortenToWidth(_("^3Player^7: This is the chat area."), mySize.x, chatsize, stringwidth_colors), chatsize, a, DRAWFLAG_NORMAL); + // engine displays chat text at full alpha + drawcolorcodedstring(pos, str, chatsize, 1, DRAWFLAG_NORMAL); pos.y += chatsize.y; } }