diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /game/client/hud_msg.cpp | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'game/client/hud_msg.cpp')
| -rw-r--r-- | game/client/hud_msg.cpp | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/game/client/hud_msg.cpp b/game/client/hud_msg.cpp new file mode 100644 index 0000000..e39e43b --- /dev/null +++ b/game/client/hud_msg.cpp @@ -0,0 +1,58 @@ +//========= Copyright Valve Corporation, All rights reserved. ============// +// +// Purpose: +// +// $NoKeywords: $ +// +//=============================================================================// +// +// hud_msg.cpp +// +#include "cbase.h" +#include "clientmode.h" +#include "hudelement.h" +#include "KeyValues.h" +#include "vgui_controls/AnimationController.h" +#include "engine/IEngineSound.h" +#include <bitbuf.h> + +// memdbgon must be the last include file in a .cpp file!!! +#include "tier0/memdbgon.h" + +/// USER-DEFINED SERVER MESSAGE HANDLERS + +void CHud::MsgFunc_ResetHUD( bf_read &msg ) +{ + ResetHUD(); +} + +void CHud::ResetHUD() +{ + // clear all hud data + g_pClientMode->GetViewportAnimationController()->CancelAllAnimations(); + + for ( int i = 0; i < m_HudList.Size(); i++ ) + { + m_HudList[i]->Reset(); + } + + g_pClientMode->GetViewportAnimationController()->RunAllAnimationsToCompletion(); +#ifndef _XBOX + // reset sensitivity + m_flMouseSensitivity = 0; + m_flMouseSensitivityFactor = 0; +#endif +} + +//----------------------------------------------------------------------------- +// Purpose: +//----------------------------------------------------------------------------- + +void CHud::MsgFunc_SendAudio( bf_read &msg ) +{ + char szString[2048]; + msg.ReadString( szString, sizeof(szString) ); + + CLocalPlayerFilter filter; + C_BaseEntity::EmitSound( filter, SOUND_FROM_LOCAL_PLAYER, szString ); +} |