Client: added cvar cl_chat_enabled, which supresses chat notifications.

Spraylogos: Fix blendFunc
VGUI: Add method Visible() for CUIWindow
This commit is contained in:
Marco Cawthorne 2022-04-22 12:00:04 -07:00
parent 7395b8d421
commit 1d216918e1
Signed by: eukara
GPG Key ID: C196CD8BA993248A
3 changed files with 19 additions and 2 deletions

View File

@ -14,6 +14,8 @@
* OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
var bool autocvar_cl_chat_enabled = true;
#define CHAT_LINES 5
#define CHAT_TIME 5
@ -56,6 +58,9 @@ Chat_Draw(void)
Font_DrawText(temppos + [0,16], tempstr, g_fntChat);
}
if (autocvar_cl_chat_enabled == false)
return;
g_chatpos[0] = g_hudmins[0] + 16;
g_chatpos[1] = g_hudmins[1] + g_hudres[1] - 128;
@ -100,6 +105,11 @@ Chat_Parse(string msg)
}
g_chattime = time + CHAT_TIME;
/* we need to be silent */
if (autocvar_cl_chat_enabled == false)
return;
localsound("misc/talk.wav");
/* log to client console */

View File

@ -105,7 +105,7 @@ const string g_spray_mat = \
"polygonOffset\n" \
"{\n" \
"map $rt:%s\n" \
"blendfunc GL_DST_COLOR GL_ZERO\n" \
"blendfunc GL_DST_COLOR GL_ONE\n" \
"rgbGen vertex\n" \
"}\n" \
"}";

View File

@ -59,7 +59,8 @@ class CUIWindow:CUIWidget
virtual void(void(void) vFunc) CallOnResize;
virtual void(void(void) vFunc) CallOnMove;
virtual bool(void) Visible;
virtual void(void) Draw;
virtual void(void) Hide;
virtual void(float, float, float, float) Input;
@ -87,6 +88,12 @@ void CUIWindow::CUIWindow(void)
SetSize([320,240]);
}
bool
CUIWindow::Visible(void)
{
return (m_iFlags & WINDOW_VISIBLE) ? true : false;
}
void CUIWindow::SetTitle (string strName)
{
m_strTitle = strName;