From d5a9e146b8b37daf4b4eaa5976e893e67c19e823 Mon Sep 17 00:00:00 2001 From: terencehill Date: Thu, 8 Sep 2016 15:57:42 +0200 Subject: [PATCH] Remove some seriously weird code playing with text alpha when it shouldn't from the chat panel --- qcsrc/client/autocvars.qh | 1 - qcsrc/client/hud/panel/chat.qc | 14 +++++--------- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/qcsrc/client/autocvars.qh b/qcsrc/client/autocvars.qh index 25ab0e2a05..9cbbcb5f7e 100644 --- a/qcsrc/client/autocvars.qh +++ b/qcsrc/client/autocvars.qh @@ -100,7 +100,6 @@ bool autocvar_cl_unpress_attack_on_weapon_switch = 1; bool autocvar_con_chat; bool autocvar_con_chatrect; float autocvar_con_chatsize; -float autocvar_con_chattime; float autocvar_con_notify; float autocvar_con_notifysize; string autocvar_crosshair; diff --git a/qcsrc/client/hud/panel/chat.qc b/qcsrc/client/hud/panel/chat.qc index f3655e9401..554f44e17e 100644 --- a/qcsrc/client/hud/panel/chat.qc +++ b/qcsrc/client/hud/panel/chat.qc @@ -77,17 +77,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; } } -- 2.39.2