mirror of
https://github.com/ValveSoftware/source-sdk-2013.git
synced 2025-04-08 11:01:33 +00:00
Revert "Fixing VGUI screens"
This commit is contained in:
parent
db5edf6a49
commit
2d4e018032
15 changed files with 71 additions and 594 deletions
|
@ -5469,8 +5469,6 @@ void CPropDoorRotating::InputSetSpeed(inputdata_t &inputdata)
|
|||
DoorResume();
|
||||
}
|
||||
|
||||
LINK_ENTITY_TO_CLASS( prop_sphere, CPhysSphere );
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------------------------ //
|
||||
// Special version of func_physbox.
|
||||
|
|
|
@ -1059,7 +1059,7 @@ void C_BasePlayer::DetermineVguiInputMode( CUserCmd *pCmd )
|
|||
SetVGuiScreenButtonState( m_pCurrentVguiScreen.Get(), pCmd->buttons );
|
||||
|
||||
// Kill all attack inputs if we're in vgui screen mode
|
||||
pCmd->buttons &= ~(IN_ATTACK | IN_ATTACK2 | IN_VALIDVGUIINPUT);
|
||||
pCmd->buttons &= ~(IN_ATTACK | IN_ATTACK2);
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1129,7 +1129,7 @@ void C_BasePlayer::DetermineVguiInputMode( CUserCmd *pCmd )
|
|||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Input handling
|
||||
//-----------------------------------------------------------------------------
|
||||
bool C_BasePlayer::CreateMove( float flInputSampleTime, CUserCmd *pCmd, bool bVguiUpdate )
|
||||
bool C_BasePlayer::CreateMove( float flInputSampleTime, CUserCmd *pCmd )
|
||||
{
|
||||
// Allow the vehicle to clamp the view angles
|
||||
if ( IsInAVehicle() )
|
||||
|
@ -1183,27 +1183,7 @@ bool C_BasePlayer::CreateMove( float flInputSampleTime, CUserCmd *pCmd, bool bVg
|
|||
m_vecOldViewAngles = pCmd->viewangles;
|
||||
|
||||
// Check to see if we're in vgui input mode...
|
||||
if ( pCmd->buttons & IN_VALIDVGUIINPUT )
|
||||
{
|
||||
if (bVguiUpdate)
|
||||
{
|
||||
bool tempvguimode = IsInVGuiInputMode();
|
||||
// Check to see if we're in vgui input mode...
|
||||
DetermineVguiInputMode( pCmd );
|
||||
|
||||
if (tempvguimode == !IsInVGuiInputMode())
|
||||
{
|
||||
if (IsInVGuiInputMode())
|
||||
{
|
||||
engine->ClientCmd( "vguimode_true" );
|
||||
}
|
||||
else
|
||||
{
|
||||
engine->ClientCmd( "vguimode_false" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
DetermineVguiInputMode( pCmd );
|
||||
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -47,7 +47,6 @@ CLIENTEFFECT_REGISTER_END()
|
|||
// This is a cache of preloaded keyvalues.
|
||||
// ----------------------------------------------------------------------------- //
|
||||
|
||||
CUtlVector<C_VGuiScreen*> g_pVGUIScreens;
|
||||
CUtlDict<KeyValues*, int> g_KeyValuesCache;
|
||||
|
||||
KeyValues* CacheKeyValuesForFile( const char *pFilename )
|
||||
|
@ -103,15 +102,11 @@ C_VGuiScreen::C_VGuiScreen()
|
|||
|
||||
m_WriteZMaterial.Init( "engine/writez", TEXTURE_GROUP_VGUI );
|
||||
m_OverlayMaterial.Init( m_WriteZMaterial );
|
||||
|
||||
g_pVGUIScreens.AddToTail( this );
|
||||
}
|
||||
|
||||
C_VGuiScreen::~C_VGuiScreen()
|
||||
{
|
||||
DestroyVguiScreen();
|
||||
|
||||
g_pVGUIScreens.FindAndRemove( this );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
@ -422,7 +417,7 @@ void C_VGuiScreen::ClientThink( void )
|
|||
int py = (int)(v * m_nPixelHeight + 0.5f);
|
||||
|
||||
// Generate mouse input commands
|
||||
/* if ((px != m_nOldPx) || (py != m_nOldPy))
|
||||
if ((px != m_nOldPx) || (py != m_nOldPy))
|
||||
{
|
||||
g_InputInternal->InternalCursorMoved( px, py );
|
||||
m_nOldPx = px;
|
||||
|
@ -448,23 +443,6 @@ void C_VGuiScreen::ClientThink( void )
|
|||
{
|
||||
g_InputInternal->SetMouseCodeState( MOUSE_RIGHT, vgui::BUTTON_RELEASED );
|
||||
g_InputInternal->InternalMouseReleased( MOUSE_RIGHT );
|
||||
}*/
|
||||
|
||||
for (int i = 0; i < pPanel->GetChildCount(); i++)
|
||||
{
|
||||
vgui::Button *child = dynamic_cast<vgui::Button*>(pPanel->GetChild(i));
|
||||
if ( child )
|
||||
{
|
||||
int x1, x2, y1, y2;
|
||||
child->GetBounds( x1, y1, x2, y2 );
|
||||
|
||||
// Generate mouse input commands
|
||||
if ( (m_nButtonState & IN_ATTACK) )
|
||||
{
|
||||
if ( px >= x1 && px <= x1 + x2 && py >= y1 && py <= y1 + y2 )
|
||||
child->FireActionSignal();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ( m_bLoseThinkNextFrame == true )
|
||||
|
@ -707,89 +685,86 @@ C_BaseEntity *FindNearbyVguiScreen( const Vector &viewPosition, const QAngle &vi
|
|||
// X360TBD: Turn this on if feature actually used
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
C_BasePlayer *pLocalPlayer = C_BasePlayer::GetLocalPlayer();
|
||||
|
||||
|
||||
Assert( pLocalPlayer );
|
||||
|
||||
|
||||
if ( !pLocalPlayer )
|
||||
return NULL;
|
||||
|
||||
|
||||
// Get the view direction...
|
||||
Vector lookDir;
|
||||
AngleVectors( viewAngle, &lookDir );
|
||||
|
||||
|
||||
// Create a ray used for raytracing
|
||||
Vector lookEnd;
|
||||
VectorMA( viewPosition, 2.0f * VGUI_SCREEN_MODE_RADIUS, lookDir, lookEnd );
|
||||
|
||||
|
||||
Ray_t lookRay;
|
||||
lookRay.Init( viewPosition, lookEnd );
|
||||
|
||||
|
||||
|
||||
// Look for vgui screens that are close to the player
|
||||
CVGuiScreenEnumerator localScreens;
|
||||
partition->EnumerateElementsInSphere( PARTITION_CLIENT_NON_STATIC_EDICTS, viewPosition, VGUI_SCREEN_MODE_RADIUS, false, &localScreens );
|
||||
|
||||
Vector vecOut, vecViewDelta;
|
||||
|
||||
|
||||
|
||||
float flBestDist = 2.0f;
|
||||
C_VGuiScreen *pBestScreen = NULL;
|
||||
|
||||
|
||||
for (int i = 0; i < g_pVGUIScreens.Count(); i++)
|
||||
for (int i = localScreens.GetScreenCount(); --i >= 0; )
|
||||
{
|
||||
if (g_pVGUIScreens.IsValidIndex(i))
|
||||
C_VGuiScreen *pScreen = localScreens.GetVGuiScreen(i);
|
||||
|
||||
if ( pScreen->IsAttachedToViewModel() )
|
||||
continue;
|
||||
|
||||
// Don't bother with screens I'm behind...
|
||||
// Hax - don't cancel backfacing with viewmodel attached screens.
|
||||
// we can get prediction bugs that make us backfacing for one frame and
|
||||
// it resets the mouse position if we lose focus.
|
||||
if ( pScreen->IsBackfacing(viewPosition) )
|
||||
continue;
|
||||
|
||||
// Don't bother with screens that are turned off
|
||||
if (!pScreen->IsActive())
|
||||
continue;
|
||||
|
||||
// FIXME: Should this maybe go into a derived class of some sort?
|
||||
// Don't bother with screens on the wrong team
|
||||
if (!pScreen->IsVisibleToTeam(nTeam))
|
||||
continue;
|
||||
|
||||
if ( !pScreen->AcceptsInput() )
|
||||
continue;
|
||||
|
||||
if ( pScreen->IsInputOnlyToOwner() && pScreen->GetPlayerOwner() != pLocalPlayer )
|
||||
continue;
|
||||
|
||||
// Test perpendicular distance from the screen...
|
||||
pScreen->GetVectors( NULL, NULL, &vecOut );
|
||||
VectorSubtract( viewPosition, pScreen->GetAbsOrigin(), vecViewDelta );
|
||||
float flPerpDist = DotProduct(vecViewDelta, vecOut);
|
||||
if ( (flPerpDist < 0) || (flPerpDist > VGUI_SCREEN_MODE_RADIUS) )
|
||||
continue;
|
||||
|
||||
// Perform a raycast to see where in barycentric coordinates the ray hits
|
||||
// the viewscreen; if it doesn't hit it, you're not in the mode
|
||||
float u, v, t;
|
||||
if (!pScreen->IntersectWithRay( lookRay, &u, &v, &t ))
|
||||
continue;
|
||||
|
||||
// Barycentric test
|
||||
if ((u < 0) || (v < 0) || (u > 1) || (v > 1))
|
||||
continue;
|
||||
|
||||
if ( t < flBestDist )
|
||||
{
|
||||
C_VGuiScreen *pScreen = g_pVGUIScreens[i];
|
||||
|
||||
if ( pScreen->IsAttachedToViewModel() )
|
||||
continue;
|
||||
|
||||
// Don't bother with screens I'm behind...
|
||||
// Hax - don't cancel backfacing with viewmodel attached screens.
|
||||
// we can get prediction bugs that make us backfacing for one frame and
|
||||
// it resets the mouse position if we lose focus.
|
||||
if ( pScreen->IsBackfacing(viewPosition) )
|
||||
continue;
|
||||
|
||||
// Don't bother with screens that are turned off
|
||||
if (!pScreen->IsActive())
|
||||
continue;
|
||||
|
||||
// FIXME: Should this maybe go into a derived class of some sort?
|
||||
// Don't bother with screens on the wrong team
|
||||
if (!pScreen->IsVisibleToTeam(nTeam))
|
||||
continue;
|
||||
|
||||
if ( !pScreen->AcceptsInput() )
|
||||
continue;
|
||||
|
||||
if ( pScreen->IsInputOnlyToOwner() && pScreen->GetPlayerOwner() != pLocalPlayer )
|
||||
continue;
|
||||
|
||||
// Test perpendicular distance from the screen...
|
||||
pScreen->GetVectors( NULL, NULL, &vecOut );
|
||||
VectorSubtract( viewPosition, pScreen->GetAbsOrigin(), vecViewDelta );
|
||||
float flPerpDist = DotProduct(vecViewDelta, vecOut);
|
||||
if ( (flPerpDist < 0) || (flPerpDist > VGUI_SCREEN_MODE_RADIUS) )
|
||||
continue;
|
||||
|
||||
// Perform a raycast to see where in barycentric coordinates the ray hits
|
||||
// the viewscreen; if it doesn't hit it, you're not in the mode
|
||||
float u, v, t;
|
||||
if (!pScreen->IntersectWithRay( lookRay, &u, &v, &t ))
|
||||
continue;
|
||||
|
||||
// Barycentric test
|
||||
if ((u < 0) || (v < 0) || (u > 1) || (v > 1))
|
||||
continue;
|
||||
|
||||
if ( t < flBestDist )
|
||||
{
|
||||
flBestDist = t;
|
||||
pBestScreen = pScreen;
|
||||
}
|
||||
flBestDist = t;
|
||||
pBestScreen = pScreen;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return pBestScreen;
|
||||
}
|
||||
|
||||
|
@ -892,34 +867,6 @@ vgui::Panel *CVGuiScreenPanel::CreateControlByName(const char *controlName)
|
|||
//-----------------------------------------------------------------------------
|
||||
void CVGuiScreenPanel::OnCommand( const char *command)
|
||||
{
|
||||
if ( stricmp( command, "out1" ) == 0
|
||||
|| stricmp( command, "out2" ) == 0
|
||||
|| stricmp( command, "out3" ) == 0
|
||||
|| stricmp( command, "out4" ) == 0
|
||||
|| stricmp( command, "out5" ) == 0
|
||||
|| stricmp( command, "out6" ) == 0
|
||||
|| stricmp( command, "out7" ) == 0
|
||||
|| stricmp( command, "out8" ) == 0
|
||||
|| stricmp( command, "out9" ) == 0
|
||||
|| stricmp( command, "out10" ) == 0
|
||||
|| stricmp( command, "out11" ) == 0
|
||||
|| stricmp( command, "out12" ) == 0
|
||||
|| stricmp( command, "out13" ) == 0
|
||||
|| stricmp( command, "out14" ) == 0
|
||||
|| stricmp( command, "out15" ) == 0
|
||||
|| stricmp( command, "out16" ) == 0 )
|
||||
{
|
||||
char entindex[8];
|
||||
itoa( this->GetEntity()->entindex(), entindex, 10 ); //Radix is base 10 (decimal)
|
||||
char newcommand[16] = { ' ' };
|
||||
strcat( newcommand, command );
|
||||
strcat( newcommand, " " );
|
||||
strcat( newcommand, entindex );
|
||||
engine->ClientCmd_Unrestricted( const_cast<char *>( newcommand ) );
|
||||
BaseClass::OnCommand( newcommand );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( Q_stricmp( command, "vguicancel" ) )
|
||||
{
|
||||
engine->ClientCmd( const_cast<char *>( command ) );
|
||||
|
|
|
@ -400,27 +400,16 @@ void ClientModeShared::Shutdown()
|
|||
// Purpose:
|
||||
// Input : frametime -
|
||||
// *cmd -
|
||||
// bVguiUpdate -
|
||||
//-----------------------------------------------------------------------------
|
||||
bool ClientModeShared::CreateMove( float flInputSampleTime, CUserCmd *cmd, bool bVguiUpdate )
|
||||
bool ClientModeShared::CreateMove( float flInputSampleTime, CUserCmd *cmd )
|
||||
{
|
||||
// Let the player override the view.
|
||||
C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
|
||||
if(!pPlayer)
|
||||
return true;
|
||||
|
||||
// Let the player at it
|
||||
return pPlayer->CreateMove( flInputSampleTime, cmd, bVguiUpdate );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
// Purpose:
|
||||
// Input : frametime -
|
||||
// *cmd -
|
||||
//-----------------------------------------------------------------------------
|
||||
bool ClientModeShared::CreateMove( float flInputSampleTime, CUserCmd *cmd )
|
||||
{
|
||||
return CreateMove( flInputSampleTime, cmd, false );
|
||||
// Let the player at it
|
||||
return pPlayer->CreateMove( flInputSampleTime, cmd );
|
||||
}
|
||||
|
||||
//-----------------------------------------------------------------------------
|
||||
|
|
|
@ -81,7 +81,6 @@ public:
|
|||
virtual void PostRender();
|
||||
virtual void PostRenderVGui();
|
||||
virtual void ProcessInput(bool bActive);
|
||||
virtual bool CreateMove( float flInputSampleTime, CUserCmd *cmd, bool bVguiUpdate ) = 0;
|
||||
virtual bool CreateMove( float flInputSampleTime, CUserCmd *cmd );
|
||||
virtual void Update();
|
||||
|
||||
|
|
|
@ -627,9 +627,9 @@ void C_BaseHLPlayer::PerformClientSideNPCSpeedModifiers( float flFrameTime, CUse
|
|||
//-----------------------------------------------------------------------------
|
||||
// Purpose: Input handling
|
||||
//-----------------------------------------------------------------------------
|
||||
bool C_BaseHLPlayer::CreateMove( float flInputSampleTime, CUserCmd *pCmd , bool bVguiUpdate )
|
||||
bool C_BaseHLPlayer::CreateMove( float flInputSampleTime, CUserCmd *pCmd )
|
||||
{
|
||||
bool bResult = BaseClass::CreateMove( flInputSampleTime, pCmd, bVguiUpdate );
|
||||
bool bResult = BaseClass::CreateMove( flInputSampleTime, pCmd );
|
||||
|
||||
if ( !IsInAVehicle() )
|
||||
{
|
||||
|
|
|
@ -46,7 +46,6 @@ public:
|
|||
bool IsSprinting() const { return m_fIsSprinting; }
|
||||
|
||||
// Input handling
|
||||
virtual bool CreateMove( float flInputSampleTime, CUserCmd *cmd, bool bVguiUpdate ) = 0;
|
||||
virtual bool CreateMove( float flInputSampleTime, CUserCmd *pCmd );
|
||||
void PerformClientSideObstacleAvoidance( float flFrameTime, CUserCmd *pCmd );
|
||||
void PerformClientSideNPCSpeedModifiers( float flFrameTime, CUserCmd *pCmd );
|
||||
|
|
|
@ -86,7 +86,6 @@ public:
|
|||
virtual void StartMessageMode( int iMessageModeType ) = 0;
|
||||
virtual vgui::Panel *GetMessagePanel() = 0;
|
||||
virtual void OverrideMouseInput( float *x, float *y ) = 0;
|
||||
virtual bool CreateMove( float flInputSampleTime, CUserCmd *cmd, bool bVguiUpdate ) = 0;
|
||||
virtual bool CreateMove( float flInputSampleTime, CUserCmd *cmd ) = 0;
|
||||
|
||||
virtual void LevelInit( const char *newmap ) = 0;
|
||||
|
|
|
@ -1218,10 +1218,8 @@ void CInput::CreateMove ( int sequence_number, float input_sample_frametime, boo
|
|||
VectorCopy( m_angPreviousViewAngles, cmd->viewangles );
|
||||
}
|
||||
|
||||
cmd->buttons |= IN_VALIDVGUIINPUT;
|
||||
|
||||
// Let the move manager override anything it wants to.
|
||||
if ( g_pClientMode->CreateMove( input_sample_frametime, cmd, true ) )
|
||||
if ( g_pClientMode->CreateMove( input_sample_frametime, cmd ) )
|
||||
{
|
||||
// Get current view angles after the client mode tweaks with it
|
||||
#ifdef SIXENSE
|
||||
|
|
|
@ -867,12 +867,6 @@ void CHL2_Player::PreThink(void)
|
|||
// Update weapon's ready status
|
||||
UpdateWeaponPosture();
|
||||
|
||||
// If we're in VGUI mode we should avoid shooting
|
||||
if ( GetVGUIMode() )
|
||||
{
|
||||
m_nButtons &= ~(IN_ATTACK|IN_ATTACK2);
|
||||
}
|
||||
|
||||
// Disallow shooting while zooming
|
||||
if ( IsX360() )
|
||||
{
|
||||
|
@ -2941,17 +2935,6 @@ void CHL2_Player::UpdateWeaponPosture( void )
|
|||
|
||||
CBaseEntity *aimTarget = tr.m_pEnt;
|
||||
|
||||
if ( GetVGUIMode() )
|
||||
{
|
||||
//We're over a friendly, drop our weapon
|
||||
if ( Weapon_Lower() == false )
|
||||
{
|
||||
//FIXME: We couldn't lower our weapon!
|
||||
}
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
//If we're over something
|
||||
if ( aimTarget && !tr.DidHitWorld() )
|
||||
{
|
||||
|
|
|
@ -82,8 +82,6 @@
|
|||
#include "weapon_physcannon.h"
|
||||
#endif
|
||||
|
||||
#include "vguiscreen.h"
|
||||
|
||||
ConVar autoaim_max_dist( "autoaim_max_dist", "2160" ); // 2160 = 180 feet
|
||||
ConVar autoaim_max_deflect( "autoaim_max_deflect", "0.99" );
|
||||
|
||||
|
@ -5040,8 +5038,6 @@ void CBasePlayer::Spawn( void )
|
|||
UpdateLastKnownArea();
|
||||
|
||||
m_weaponFiredTimer.Invalidate();
|
||||
|
||||
SetVGUImode( false );
|
||||
}
|
||||
|
||||
void CBasePlayer::Activate( void )
|
||||
|
@ -6548,377 +6544,6 @@ bool CBasePlayer::ClientCommand( const CCommand &args )
|
|||
}
|
||||
return true;
|
||||
}
|
||||
else if ( stricmp( cmd, "vguimode_true" ) == 0 )
|
||||
{
|
||||
SetVGUImode( true );
|
||||
return true;
|
||||
}
|
||||
else if ( stricmp( cmd, "vguimode_false" ) == 0 )
|
||||
{
|
||||
SetVGUImode( false );
|
||||
return true;
|
||||
}
|
||||
// And here begins the madness...
|
||||
else if ( stricmp( cmd, "out1" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output1.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out2" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output2.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out3" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output3.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out4" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output4.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out5" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output5.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out6" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output6.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out7" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output7.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out8" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output8.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out9" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output9.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out10" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output10.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out11" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output11.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out12" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output12.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out13" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output13.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out14" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output14.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
else if ( stricmp( cmd, "out15" ) == 0 )
|
||||
{
|
||||
int entindex = atoi( args[1] );
|
||||
if ( entindex )
|
||||
{
|
||||
IHandleEntity* hEnt = gEntList.LookupEntityByNetworkIndex( entindex );
|
||||
if ( hEnt )
|
||||
{
|
||||
CVGuiScreen* screen = (CVGuiScreen *)gEntList.LookupEntity( hEnt->GetRefEHandle() );
|
||||
if ( screen )
|
||||
{
|
||||
if ( screen->entindex() == entindex )
|
||||
{
|
||||
screen->Output15.FireOutput( this, NULL );
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Warning( "No ent index specified for VGUI output\n" );
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1213,9 +1213,6 @@ private:
|
|||
public:
|
||||
virtual unsigned int PlayerSolidMask( bool brushOnly = false ) const; // returns the solid mask for the given player, so bots can have a more-restrictive set
|
||||
|
||||
bool m_pVGUImode;
|
||||
bool GetVGUIMode(void) {return m_pVGUImode;}
|
||||
void SetVGUImode(bool newmode) { m_pVGUImode = newmode;}
|
||||
};
|
||||
|
||||
typedef CHandle<CBasePlayer> CBasePlayerHandle;
|
||||
|
|
|
@ -37,23 +37,6 @@ PRECACHE_REGISTER( vgui_screen );
|
|||
//-----------------------------------------------------------------------------
|
||||
BEGIN_DATADESC( CVGuiScreen )
|
||||
|
||||
DEFINE_OUTPUT( Output1, "Output1" ),
|
||||
DEFINE_OUTPUT( Output2, "Output2" ),
|
||||
DEFINE_OUTPUT( Output3, "Output3" ),
|
||||
DEFINE_OUTPUT( Output4, "Output4" ),
|
||||
DEFINE_OUTPUT( Output5, "Output5" ),
|
||||
DEFINE_OUTPUT( Output6, "Output6" ),
|
||||
DEFINE_OUTPUT( Output7, "Output7" ),
|
||||
DEFINE_OUTPUT( Output8, "Output8" ),
|
||||
DEFINE_OUTPUT( Output9, "Output9" ),
|
||||
DEFINE_OUTPUT( Output10, "Output10" ),
|
||||
DEFINE_OUTPUT( Output11, "Output11" ),
|
||||
DEFINE_OUTPUT( Output12, "Output12" ),
|
||||
DEFINE_OUTPUT( Output13, "Output13" ),
|
||||
DEFINE_OUTPUT( Output14, "Output14" ),
|
||||
DEFINE_OUTPUT( Output15, "Output15" ),
|
||||
DEFINE_OUTPUT( Output16, "Output16" ),
|
||||
|
||||
DEFINE_CUSTOM_FIELD( m_nPanelName, &g_VguiScreenStringOps ),
|
||||
DEFINE_FIELD( m_nAttachmentIndex, FIELD_INTEGER ),
|
||||
// DEFINE_FIELD( m_nOverlayMaterial, FIELD_INTEGER ),
|
||||
|
|
|
@ -76,24 +76,6 @@ private:
|
|||
CNetworkVar( EHANDLE, m_hPlayerOwner );
|
||||
|
||||
friend CVGuiScreen *CreateVGuiScreen( const char *pScreenClassname, const char *pScreenType, CBaseEntity *pAttachedTo, CBaseEntity *pOwner, int nAttachmentIndex );
|
||||
|
||||
public:
|
||||
COutputEvent Output1;
|
||||
COutputEvent Output2;
|
||||
COutputEvent Output3;
|
||||
COutputEvent Output4;
|
||||
COutputEvent Output5;
|
||||
COutputEvent Output6;
|
||||
COutputEvent Output7;
|
||||
COutputEvent Output8;
|
||||
COutputEvent Output9;
|
||||
COutputEvent Output10;
|
||||
COutputEvent Output11;
|
||||
COutputEvent Output12;
|
||||
COutputEvent Output13;
|
||||
COutputEvent Output14;
|
||||
COutputEvent Output15;
|
||||
COutputEvent Output16;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -38,6 +38,4 @@
|
|||
#define IN_GRENADE2 (1 << 24) // grenade 2
|
||||
#define IN_ATTACK3 (1 << 25)
|
||||
|
||||
#define IN_VALIDVGUIINPUT (1 << 26) //bitflag for vgui fix
|
||||
|
||||
#endif // IN_BUTTONS_H
|
||||
|
|
Loading…
Reference in a new issue