mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-09 18:29:35 +00:00
add source-sdk-2013
This commit is contained in:
@@ -13,7 +13,6 @@
|
||||
#include <KeyValues.h>
|
||||
#include "filesystem.h"
|
||||
#include "iinput.h"
|
||||
#include "inputsystem/iinputsystem.h"
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
@@ -102,7 +101,6 @@ void CBaseHudWeaponSelection::Reset(void)
|
||||
// Start hidden
|
||||
m_bSelectionVisible = false;
|
||||
m_flSelectionTime = gpGlobals->curtime;
|
||||
gHUD.UnlockRenderGroup( gHUD.LookupRenderGroupIndexByName( "weapon_selection" ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -156,19 +154,13 @@ void CBaseHudWeaponSelection::ProcessInput()
|
||||
if ( !pPlayer )
|
||||
return;
|
||||
|
||||
int nFastswitchMode = hud_fastswitch.GetInt();
|
||||
if ( ::input->IsSteamControllerActive() )
|
||||
{
|
||||
nFastswitchMode = HUDTYPE_FASTSWITCH;
|
||||
}
|
||||
|
||||
// Check to see if the player is in VGUI mode...
|
||||
if ( pPlayer->IsInVGuiInputMode() && !pPlayer->IsInViewModelVGuiInputMode() )
|
||||
{
|
||||
// If so, close weapon selection when they press fire
|
||||
if ( gHUD.m_iKeyBits & IN_ATTACK )
|
||||
{
|
||||
if ( HUDTYPE_PLUS != nFastswitchMode )
|
||||
if ( HUDTYPE_PLUS != hud_fastswitch.GetInt() )
|
||||
{
|
||||
// Swallow the button
|
||||
gHUD.m_iKeyBits &= ~IN_ATTACK;
|
||||
@@ -186,7 +178,7 @@ void CBaseHudWeaponSelection::ProcessInput()
|
||||
if ( IsWeaponSelectable() )
|
||||
{
|
||||
#ifndef TF_CLIENT_DLL
|
||||
if ( HUDTYPE_PLUS != nFastswitchMode )
|
||||
if ( HUDTYPE_PLUS != hud_fastswitch.GetInt() )
|
||||
#endif
|
||||
{
|
||||
// Swallow the button
|
||||
@@ -215,7 +207,6 @@ bool CBaseHudWeaponSelection::IsInSelectionMode()
|
||||
void CBaseHudWeaponSelection::OpenSelection( void )
|
||||
{
|
||||
m_bSelectionVisible = true;
|
||||
gHUD.LockRenderGroup( gHUD.LookupRenderGroupIndexByName( "weapon_selection" ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -224,7 +215,6 @@ void CBaseHudWeaponSelection::OpenSelection( void )
|
||||
void CBaseHudWeaponSelection::HideSelection( void )
|
||||
{
|
||||
m_bSelectionVisible = false;
|
||||
gHUD.UnlockRenderGroup( gHUD.LookupRenderGroupIndexByName( "weapon_selection" ) );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
@@ -232,14 +222,8 @@ void CBaseHudWeaponSelection::HideSelection( void )
|
||||
//-----------------------------------------------------------------------------
|
||||
bool CBaseHudWeaponSelection::CanBeSelectedInHUD( C_BaseCombatWeapon *pWeapon )
|
||||
{
|
||||
int nFastswitchMode = hud_fastswitch.GetInt();
|
||||
if ( ::input->IsSteamControllerActive() )
|
||||
{
|
||||
nFastswitchMode = HUDTYPE_FASTSWITCH;
|
||||
}
|
||||
|
||||
// Xbox: In plus type, weapons without ammo can still be selected in the HUD
|
||||
if( HUDTYPE_PLUS == nFastswitchMode )
|
||||
if( HUDTYPE_PLUS == hud_fastswitch.GetInt() )
|
||||
{
|
||||
return pWeapon->VisibleInWeaponSelection();
|
||||
}
|
||||
@@ -295,13 +279,7 @@ void CBaseHudWeaponSelection::OnWeaponPickup( C_BaseCombatWeapon *pWeapon )
|
||||
//------------------------------------------------------------------------
|
||||
void CBaseHudWeaponSelection::UserCmd_Slot1(void)
|
||||
{
|
||||
int nFastswitchMode = hud_fastswitch.GetInt();
|
||||
if ( ::input->IsSteamControllerActive() )
|
||||
{
|
||||
nFastswitchMode = HUDTYPE_FASTSWITCH;
|
||||
}
|
||||
|
||||
if( HUDTYPE_CAROUSEL == nFastswitchMode )
|
||||
if( HUDTYPE_CAROUSEL == hud_fastswitch.GetInt() )
|
||||
{
|
||||
UserCmd_LastWeapon();
|
||||
}
|
||||
@@ -313,13 +291,7 @@ void CBaseHudWeaponSelection::UserCmd_Slot1(void)
|
||||
|
||||
void CBaseHudWeaponSelection::UserCmd_Slot2(void)
|
||||
{
|
||||
int nFastswitchMode = hud_fastswitch.GetInt();
|
||||
if ( ::input->IsSteamControllerActive() )
|
||||
{
|
||||
nFastswitchMode = HUDTYPE_FASTSWITCH;
|
||||
}
|
||||
|
||||
if( HUDTYPE_CAROUSEL == nFastswitchMode )
|
||||
if( HUDTYPE_CAROUSEL == hud_fastswitch.GetInt() )
|
||||
{
|
||||
UserCmd_NextWeapon();
|
||||
}
|
||||
@@ -331,13 +303,7 @@ void CBaseHudWeaponSelection::UserCmd_Slot2(void)
|
||||
|
||||
void CBaseHudWeaponSelection::UserCmd_Slot3(void)
|
||||
{
|
||||
int nFastswitchMode = hud_fastswitch.GetInt();
|
||||
if ( ::input->IsSteamControllerActive() )
|
||||
{
|
||||
nFastswitchMode = HUDTYPE_FASTSWITCH;
|
||||
}
|
||||
|
||||
if( HUDTYPE_CAROUSEL == nFastswitchMode )
|
||||
if( HUDTYPE_CAROUSEL == hud_fastswitch.GetInt() )
|
||||
{
|
||||
engine->ClientCmd( "phys_swap" );
|
||||
}
|
||||
@@ -349,13 +315,7 @@ void CBaseHudWeaponSelection::UserCmd_Slot3(void)
|
||||
|
||||
void CBaseHudWeaponSelection::UserCmd_Slot4(void)
|
||||
{
|
||||
int nFastswitchMode = hud_fastswitch.GetInt();
|
||||
if ( ::input->IsSteamControllerActive() )
|
||||
{
|
||||
nFastswitchMode = HUDTYPE_FASTSWITCH;
|
||||
}
|
||||
|
||||
if( HUDTYPE_CAROUSEL == nFastswitchMode )
|
||||
if( HUDTYPE_CAROUSEL == hud_fastswitch.GetInt() )
|
||||
{
|
||||
UserCmd_PrevWeapon();
|
||||
}
|
||||
@@ -475,14 +435,8 @@ void CBaseHudWeaponSelection::UserCmd_NextWeapon(void)
|
||||
if ( !BaseClass::ShouldDraw() )
|
||||
return;
|
||||
|
||||
int nFastswitchMode = hud_fastswitch.GetInt();
|
||||
if ( ::input->IsSteamControllerActive() )
|
||||
{
|
||||
nFastswitchMode = HUDTYPE_FASTSWITCH;
|
||||
}
|
||||
|
||||
CycleToNextWeapon();
|
||||
if( nFastswitchMode > 0 )
|
||||
if( hud_fastswitch.GetInt() > 0 )
|
||||
{
|
||||
SelectWeapon();
|
||||
}
|
||||
@@ -498,14 +452,9 @@ void CBaseHudWeaponSelection::UserCmd_PrevWeapon(void)
|
||||
if ( !BaseClass::ShouldDraw() )
|
||||
return;
|
||||
|
||||
int nFastswitchMode = hud_fastswitch.GetInt();
|
||||
if ( ::input->IsSteamControllerActive() )
|
||||
{
|
||||
nFastswitchMode = HUDTYPE_FASTSWITCH;
|
||||
}
|
||||
|
||||
CycleToPrevWeapon();
|
||||
if( nFastswitchMode > 0 )
|
||||
|
||||
if( hud_fastswitch.GetInt() > 0 )
|
||||
{
|
||||
SelectWeapon();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user