mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 20:16:10 +08:00
Added original SDK code for Alien Swarm.
This commit is contained in:
58
game/client/hud_msg.cpp
Normal file
58
game/client/hud_msg.cpp
Normal file
@ -0,0 +1,58 @@
|
||||
//========= Copyright <20> 1996-2005, 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
|
||||
GetClientMode()->GetViewportAnimationController()->CancelAllAnimations();
|
||||
|
||||
for ( int i = 0; i < GetHudList().Count(); i++ )
|
||||
{
|
||||
GetHudList()[i]->Reset();
|
||||
}
|
||||
|
||||
GetClientMode()->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 );
|
||||
}
|
Reference in New Issue
Block a user