mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-09 19:41:36 +00:00
Merge 84d21933b7
into 0565403b15
This commit is contained in:
commit
b096aa301d
4 changed files with 18 additions and 3 deletions
|
@ -43,6 +43,8 @@ public:
|
|||
void Deactivate( CBaseEntity *pActivator );
|
||||
|
||||
float m_flFieldOfView;
|
||||
bool m_bStrict;
|
||||
|
||||
CHandle<CBaseCombatWeapon> m_hSaveWeapon;
|
||||
|
||||
COutputEvent m_playerOn;
|
||||
|
@ -77,6 +79,7 @@ public:
|
|||
BEGIN_DATADESC( CGameUI )
|
||||
|
||||
DEFINE_KEYFIELD( m_flFieldOfView, FIELD_FLOAT, "FieldOfView" ),
|
||||
DEFINE_KEYFIELD( m_bStrict, FIELD_BOOLEAN, "Strict" ),
|
||||
DEFINE_FIELD( m_hSaveWeapon, FIELD_EHANDLE ),
|
||||
DEFINE_FIELD( m_bForceUpdate, FIELD_BOOLEAN ),
|
||||
DEFINE_FIELD( m_player, FIELD_EHANDLE ),
|
||||
|
@ -133,6 +136,8 @@ void CGameUI::Deactivate( CBaseEntity *pActivator )
|
|||
|
||||
if (pPlayer)
|
||||
{
|
||||
if ( m_bStrict )
|
||||
pPlayer->IsUsingGameUI( false );
|
||||
// Re-enable player motion
|
||||
if ( FBitSet( m_spawnflags, SF_GAMEUI_FREEZE_PLAYER ) )
|
||||
{
|
||||
|
@ -218,6 +223,8 @@ void CGameUI::InputActivate( inputdata_t &inputdata )
|
|||
|
||||
// Setup our internal data
|
||||
m_player = pPlayer;
|
||||
if ( m_bStrict )
|
||||
pPlayer->IsUsingGameUI( true );
|
||||
m_playerOn.FireOutput( pPlayer, this, 0 );
|
||||
|
||||
// Turn the hud off
|
||||
|
@ -293,7 +300,6 @@ void CGameUI::Think( void )
|
|||
SetNextThink( gpGlobals->curtime );
|
||||
|
||||
// Deactivate if they jump or press +use.
|
||||
// FIXME: prevent the use from going through in player.cpp
|
||||
if ((( pPlayer->m_afButtonPressed & IN_USE ) && ( m_spawnflags & SF_GAMEUI_USE_DEACTIVATES )) ||
|
||||
(( pPlayer->m_afButtonPressed & IN_JUMP ) && ( m_spawnflags & SF_GAMEUI_JUMP_DEACTIVATES )))
|
||||
{
|
||||
|
|
|
@ -3628,7 +3628,8 @@ void CHL2_Player::ItemPostFrame()
|
|||
if ( m_bPlayUseDenySound )
|
||||
{
|
||||
m_bPlayUseDenySound = false;
|
||||
EmitSound( "HL2Player.UseDeny" );
|
||||
if ( !UsingGameUI() )
|
||||
EmitSound( "HL2Player.UseDeny" );
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -766,6 +766,9 @@ public:
|
|||
float GetFOVDistanceAdjustFactor(); // shared between client and server
|
||||
float GetFOVDistanceAdjustFactorForNetworking();
|
||||
|
||||
bool UsingGameUI() const { return m_bIsUsingGameUI; }
|
||||
void IsUsingGameUI( bool enabled ) { m_bIsUsingGameUI = enabled; }
|
||||
|
||||
int GetImpulse( void ) const { return m_nImpulse; }
|
||||
|
||||
// Movement constraints
|
||||
|
@ -902,7 +905,8 @@ public:
|
|||
bool m_bLagCompensation; // user wants lag compenstation
|
||||
bool m_bPredictWeapons; // user has client side predicted weapons
|
||||
bool m_bRequestPredict; // user has client prediction enabled
|
||||
|
||||
bool m_bIsUsingGameUI;
|
||||
|
||||
float GetDeathTime( void ) { return m_flDeathTime; }
|
||||
|
||||
void ClearZoomOwner( void );
|
||||
|
|
|
@ -1066,6 +1066,10 @@ float IntervalDistance( float x, float x0, float x1 )
|
|||
|
||||
CBaseEntity *CBasePlayer::FindUseEntity()
|
||||
{
|
||||
#ifdef GAME_DLL
|
||||
if ( UsingGameUI() )
|
||||
return NULL;
|
||||
#endif
|
||||
Vector forward, up;
|
||||
EyeVectors( &forward, NULL, &up );
|
||||
|
||||
|
|
Loading…
Reference in a new issue