NS/dev/tankefugl/source/cl_dll/hud_msg.cpp
tankefugl 47dc455006 Mantis 0001012:
o Duck toggle implemented
- bind toggleduck to a key to use
- while duck is toggled, pressing +duck will unduck and releasing will revert the player to a ducked state

git-svn-id: https://unknownworlds.svn.cloudforge.com/ns1@54 67975925-1194-0748-b3d5-c16f83f1a3a1
2005-04-10 21:53:00 +00:00

77 lines
No EOL
1.6 KiB
C++

/***
*
* 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"
#include "common/r_efx.h"
#include "mod/AvHNetworkMessages.h"
// tankefugl: duck toggle
extern bool g_bDuckToggled;
// :tankefugl
#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 )
{
NetMsg_ResetHUD( pbuf, iSize );
// clear all hud data
HUDLIST *pList = m_pHudList;
while ( pList )
{
if ( pList->p )
pList->p->Reset();
pList = pList->pNext;
}
// reset sensitivity
m_flMouseSensitivity = 0;
// tankefugl: duck toggle
g_bDuckToggled = false;
// :tankefugl
return 0;
}
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;
}
}