From 39ed87570bdb2f86969d4be821c94b722dc71179 Mon Sep 17 00:00:00 2001 From: Joe Ludwig Date: Wed, 26 Jun 2013 15:22:04 -0700 Subject: First version of the SOurce SDK 2013 --- mp/src/game/client/hud_msg.cpp | 58 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 mp/src/game/client/hud_msg.cpp (limited to 'mp/src/game/client/hud_msg.cpp') diff --git a/mp/src/game/client/hud_msg.cpp b/mp/src/game/client/hud_msg.cpp new file mode 100644 index 00000000..ea20b0b0 --- /dev/null +++ b/mp/src/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 + +// 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 ); +} -- cgit v1.2.3