summaryrefslogtreecommitdiff
path: root/game/client/hl2mp/hl2mp_hud_chat.cpp
diff options
context:
space:
mode:
authorFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
committerFluorescentCIAAfricanAmerican <[email protected]>2020-04-22 12:56:21 -0400
commit3bf9df6b2785fa6d951086978a3e66f49427166a (patch)
tree2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/hl2mp/hl2mp_hud_chat.cpp
downloadarchived-source-engine-2018-hl2-src-master.tar.xz
archived-source-engine-2018-hl2-src-master.zip
Diffstat (limited to 'game/client/hl2mp/hl2mp_hud_chat.cpp')
-rw-r--r--game/client/hl2mp/hl2mp_hud_chat.cpp116
1 files changed, 116 insertions, 0 deletions
diff --git a/game/client/hl2mp/hl2mp_hud_chat.cpp b/game/client/hl2mp/hl2mp_hud_chat.cpp
new file mode 100644
index 0000000..67f4714
--- /dev/null
+++ b/game/client/hl2mp/hl2mp_hud_chat.cpp
@@ -0,0 +1,116 @@
+//========= Copyright Valve Corporation, All rights reserved. ============//
+//
+// Purpose:
+//
+//=============================================================================//
+
+#include "cbase.h"
+#include "hl2mp_hud_chat.h"
+#include "hud_macros.h"
+#include "text_message.h"
+#include "vguicenterprint.h"
+#include "vgui/ILocalize.h"
+#include "c_team.h"
+#include "c_playerresource.h"
+#include "c_hl2mp_player.h"
+#include "hl2mp_gamerules.h"
+#include "ihudlcd.h"
+
+
+
+DECLARE_HUDELEMENT( CHudChat );
+
+DECLARE_HUD_MESSAGE( CHudChat, SayText );
+DECLARE_HUD_MESSAGE( CHudChat, SayText2 );
+DECLARE_HUD_MESSAGE( CHudChat, TextMsg );
+
+
+//=====================
+//CHudChatLine
+//=====================
+
+void CHudChatLine::ApplySchemeSettings(vgui::IScheme *pScheme)
+{
+ BaseClass::ApplySchemeSettings( pScheme );
+}
+
+//=====================
+//CHudChatInputLine
+//=====================
+
+void CHudChatInputLine::ApplySchemeSettings(vgui::IScheme *pScheme)
+{
+ BaseClass::ApplySchemeSettings(pScheme);
+}
+
+//=====================
+//CHudChat
+//=====================
+
+CHudChat::CHudChat( const char *pElementName ) : BaseClass( pElementName )
+{
+
+}
+
+void CHudChat::CreateChatInputLine( void )
+{
+ m_pChatInput = new CHudChatInputLine( this, "ChatInputLine" );
+ m_pChatInput->SetVisible( false );
+}
+
+void CHudChat::CreateChatLines( void )
+{
+ m_ChatLine = new CHudChatLine( this, "ChatLine1" );
+ m_ChatLine->SetVisible( false );
+}
+
+void CHudChat::ApplySchemeSettings( vgui::IScheme *pScheme )
+{
+ BaseClass::ApplySchemeSettings( pScheme );
+}
+
+
+void CHudChat::Init( void )
+{
+ BaseClass::Init();
+
+ HOOK_HUD_MESSAGE( CHudChat, SayText );
+ HOOK_HUD_MESSAGE( CHudChat, SayText2 );
+ HOOK_HUD_MESSAGE( CHudChat, TextMsg );
+}
+
+//-----------------------------------------------------------------------------
+// Purpose: Overrides base reset to not cancel chat at round restart
+//-----------------------------------------------------------------------------
+void CHudChat::Reset( void )
+{
+}
+
+int CHudChat::GetChatInputOffset( void )
+{
+ if ( m_pChatInput->IsVisible() )
+ {
+ return m_iFontHeight;
+ }
+ else
+ return 0;
+}
+
+Color CHudChat::GetClientColor( int clientIndex )
+{
+ if ( clientIndex == 0 ) // console msg
+ {
+ return g_ColorYellow;
+ }
+ else if( g_PR )
+ {
+ switch ( g_PR->GetTeam( clientIndex ) )
+ {
+ case TEAM_COMBINE : return g_ColorBlue;
+ case TEAM_REBELS : return g_ColorRed;
+ default : return g_ColorYellow;
+ }
+ }
+
+ return g_ColorYellow;
+} \ No newline at end of file