2005-03-09 01:31:56 +00:00
|
|
|
/***
|
|
|
|
*
|
|
|
|
* Copyright (c) 1999, Valve LLC. All rights reserved.
|
|
|
|
*
|
|
|
|
* This product contains software technology licensed from Id
|
|
|
|
* Software, Inc. ("Id Technology"). Id Technology (c) 1996 Id Software, Inc.
|
|
|
|
* All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Use, distribution, and modification of this source code and/or resulting
|
|
|
|
* object code is restricted to non-commercial enhancements to products from
|
|
|
|
* Valve LLC. All other use, distribution, or modification is prohibited
|
|
|
|
* without written permission from Valve LLC.
|
|
|
|
*
|
|
|
|
****/
|
|
|
|
//
|
|
|
|
// hud_msg.cpp
|
|
|
|
//
|
|
|
|
|
|
|
|
#include "hud.h"
|
|
|
|
#include "cl_util.h"
|
2005-04-01 03:04:57 +00:00
|
|
|
#include "common/r_efx.h"
|
|
|
|
#include "mod/AvHNetworkMessages.h"
|
2005-03-09 01:31:56 +00:00
|
|
|
|
2005-04-10 19:58:13 +00:00
|
|
|
// tankefugl: duck toggle
|
|
|
|
extern bool g_bDuckToggled;
|
|
|
|
// :tankefugl
|
|
|
|
|
2005-03-09 01:31:56 +00:00
|
|
|
#define MAX_CLIENTS 32
|
|
|
|
|
|
|
|
#if !defined( _TFC )
|
|
|
|
extern BEAM *pBeam;
|
|
|
|
extern BEAM *pBeam2;
|
|
|
|
#endif
|
|
|
|
/// USER-DEFINED SERVER MESSAGE HANDLERS
|
|
|
|
|
|
|
|
int CHud :: MsgFunc_ResetHUD(const char *pszName, int iSize, void *pbuf )
|
|
|
|
{
|
2005-04-01 03:04:57 +00:00
|
|
|
NetMsg_ResetHUD( pbuf, iSize );
|
2005-03-09 01:31:56 +00:00
|
|
|
|
|
|
|
// clear all hud data
|
|
|
|
HUDLIST *pList = m_pHudList;
|
|
|
|
|
|
|
|
while ( pList )
|
|
|
|
{
|
|
|
|
if ( pList->p )
|
|
|
|
pList->p->Reset();
|
|
|
|
pList = pList->pNext;
|
|
|
|
}
|
|
|
|
|
|
|
|
// reset sensitivity
|
|
|
|
m_flMouseSensitivity = 0;
|
|
|
|
|
2005-04-10 19:58:13 +00:00
|
|
|
// tankefugl: duck toggle
|
|
|
|
g_bDuckToggled = false;
|
|
|
|
// :tankefugl
|
|
|
|
|
2005-04-01 03:04:57 +00:00
|
|
|
return 0;
|
2005-03-09 01:31:56 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void CAM_ToFirstPerson(void);
|
|
|
|
void CHud :: MsgFunc_ViewMode( const char *pszName, int iSize, void *pbuf )
|
|
|
|
{
|
|
|
|
CAM_ToFirstPerson();
|
|
|
|
}
|
|
|
|
|
|
|
|
void CHud :: MsgFunc_InitHUD( const char *pszName, int iSize, void *pbuf )
|
|
|
|
{
|
|
|
|
// prepare all hud data
|
|
|
|
HUDLIST *pList = m_pHudList;
|
|
|
|
|
|
|
|
while (pList)
|
|
|
|
{
|
|
|
|
if ( pList->p )
|
|
|
|
pList->p->InitHUDData();
|
|
|
|
pList = pList->pNext;
|
|
|
|
}
|
2005-04-01 03:04:57 +00:00
|
|
|
}
|