X-Git-Url: http://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fclient%2Fhud%2Fpanel%2Fchat.qc;h=74d4b6d0f49462f522298e276770244dc54e278a;hb=5149aaa004721dba4947df89026a1c4b59506122;hp=5817142ae609d79ab7359fb5b91a7f4354fa1faa;hpb=05ee5b1212a6537e5c5acb76dbc1ef9df40f85c6;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/client/hud/panel/chat.qc b/qcsrc/client/hud/panel/chat.qc index 5817142ae..74d4b6d0f 100644 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@ -1,5 +1,11 @@ #include "chat.qh" -/** Handle chat as a panel (#12) */ + +#include +#include +#include + +// Chat (#12) + void HUD_Chat() { if(!autocvar__hud_configure) @@ -21,7 +27,7 @@ void HUD_Chat() } } - HUD_Panel_UpdateCvars(); + HUD_Panel_LoadCvars(); if(intermission == 2) { @@ -56,7 +62,7 @@ void HUD_Chat() // chat messages don't scale properly since they are displayed directly by the engine HUD_Scale_Disable(); - HUD_Panel_DrawBg(1); + HUD_Panel_DrawBg(); if(panel_bg_padding) { @@ -75,17 +81,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; } }