add source-sdk-2013

This commit is contained in:
nillerusr
2022-03-01 23:00:42 +03:00
parent 88b8830e8b
commit edc8d6c584
3288 changed files with 3731 additions and 1062455 deletions
+1 -1
View File
@@ -451,7 +451,7 @@ void CL_PreserveExistingEntity( int nOldEntity )
return;
}
pEnt->OnDataUnchangedInPVS();
// pEnt->OnDataUnchangedInPVS();
}
void CL_CopyExistingEntity( CEntityReadInfo &u )
+1
View File
@@ -298,6 +298,7 @@ def build(bld):
'audio/private/voice_sound_engine_interface.cpp', #[!$X360]
'audio/private/voice_mixer_controls_openal.cpp', #[$OSXALL||$LINUXALL]
'audio/private/voice_record_openal.cpp', #[$OSXALL||$LINUXALL]
'audio/private/voice_record_sdl.cpp', #[$OSXALL||$LINUXALL]
'../public/vgui_controls/vgui_controls.cpp',
'../common/vgui/vgui_basebudgetpanel.cpp',
'../common/vgui/vgui_budgetbargraphpanel.cpp',
-245
View File
@@ -1,245 +0,0 @@
// C_NextBot.cpp
// Client-side implementation of Next generation bot system
// Author: Michael Booth, April 2005
//========= Copyright Valve Corporation, All rights reserved. ============//
#include "cbase.h"
#include "C_NextBot.h"
#include "debugoverlay_shared.h"
#include <bitbuf.h>
#include "viewrender.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
#undef NextBot
ConVar NextBotShadowDist( "nb_shadow_dist", "400" );
//-----------------------------------------------------------------------------
IMPLEMENT_CLIENTCLASS_DT( C_NextBotCombatCharacter, DT_NextBot, NextBotCombatCharacter )
END_RECV_TABLE()
//-----------------------------------------------------------------------------
C_NextBotCombatCharacter::C_NextBotCombatCharacter()
{
// Left4Dead have surfaces too steep for IK to work properly
m_EntClientFlags |= ENTCLIENTFLAG_DONTUSEIK;
m_shadowType = SHADOWS_SIMPLE;
m_forcedShadowType = SHADOWS_NONE;
m_bForceShadowType = false;
TheClientNextBots().Register( this );
}
//-----------------------------------------------------------------------------
C_NextBotCombatCharacter::~C_NextBotCombatCharacter()
{
TheClientNextBots().UnRegister( this );
}
//-----------------------------------------------------------------------------
void C_NextBotCombatCharacter::Spawn( void )
{
BaseClass::Spawn();
}
//-----------------------------------------------------------------------------
void C_NextBotCombatCharacter::UpdateClientSideAnimation()
{
if (IsDormant())
{
return;
}
BaseClass::UpdateClientSideAnimation();
}
//--------------------------------------------------------------------------------------------------------
void C_NextBotCombatCharacter::UpdateShadowLOD( void )
{
ShadowType_t oldShadowType = m_shadowType;
if ( m_bForceShadowType )
{
m_shadowType = m_forcedShadowType;
}
else
{
#ifdef NEED_SPLITSCREEN_INTEGRATION
FOR_EACH_VALID_SPLITSCREEN_PLAYER( hh )
{
C_BasePlayer *pl = C_BasePlayer::GetLocalPlayer(hh);
if ( pl )
{
Vector delta = GetAbsOrigin() - C_BasePlayer::GetLocalPlayer(hh)->GetAbsOrigin();
#else
{
if ( C_BasePlayer::GetLocalPlayer() )
{
Vector delta = GetAbsOrigin() - C_BasePlayer::GetLocalPlayer()->GetAbsOrigin();
#endif
if ( delta.IsLengthLessThan( NextBotShadowDist.GetFloat() ) )
{
m_shadowType = SHADOWS_RENDER_TO_TEXTURE_DYNAMIC;
}
else
{
m_shadowType = SHADOWS_SIMPLE;
}
}
else
{
m_shadowType = SHADOWS_SIMPLE;
}
}
}
if ( oldShadowType != m_shadowType )
{
DestroyShadow();
}
}
//--------------------------------------------------------------------------------------------------------
ShadowType_t C_NextBotCombatCharacter::ShadowCastType( void )
{
if ( !IsVisible() )
return SHADOWS_NONE;
if ( m_shadowTimer.IsElapsed() )
{
m_shadowTimer.Start( 0.15f );
UpdateShadowLOD();
}
return m_shadowType;
}
//--------------------------------------------------------------------------------------------------------
bool C_NextBotCombatCharacter::GetForcedShadowCastType( ShadowType_t* pForcedShadowType ) const
{
if ( pForcedShadowType )
{
*pForcedShadowType = m_forcedShadowType;
}
return m_bForceShadowType;
}
//--------------------------------------------------------------------------------------------------------
/**
* Singleton accessor.
* By returning a reference, we guarantee construction of the
* instance before its first use.
*/
C_NextBotManager &TheClientNextBots( void )
{
static C_NextBotManager manager;
return manager;
}
//--------------------------------------------------------------------------------------------------------
C_NextBotManager::C_NextBotManager( void )
{
}
//--------------------------------------------------------------------------------------------------------
C_NextBotManager::~C_NextBotManager()
{
}
//--------------------------------------------------------------------------------------------------------
void C_NextBotManager::Register( C_NextBotCombatCharacter *bot )
{
m_botList.AddToTail( bot );
}
//--------------------------------------------------------------------------------------------------------
void C_NextBotManager::UnRegister( C_NextBotCombatCharacter *bot )
{
m_botList.FindAndRemove( bot );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool C_NextBotManager::SetupInFrustumData( void )
{
#ifdef ENABLE_AFTER_INTEGRATION
// Done already this frame.
if ( IsInFrustumDataValid() )
return true;
// Can we use the view data yet?
if ( !FrustumCache()->IsValid() )
return false;
// Get the number of active bots.
int nBotCount = m_botList.Count();
// Reset.
for ( int iBot = 0; iBot < nBotCount; ++iBot )
{
// Get the current bot.
C_NextBotCombatCharacter *pBot = m_botList[iBot];
if ( !pBot )
continue;
pBot->InitFrustumData();
}
FOR_EACH_VALID_SPLITSCREEN_PLAYER( iSlot )
{
ACTIVE_SPLITSCREEN_PLAYER_GUARD( iSlot );
// Get the active local player.
C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
if ( !pPlayer )
continue;
for ( int iBot = 0; iBot < nBotCount; ++iBot )
{
// Get the current bot.
C_NextBotCombatCharacter *pBot = m_botList[iBot];
if ( !pBot )
continue;
// Are we in the view frustum?
Vector vecMin, vecMax;
pBot->CollisionProp()->WorldSpaceAABB( &vecMin, &vecMax );
bool bInFrustum = !FrustumCache()->m_Frustums[iSlot].CullBox( vecMin, vecMax );
if ( bInFrustum )
{
Vector vecSegment;
VectorSubtract( pBot->GetAbsOrigin(), pPlayer->GetAbsOrigin(), vecSegment );
float flDistance = vecSegment.LengthSqr();
if ( flDistance < pBot->GetInFrustumDistanceSqr() )
{
pBot->SetInFrustumDistanceSqr( flDistance );
}
pBot->SetInFrustum( true );
}
}
}
// Mark as setup this frame.
m_nInFrustumFrame = gpGlobals->framecount;
#endif
return true;
}
//--------------------------------------------------------------------------------------------------------
-134
View File
@@ -1,134 +0,0 @@
// C_NextBot.h
// Next generation bot system
// Author: Michael Booth, April 2005
//========= Copyright Valve Corporation, All rights reserved. ============//
#ifndef _C_NEXT_BOT_H_
#define _C_NEXT_BOT_H_
#include "c_ai_basenpc.h"
//----------------------------------------------------------------------------------------------------------------
/**
* The interface holding IBody information
*/
class IBodyClient
{
public:
enum ActivityType
{
MOTION_CONTROLLED_XY = 0x0001, // XY position and orientation of the bot is driven by the animation.
MOTION_CONTROLLED_Z = 0x0002, // Z position of the bot is driven by the animation.
ACTIVITY_UNINTERRUPTIBLE= 0x0004, // activity can't be changed until animation finishes
ACTIVITY_TRANSITORY = 0x0008, // a short animation that takes over from the underlying animation momentarily, resuming it upon completion
ENTINDEX_PLAYBACK_RATE = 0x0010, // played back at different rates based on entindex
};
};
//--------------------------------------------------------------------------------------------------------
/**
* The client-side implementation of the NextBot
*/
class C_NextBotCombatCharacter : public C_BaseCombatCharacter
{
public:
DECLARE_CLASS( C_NextBotCombatCharacter, C_BaseCombatCharacter );
DECLARE_CLIENTCLASS();
C_NextBotCombatCharacter();
virtual ~C_NextBotCombatCharacter();
public:
virtual void Spawn( void );
virtual void UpdateClientSideAnimation( void );
virtual ShadowType_t ShadowCastType( void );
virtual bool IsNextBot() { return true; }
void ForceShadowCastType( bool bForce, ShadowType_t forcedShadowType = SHADOWS_NONE ) { m_bForceShadowType = bForce; m_forcedShadowType = forcedShadowType; }
bool GetForcedShadowCastType( ShadowType_t* pForcedShadowType ) const;
// Local In View Data.
void InitFrustumData( void ) { m_bInFrustum = false; m_flFrustumDistanceSqr = FLT_MAX; m_nInFrustumFrame = gpGlobals->framecount; }
bool IsInFrustumValid( void ) { return ( m_nInFrustumFrame == gpGlobals->framecount ); }
void SetInFrustum( bool bInFrustum ) { m_bInFrustum = bInFrustum; }
bool IsInFrustum( void ) { return m_bInFrustum; }
void SetInFrustumDistanceSqr( float flDistance ) { m_flFrustumDistanceSqr = flDistance; }
float GetInFrustumDistanceSqr( void ) { return m_flFrustumDistanceSqr; }
private:
ShadowType_t m_shadowType; // Are we LOD'd to simple shadows?
CountdownTimer m_shadowTimer; // Timer to throttle checks for shadow LOD
ShadowType_t m_forcedShadowType;
bool m_bForceShadowType;
void UpdateShadowLOD( void );
// Local In View Data.
int m_nInFrustumFrame;
bool m_bInFrustum;
float m_flFrustumDistanceSqr;
private:
C_NextBotCombatCharacter( const C_NextBotCombatCharacter & ); // not defined, not accessible
};
//--------------------------------------------------------------------------------------------------------
/**
* The C_NextBotManager manager
*/
class C_NextBotManager
{
public:
C_NextBotManager( void );
~C_NextBotManager();
/**
* Execute functor for each NextBot in the system.
* If a functor returns false, stop iteration early
* and return false.
*/
template < typename Functor >
bool ForEachCombatCharacter( Functor &func )
{
for( int i=0; i < m_botList.Count(); ++i )
{
C_NextBotCombatCharacter *character = m_botList[i];
if ( character->IsPlayer() )
{
continue;
}
if ( character->IsDormant() )
{
continue;
}
if ( !func( character ) )
{
return false;
}
}
return true;
}
int GetActiveCount() { return m_botList.Count(); }
bool SetupInFrustumData( void );
bool IsInFrustumDataValid( void ) { return ( m_nInFrustumFrame == gpGlobals->framecount ); }
private:
friend class C_NextBotCombatCharacter;
void Register( C_NextBotCombatCharacter *bot );
void UnRegister( C_NextBotCombatCharacter *bot );
CUtlVector< C_NextBotCombatCharacter * > m_botList; ///< list of all active NextBots
int m_nInFrustumFrame;
};
// singleton accessor
extern C_NextBotManager &TheClientNextBots( void );
#endif // _C_NEXT_BOT_H_
-720
View File
@@ -1,720 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Generic in-game abuse reporting
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "abuse_report.h"
#include "abuse_report_ui.h"
#include "filesystem.h"
#include "imageutils.h"
#include "econ/confirm_dialog.h"
#include "econ/econ_notifications.h"
inline bool IsLoggedOnToSteam()
{
return steamapicontext != NULL && steamapicontext->SteamUser() != NULL && steamapicontext->SteamUser()->BLoggedOn();
}
const char CAbuseReportManager::k_rchScreenShotFilenameBase[] = "abuse_report";
const char CAbuseReportManager::k_rchScreenShotFilename[] = "screenshots\\abuse_report.jpg";
//-----------------------------------------------------------------------------
class CEconNotification_AbuseReportReady : public CEconNotification
{
public:
CEconNotification_AbuseReportReady() : CEconNotification()
{
m_bHasTriggered = false;
m_bShowInGame = false;
}
~CEconNotification_AbuseReportReady()
{
//if ( !m_bHasTriggered )
//{
// ReallyTrigger();
//}
}
virtual void MarkForDeletion()
{
m_bHasTriggered = true;
CEconNotification::MarkForDeletion();
}
virtual bool BShowInGameElements() const { return m_bShowInGame; }
virtual EType NotificationType() { return eType_Trigger; }
virtual void Trigger()
{
ReallyTrigger();
MarkForDeletion();
}
virtual const char *GetUnlocalizedHelpText()
{
return "#AbuseReport_Notification_Help";
}
static bool IsNotificationType( CEconNotification *pNotification ) { return dynamic_cast< CEconNotification_AbuseReportReady *>( pNotification ) != NULL; }
static bool IsInGameNotificationType( CEconNotification *pNotification )
{
CEconNotification_AbuseReportReady *n = dynamic_cast< CEconNotification_AbuseReportReady *>( pNotification );
return n != NULL && n->BShowInGameElements();
}
bool m_bShowInGame;
private:
void ReallyTrigger()
{
Assert( !m_bHasTriggered );
m_bHasTriggered = true;
engine->ClientCmd_Unrestricted( "abuse_report_submit" );
}
bool m_bHasTriggered;
};
AbuseIncidentData_t::AbuseIncidentData_t()
{
m_nScreenShotWaitFrames = 5;
}
AbuseIncidentData_t::~AbuseIncidentData_t()
{
}
bool AbuseIncidentData_t::Poll()
{
bool bReady = true;
// Poll player data
for ( int i = 0 ; i < m_vecPlayers.Count() ; ++i )
{
// Make sure sure Steam knows we want the Avatar
PlayerData_t *p = &m_vecPlayers[i];
if ( p->m_iSteamAvatarIndex < 0 )
{
if ( steamapicontext && steamapicontext->SteamUser() )
{
p->m_iSteamAvatarIndex = steamapicontext->SteamFriends()->GetLargeFriendAvatar( p->m_steamID );
if ( p->m_iSteamAvatarIndex < 0 )
{
bReady = false;
}
}
else
{
p->m_iSteamAvatarIndex = 0;
}
}
}
// Screenshot ready?
if ( !m_bitmapScreenshot.IsValid() && m_nScreenShotWaitFrames > 0 )
{
--m_nScreenShotWaitFrames;
// Just load the whole file into a memory buffer
char szFullPath[ MAX_PATH ] = "";
if ( !g_pFullFileSystem->RelativePathToFullPath( CAbuseReportManager::k_rchScreenShotFilename, NULL, szFullPath, ARRAYSIZE(szFullPath) ) )
{
Assert( false ); // ???
}
// Load it
if ( g_pFullFileSystem->FileExists( szFullPath ) )
{
// Load the screenshot into a local buffer
if ( !g_pFullFileSystem->ReadFile( CAbuseReportManager::k_rchScreenShotFilename, NULL, m_bufScreenshotFileData ) )
{
Warning( "Failed to read back %s\n", CAbuseReportManager::k_rchScreenShotFilename );
m_nScreenShotWaitFrames = 0;
}
else
{
ConversionErrorType nErrorCode = ImgUtl_LoadBitmap( szFullPath, m_bitmapScreenshot );
if ( nErrorCode != CE_SUCCESS )
{
Warning( "Abuse report screenshot %s failed to load with error code %d\n", CAbuseReportManager::k_rchScreenShotFilename, nErrorCode );
Assert( nErrorCode == CE_SUCCESS );
m_nScreenShotWaitFrames = 0;
}
else
{
// !KLUDGE! Resize to power of two dimensions, since VGUI doesn't like odd sizes
ImgUtl_ResizeBitmap( m_bitmapScreenshot, 1024, 1024, &m_bitmapScreenshot );
}
}
g_pFullFileSystem->RemoveFile( CAbuseReportManager::k_rchScreenShotFilename );
}
}
return bReady;
}
CAbuseReportManager *g_AbuseReportMgr;
CAbuseReportManager::CAbuseReportManager()
{
m_pIncidentData = NULL;
m_bTestReport = false;
m_eIncidentDataStatus = k_EIncidentDataStatus_None;
m_bReportUIPending = false;
// We're the singleton --- set global pointer
Assert( g_AbuseReportMgr == NULL );
g_AbuseReportMgr = this;
m_timeLastReportReadyNotification = 0.0;
m_adrCurrentServer.Clear();
}
CAbuseReportManager::~CAbuseReportManager()
{
Assert( m_pIncidentData == NULL );
}
char const *CAbuseReportManager::Name()
{
return "AbuseRepotManager";
}
bool CAbuseReportManager::Init()
{
// Clean out any temporary files
Assert( m_pIncidentData == NULL );
DestroyIncidentData();
ListenForGameEvent( "teamplay_round_win" );
ListenForGameEvent( "tf_game_over" );
ListenForGameEvent( "player_death" );
ListenForGameEvent( "server_spawn" );
return true;
}
void CAbuseReportManager::LevelShutdownPreEntity()
{
// Don't keep the dialog open across a level transition. Don't discard their
// report data, but let's kill the dialog
if ( g_AbuseReportDlg.Get() != NULL )
{
Warning( "Abuse report dialog open during level shutdown. Closing it.\n" );
g_AbuseReportDlg.Get()->Close();
}
// And clear the 'pending' flag
m_bReportUIPending = false;
}
void CAbuseReportManager::FireGameEvent( IGameEvent *event )
{
//C_BasePlayer *pLocalPlayer = C_BasePlayer::GetLocalPlayer();
const char *eventname = event->GetName();
if ( !eventname || !eventname[0] )
return;
if (
!Q_strcmp( "teamplay_round_win", eventname )
|| !Q_strcmp( "tf_game_over", eventname )
) {
// Periodically remind them that they have a report ready to file
CheckCreateReportReadyNotification( 60.0 * 5.0, true, 10.0f );
}
else if ( !Q_strcmp( "player_death", eventname ) )
{
// In some maps, the round just never ends.
// So make sure we do remind them every now and then about this.
// Just not too often
CheckCreateReportReadyNotification( 60.0 * 20.0, true, 5.0f );
}
else if ( !Q_strcmp( "server_spawn", eventname ) )
{
m_adrCurrentServer.Clear();
m_adrCurrentServer.SetFromString( event->GetString( "address", "" ), false );
m_adrCurrentServer.SetPort( event->GetInt( "port", 0 ) );
m_steamIDCurrentServer = CSteamID();
if ( steamapicontext && steamapicontext->SteamUser() && GetUniverse() != k_EUniverseInvalid )
{
m_steamIDCurrentServer.SetFromString( event->GetString( "steamid", "" ), GetUniverse() );
}
}
}
void CAbuseReportManager::Shutdown()
{
// Close the dialog, if any
LevelShutdownPreEntity();
DestroyIncidentData();
// Clear global pointer
Assert( g_AbuseReportMgr == this );
if ( g_AbuseReportMgr == this )
{
g_AbuseReportMgr = NULL;
}
}
void CAbuseReportManager::Update( float frametime )
{
// if a dialog is already displayed, make sure we don't try to activate another
if ( g_AbuseReportDlg.Get() != NULL )
{
m_bReportUIPending = false;
}
// Poll report data, if any
if ( m_pIncidentData != NULL )
{
if ( m_eIncidentDataStatus == k_EIncidentDataStatus_Preparing )
{
if ( m_pIncidentData->Poll() )
{
m_eIncidentDataStatus = k_EIncidentDataStatus_Ready;
CheckCreateReportReadyNotification( 1.0f, true, 7.0f );
}
}
else
{
Assert( m_eIncidentDataStatus == k_EIncidentDataStatus_Ready );
}
if ( m_eIncidentDataStatus == k_EIncidentDataStatus_Ready && m_bReportUIPending )
{
m_bReportUIPending = false;
ActivateSubmitReportUI();
}
}
else
{
m_bReportUIPending = false;
}
// Re-create notification constantly in the menu.
// While in game, we will only popup notifications
// periodically at round end or player death
CheckCreateReportReadyNotification( 10.0, false, 999.0f );
}
void CAbuseReportManager::SubmitReportUIRequested()
{
if ( g_AbuseReportDlg.Get() != NULL )
{
Assert( g_AbuseReportDlg.Get() == NULL );
return;
}
// If no report data already, then create some
if ( m_pIncidentData == NULL )
{
QueueReport();
if ( m_pIncidentData == NULL )
{
// Failed
return;
}
}
// Set flag to bring up the reporting UI at earliest opportunity,
// once all data has been fetched asynchronously
m_bReportUIPending = true;
}
bool CAbuseReportManager::CreateAndPopulateIncident()
{
Assert( m_pIncidentData == NULL );
// by default, just create the base class version
m_pIncidentData = new AbuseIncidentData_t;
// And populate it
return PopulateIncident();
}
bool CAbuseReportManager::PopulateIncident()
{
if ( m_pIncidentData == NULL )
{
Assert( m_pIncidentData );
return false;
}
// Queue a screenshot
CUtlString cmd;
cmd.Format( "__screenshot_internal \"%s\"", k_rchScreenShotFilenameBase );
engine->ClientCmd_Unrestricted( cmd );
// Set status as preparing
m_eIncidentDataStatus = k_EIncidentDataStatus_Preparing;
m_pIncidentData->m_bCanReportGameServer = false;
m_pIncidentData->m_adrGameServer.Clear();
if (
m_adrCurrentServer.IsValid()
&& !m_adrCurrentServer.IsLocalhost()
&& m_steamIDCurrentServer.IsValid()
&& ( !m_adrCurrentServer.IsReservedAdr() || m_steamIDCurrentServer.GetEUniverse() != k_EUniversePublic )
)
{
m_pIncidentData->m_adrGameServer = m_adrCurrentServer;
m_pIncidentData->m_steamIDGameServer = m_steamIDCurrentServer;
m_pIncidentData->m_bCanReportGameServer = true;
}
m_pIncidentData->m_matWorldToClip = engine->WorldToScreenMatrix();
// Add in players
for (int i = 1 ; i <= gpGlobals->maxClients ; ++i )
{
CBasePlayer *player = UTIL_PlayerByIndex( i );
#ifndef _DEBUG
// Skip local players
if ( player != NULL && player->IsLocalPlayer() )
{
continue;
}
#endif
// Get player info from the engine. This works even if they haven't spawned yet.
player_info_t pi;
if ( !engine->GetPlayerInfo( i, &pi ) )
{
continue;
}
if ( pi.fakeplayer )
{
continue;
}
if ( pi.friendsID == 0 )
{
continue;
}
CSteamID steamID( pi.friendsID, 1, GetUniverse(), k_EAccountTypeIndividual );
if ( !steamID.IsValid() )
{
Assert( steamID.IsValid() );
continue;
}
int arrayIndex = m_pIncidentData->m_vecPlayers.AddToTail();
AbuseIncidentData_t::PlayerData_t *p = &m_pIncidentData->m_vecPlayers[ arrayIndex ];
p->m_iClientIndex = i;
p->m_steamID = steamID;
p->m_sPersona = pi.name;
p->m_bHasEntity = false;
p->m_bRenderBoundsValid = false;
p->m_screenBoundsMin.x = p->m_screenBoundsMin.y = 1.0f;
p->m_screenBoundsMax.x = p->m_screenBoundsMax.y = 0.0f;
if ( player==NULL )
{
continue;
}
p->m_bHasEntity = true;
player->GetRenderBounds( p->m_vecRenderBoundsMin, p->m_vecRenderBoundsMax );
p->m_matModelToWorld.CopyFrom3x4( player->RenderableToWorldTransform() );
MatrixMultiply( m_pIncidentData->m_matWorldToClip, p->m_matModelToWorld, p->m_matModelToClip );
// Gather up screen extents
p->m_bRenderBoundsValid = false;
for ( int j = 0 ; j < 8 ; ++j )
{
// Get corner point in model space
Vector4D modelCorner(
( j & 1 ) ? p->m_vecRenderBoundsMax.x : p->m_vecRenderBoundsMin.x,
( j & 2 ) ? p->m_vecRenderBoundsMax.y : p->m_vecRenderBoundsMin.y,
( j & 4 ) ? p->m_vecRenderBoundsMax.z : p->m_vecRenderBoundsMin.z,
1.0f
);
// Transform to clip space
Vector4D clipCorner;
Vector4DMultiply( p->m_matModelToClip, modelCorner, clipCorner );
//Msg( "%6.3f, %6.3f, %6.3f, %6.3f\n", clipCorner[0], clipCorner[1], clipCorner[2], clipCorner[3] );
// If all points behind near clip plane, don't try to
// figure out screen space bounds
if ( clipCorner[3] > .1f )
{
p->m_bRenderBoundsValid = true;
}
// Push w forward to "near clip plane"
float w = MAX( clipCorner[3], .1f );
// Divide by w to project, and convert normalized device coordinates
// where the view volume is (-1...1), to normalized screen coords, where
// they are from 0...1
float x = ( clipCorner[0] / w + 1.0f ) / 2.0f;
float y = ( -clipCorner[1] / w + 1.0f ) / 2.0f;
p->m_screenBoundsMin.x = MIN( p->m_screenBoundsMin.x, x );
p->m_screenBoundsMax.x = MAX( p->m_screenBoundsMax.x, x );
p->m_screenBoundsMin.y = MIN( p->m_screenBoundsMin.y, y );
p->m_screenBoundsMax.y = MAX( p->m_screenBoundsMax.y, y );
}
// Clip projected rect to the screen
if ( p->m_bRenderBoundsValid )
{
p->m_screenBoundsMin.x = MAX( p->m_screenBoundsMin.x, 0.0f );
p->m_screenBoundsMax.x = MIN( p->m_screenBoundsMax.x, 1.0f );
p->m_screenBoundsMin.y = MAX( p->m_screenBoundsMin.y, 0.0f );
p->m_screenBoundsMax.y = MIN( p->m_screenBoundsMax.y, 1.0f );
p->m_bRenderBoundsValid =
p->m_screenBoundsMin.x + .01f < p->m_screenBoundsMax.x
&& p->m_screenBoundsMin.y + .01f < p->m_screenBoundsMax.y;
}
// Sanity check that we agree on what their steam ID is!
if ( player->GetSteamID( &steamID ) )
{
Assert( p->m_steamID == steamID );
}
}
// Test harness: add in a handful of fake players
#ifdef _DEBUG
if ( m_bTestReport )
{
int arrayIndex = m_pIncidentData->m_vecPlayers.AddToTail();
AbuseIncidentData_t::PlayerData_t *p = &m_pIncidentData->m_vecPlayers[ arrayIndex ];
p->m_iClientIndex = -1;
p->m_sPersona = "Lippencott";
p->m_steamID.SetFromUint64( 148618791998333672 );
arrayIndex = m_pIncidentData->m_vecPlayers.AddToTail();
p = &m_pIncidentData->m_vecPlayers[ arrayIndex ];
p->m_iClientIndex = -1;
p->m_sPersona = "EricS";
p->m_steamID.SetFromUint64( 148618791998195668 );
arrayIndex = m_pIncidentData->m_vecPlayers.AddToTail();
p = &m_pIncidentData->m_vecPlayers[ arrayIndex ];
p->m_iClientIndex = -1;
p->m_sPersona = "Sarenya";
p->m_steamID.SetFromUint64( 148618791998429832 );
arrayIndex = m_pIncidentData->m_vecPlayers.AddToTail();
p = &m_pIncidentData->m_vecPlayers[ arrayIndex ];
p->m_iClientIndex = -1;
p->m_sPersona = "fletch";
p->m_steamID.SetFromUint64( 148618791998436114 );
{
AbuseIncidentData_t::PlayerImage_t img;
img.m_eType = AbuseIncidentData_t::k_PlayerImageType_UGC;
img.m_hUGCHandle = 6978249415967519;
p->m_vecImages.AddToTail( img );
}
if ( !m_pIncidentData->m_bCanReportGameServer)
{
m_pIncidentData->m_adrGameServer.SetFromString( "123.45.67.89:27015", false );
m_pIncidentData->m_steamIDGameServer = CSteamID( 12345, 0, GetUniverse(), k_EAccountTypeAnonGameServer );
m_pIncidentData->m_bCanReportGameServer = true;
}
}
#endif
// Make sure there is at least one other person we could file a report against!
if ( m_pIncidentData->m_vecPlayers.Count() < 1 )
{
Warning( "No players to accuse of abuse, cannot file report\n" );
return false;
}
return true;
}
void CAbuseReportManager::DestroyIncidentData()
{
if ( m_pIncidentData != NULL )
{
delete m_pIncidentData;
m_pIncidentData = NULL;
}
m_eIncidentDataStatus = k_EIncidentDataStatus_None;
// Get rid of any existing screenshot file, both locally
// and in the cloud. We don't want this to count against
// our quota
if ( steamapicontext && steamapicontext->SteamRemoteStorage() && steamapicontext->SteamRemoteStorage()->FileExists( k_rchScreenShotFilename ) )
{
steamapicontext->SteamRemoteStorage()->FileDelete( k_rchScreenShotFilename );
}
if ( g_pFullFileSystem->FileExists( k_rchScreenShotFilename ) ) // !KLUDGE! To prevent warning if the file doesn't exist!
{
g_pFullFileSystem->RemoveFile( k_rchScreenShotFilename );
}
m_timeLastReportReadyNotification = 0.0;
// Make sure we don't have any notifications queued
NotificationQueue_Remove( &CEconNotification_AbuseReportReady::IsNotificationType );
}
void CAbuseReportManager::QueueReport()
{
// Dialog is already active?
if ( g_AbuseReportDlg.Get() != NULL )
{
Warning( "Cannot capture another incident report. Submission dialog is active.\n" );
return;
}
// Destroy any existing data
DestroyIncidentData();
// Make sure we're logged on to Steam
if ( !IsLoggedOnToSteam() )
{
g_AbuseReportMgr->ShowNoSteamErrorMessage();
return;
}
if ( CreateAndPopulateIncident() )
{
Msg( "Captured data for abuse report.\n");
}
else
{
Warning( "Failed to captured data for abuse report.\n");
DestroyIncidentData();
}
}
void CAbuseReportManager::ShowNoSteamErrorMessage()
{
ShowMessageBox( "#AbuseReport_NoSteamTitle", "#AbuseReport_NoSteamMessage", "#GameUI_OK" );
}
void CAbuseReportManager::CheckCreateReportReadyNotification( float flMinSecondsSinceLastNotification, bool bInGame, float flLifetime )
{
// We have to have some data ready
if ( m_pIncidentData == NULL || m_eIncidentDataStatus != k_EIncidentDataStatus_Ready )
{
return;
}
// Don't pester them if they are already trying to do something about it
if ( g_AbuseReportDlg.Get() != NULL || m_bReportUIPending )
{
return;
}
// Already notified them too recently?
if ( m_timeLastReportReadyNotification != 0.0 && Plat_FloatTime() < m_timeLastReportReadyNotification + flMinSecondsSinceLastNotification )
{
return;
}
// Already a notification in the queue?
if ( bInGame )
{
if ( NotificationQueue_Count( &CEconNotification_AbuseReportReady::IsInGameNotificationType ) > 0 )
{
return;
}
}
else
{
if ( NotificationQueue_Count( &CEconNotification_AbuseReportReady::IsNotificationType ) > 0 )
{
return;
}
}
CreateReportReadyNotification( bInGame, flLifetime );
}
void CAbuseReportManager::CreateReportReadyNotification( bool bInGame, float flLifetime )
{
NotificationQueue_Remove( &CEconNotification_AbuseReportReady::IsNotificationType );
CEconNotification_AbuseReportReady *pNotification = new CEconNotification_AbuseReportReady();
pNotification->SetText( "AbuseReport_Notification" );
pNotification->SetLifetime( flLifetime );
pNotification->m_bShowInGame = bInGame;
NotificationQueue_Add( pNotification );
m_timeLastReportReadyNotification = Plat_FloatTime();
}
CON_COMMAND_F( abuse_report_queue, "Capture data for abuse report and queue for submission. Use abose_report_submit to activate UI to submit the report", FCVAR_DONTRECORD )
{
if ( !g_AbuseReportMgr )
{
Warning( "abuse_report_queue: No abuse report manager, cannot create report.\n" );
return;
}
g_AbuseReportMgr->QueueReport();
}
CON_COMMAND_F( abuse_report_submit, "Activate UI to submit queued report. Use abuse_report_queue to capture data for the report the report", FCVAR_DONTRECORD )
{
if ( !g_AbuseReportMgr )
{
Warning( "abuse_report_submit: No abuse report manager, cannot submit report.\n" );
return;
}
// Make sure we're logged on to Steam
if ( !IsLoggedOnToSteam() )
{
g_AbuseReportMgr->ShowNoSteamErrorMessage();
return;
}
if ( g_AbuseReportDlg.Get() != NULL )
{
// Dialog is already active
return;
}
g_AbuseReportMgr->SubmitReportUIRequested();
}
// Test harness
#ifdef _DEBUG
CON_COMMAND_F( abuse_report_test, "Make a test abuse incident and activate UI", FCVAR_DONTRECORD )
{
if ( !g_AbuseReportMgr )
{
Assert( g_AbuseReportMgr );
return;
}
g_AbuseReportMgr->m_bTestReport = true;
g_AbuseReportMgr->QueueReport();
g_AbuseReportMgr->m_bTestReport = false;
engine->ClientCmd_Unrestricted( "abuse_report_submit" );
}
#endif
-274
View File
@@ -1,274 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Generic in-game abuse reporting
//
// $NoKeywords: $
//=============================================================================//
#ifndef ABUSE_REPORT_H
#define ABUSE_REPORT_H
#ifdef _WIN32
#pragma once
#endif
#include <igamesystem.h>
#include <GameEventListener.h>
#include <bitmap/bitmap.h>
#include <netadr.h>
/// Different content types that can be reported as abusive.
///
/// WARNING: These enum values MUST MATCH the values in Steam's
/// ECommunityContentType!
enum EAbuseReportContentType
{
k_EAbuseReportContentNoSelection = -1, // dummy ilegal value: the user has not made a selection
k_EAbuseReportContentUnspecified = 0, // we use this to mean "other"
//k_EAbuseReportContentAll = 1, // reset all community content
k_EAbuseReportContentAvatarImage = 2, // clear avatar image
//k_EAbuseReportContentProfileText = 3, // reset profile text
//k_EAbuseReportContentWebLinks = 4, // delete web links
//k_EAbuseReportContentAnnouncement = 5,
//k_EAbuseReportContentEventText = 6,
//k_EAbuseReportContentCustomCSS = 7,
//k_EAbuseReportContentProfileURL = 8, // delete community URL ID
k_EAbuseReportContentComments = 9, // just comments this guy has written
k_EAbuseReportContentPersonaName = 10, // persona name
//k_EAbuseReportContentScreenshot = 11, // screenshot
//k_EAbuseReportContentVideo = 12, // videos
k_EAbuseReportContentCheating = 13, // cheating
k_EAbuseReportContentUGCImage = 14, // Image stored in UGC --- the report is accusing the image of being offensive
k_EAbuseReportContentActorUGCImage = 15, // Abuse report actor has uploaded a UGC image to server as supporting documentation of their claim
};
/// Types of reasons why a violation report was issued
///
/// WARNING: These enum values MUST MATCH the values in Steam's
/// EAbuseReportType!
enum EAbuseReportType
{
k_EAbuseReportTypeNoSelection = -1, // dummy ilegal value: the user has not made a selection
k_EAbuseReportTypeUnspecified = 0,
k_EAbuseReportTypeInappropriate = 1, // just not ok to post
k_EAbuseReportTypeProhibited = 2, // prohibited by EULA or general law
k_EAbuseReportTypeSpamming = 3, // excessive spamming
k_EAbuseReportTypeAdvertisement = 4, // unwanted advertisement
//k_EAbuseReportTypeExploit = 5, // content data attempts to exploit code issue
k_EAbuseReportTypeSpoofing = 6, // user/group is impersonating an official contact
k_EAbuseReportTypeLanguage = 7, // bad language
k_EAbuseReportTypeAdultContent = 8, // any kind of adult material, references etc
k_EAbuseReportTypeHarassment = 9, // harassment, discrimination, racism etc
k_EAbuseReportTypeCheating = 10, // cheating
};
/// Container class that has everything we need to know in order to file
/// an abuse report, which is significantly more than the data we actually
/// include in a particular abuse report. It's everything we save off at the
/// time the user initiates the abuse reporting mechanism. Games can derive
/// their own report types and put game-specific data in here.
struct AbuseIncidentData_t
{
AbuseIncidentData_t();
virtual ~AbuseIncidentData_t();
enum EPlayerImageType
{
k_PlayerImageType_UGC,
k_PlayerImageType_Spray,
};
/// A custom image of the player's that could be considered offensive
struct PlayerImage_t
{
/// What kind of image is it?
EPlayerImageType m_eType;
/// For UGC images, what's the handle?
uint64 m_hUGCHandle;
};
/// Info we remember for one player.
struct PlayerData_t
{
PlayerData_t()
{
m_iClientIndex = -1;
m_iSteamAvatarIndex = -1;
}
/// The client index. (See UTIL_PlayerByIndex). Note that this
/// index is really only valid at the time the incident is captured.
/// Because players can leave after the incident is captured.
int m_iClientIndex;
/// The name they were going by at the time
CUtlString m_sPersona;
/// Their steam ID. This is essential so we can file
/// an abuse report!
CSteamID m_steamID;
/// Index of steam friends icon for their avatar.
/// 0 if they don't have one!
int m_iSteamAvatarIndex;
/// Do we have an entity for this player? They might not have spawned,
/// or might be outside our PVS, etc.
bool m_bHasEntity;
/// Model transform for the player's render stuff
VMatrix m_matModelToWorld;
/// Model->clip matrix for the player's render stuff
VMatrix m_matModelToClip;
/// True if the render bounds are approximately correct, false if not
bool m_bRenderBoundsValid;
/// Bounds (in model space) of the player's renderable stuff
Vector m_vecRenderBoundsMin, m_vecRenderBoundsMax;
/// Bounds (in normalized screen space coords 0...1) of the player's
/// renderable stuff
Vector2D m_screenBoundsMin, m_screenBoundsMax;
/// List of his images
CUtlVector<PlayerImage_t> m_vecImages;
};
/// List of base player data. You got more data per player in your derived
/// incident type? Store it in a parallel array.
CUtlVector<PlayerData_t> m_vecPlayers;
/// Camera world -> clip matrix.
VMatrix m_matWorldToClip;
/// Screenshot
Bitmap_t m_bitmapScreenshot;
// Screenshot file data
CUtlBuffer m_bufScreenshotFileData;
/// Number of frames we're willing to wait for the engine to write out a screenshot.
/// Zero if we already failed
int m_nScreenShotWaitFrames;
/// Is it possible to report the game server itself for abuse?
bool m_bCanReportGameServer;
/// What Game Server/IP are we on? Will be an invalid address if we don't know
netadr_t m_adrGameServer;
/// Steam ID of the game server / IP we are on
CSteamID m_steamIDGameServer;
/// Poll report (some data may have to be fetched asynchronously),
/// return true if everything is ready
virtual bool Poll();
};
/// Generic abuse reporting panel. Your
class CAbuseReportManager : public CBaseGameSystemPerFrame, public CGameEventListener
{
public:
CAbuseReportManager();
virtual ~CAbuseReportManager();
//
// CAutoGameSystemPerFrame overrides
//
virtual char const *Name();
virtual bool Init();
virtual void Shutdown();
virtual void LevelShutdownPreEntity();
//
// CGameEventListener overrides
//
virtual void FireGameEvent( IGameEvent *event );
// CAutoGameSystemPerFrame defines different stuff depending on which DLL we're building
#ifdef CLIENT_DLL
// Do our frame-time processing
virtual void Update( float frametime );
#else
#error "Why is this being included?"
#endif
/// Called when the console command is executed to capture data for a report
virtual void QueueReport();
/// Called when the console command is executed to submit data for a report
virtual void SubmitReportUIRequested();
/// Called to actually trigger the report UI, after all data is ready
virtual void ActivateSubmitReportUI() = 0;
/// Fetch the incident that's queued to be reported
AbuseIncidentData_t *GetIncidentData() const { return m_pIncidentData; }
/// Delete any current report incident. Also should clean
/// out any temporary files used by the incident system.
virtual void DestroyIncidentData();
/// Show a message box complaining about lack of steam
/// connection
virtual void ShowNoSteamErrorMessage();
/// Insert a a notification into the queue indicating that an unfiled report is ready
virtual void CreateReportReadyNotification( bool bInGame, float flLifetime );
/// Test harness. Set this to true, to generate fake data
bool m_bTestReport;
static const char k_rchScreenShotFilenameBase[];
static const char k_rchScreenShotFilename[];
protected:
/// Your app will probably define its own abuse report types.
/// if so, you will need to override this function.
/// The base class just calls new to create an object, then calls
/// PopulateIncident()
virtual bool CreateAndPopulateIncident();
/// Fill in the details about the current incident. This just fills in the
/// base class data, and it should be called from CreateAndPopulateIncident
bool PopulateIncident();
/// Current incident that is pending to be reported or is being generated.
/// Might be NULL.
AbuseIncidentData_t *m_pIncidentData;
/// Status of incident data.
enum EIncidentDataStatus
{
k_EIncidentDataStatus_None,
k_EIncidentDataStatus_Preparing, // we shuld call Poll() until it's ready
k_EIncidentDataStatus_Ready, // it's ready
};
EIncidentDataStatus m_eIncidentDataStatus;
/// Do we want to show the report UI as soon as the report is ready?
bool m_bReportUIPending;
void CheckCreateReportReadyNotification( float flMinSecondsSinceLastNotification, bool bInGame, float flLifetime );
/// Time when we last pestered them about filing their report
double m_timeLastReportReadyNotification;
/// Address of the lasts server we connected to
netadr_t m_adrCurrentServer;
CSteamID m_steamIDCurrentServer;
};
/// Pointer to the app-specific instance. This pointer mght be NULL! Your
/// app should define set this pointer if it uses the system
extern CAbuseReportManager *g_AbuseReportMgr;
#endif // ABUSE_REPORT_H
-949
View File
@@ -1,949 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Generic in-game abuse reporting
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "abuse_report_ui.h"
#include "econ/econ_controls.h"
#include "ienginevgui.h"
#include "vgui/ISurface.h"
#include <vgui_controls/TextEntry.h>
#include <vgui_controls/ComboBox.h>
#include <vgui_controls/RadioButton.h>
#include "vgui_bitmappanel.h"
#include "vgui_avatarimage.h"
#include "gc_clientsystem.h"
#include "econ/tool_items/tool_items.h"
#include "econ/econ_gcmessages.h"
#include "econ/confirm_dialog.h"
#include "tool_items/custom_texture_cache.h"
vgui::DHANDLE<CAbuseReportDlg> g_AbuseReportDlg;
CAbuseReportDlg::CAbuseReportDlg( vgui::Panel *parent, AbuseIncidentData_t *pIncidentData )
: EditablePanel( parent, "AbuseReportSubmitDialog" )
, m_pSubmitButton( NULL )
, m_pScreenShot( NULL )
, m_pScreenShotAttachCheckButton( NULL )
, m_pOffensiveImage( NULL )
, m_pDescriptionTextEntry( NULL )
, m_pPlayerLabel( NULL )
, m_pPlayerRadio( NULL )
, m_pGameServerRadio( NULL )
, m_pPlayerCombo( NULL )
, m_pAbuseContentLabel( NULL )
, m_pAbuseContentCombo( NULL )
, m_pAbuseTypeLabel( NULL )
, m_pAbuseTypeCombo( NULL )
, m_pScreenShotBitmap( NULL )
, m_pAvatarImage( NULL )
, m_pNoAvatarLabel( NULL )
, m_pCustomTextureImagePanel( NULL )
, m_pNoCustomTexturesLabel( NULL )
, m_pCustomTextureNextButton( NULL )
, m_pCustomTexturePrevButton( NULL )
, m_iUserImageIndex( 0 )
, m_pIncidentData( pIncidentData )
{
vgui::HScheme scheme = vgui::scheme()->LoadSchemeFromFileEx( enginevgui->GetPanel( PANEL_CLIENTDLL ), "resource/ClientScheme.res", "ClientScheme" );
SetScheme(scheme);
SetProportional( true );
//m_pContainer = new vgui::EditablePanel( this, "Container" );
Assert( g_AbuseReportDlg.Get() == NULL );
g_AbuseReportDlg.Set( this );
engine->ExecuteClientCmd("gameui_preventescape");
}
CAbuseReportDlg::~CAbuseReportDlg()
{
Assert( g_AbuseReportDlg.Get() == this );
if ( g_AbuseReportDlg.Get() == this )
{
engine->ExecuteClientCmd("gameui_allowescape");
g_AbuseReportDlg = NULL;
}
}
void CAbuseReportDlg::OnCommand( const char *command )
{
if ( !Q_stricmp( command, "cancel" ) )
{
Close();
return;
}
if ( !Q_stricmp( command, "discard" ) )
{
Close();
g_AbuseReportMgr->DestroyIncidentData();
return;
}
if ( !Q_stricmp( command, "submit" ) )
{
OnSubmitReport();
return;
}
if ( !Q_stricmp( command, "nextcustomtexture" ) )
{
++m_iUserImageIndex;
UpdateCustomTextures();
return;
}
if ( !Q_stricmp( command, "prevcustomtexture" ) )
{
--m_iUserImageIndex;
UpdateCustomTextures();
return;
}
}
void CAbuseReportDlg::MakeModal()
{
TFModalStack()->PushModal( this );
MakePopup();
MoveToFront();
SetKeyBoardInputEnabled( true );
SetMouseInputEnabled( true );
// !KLUDGE! Initially set the dialog to be hidden, so we can take a screenshot!
SetEnabled( m_pIncidentData != NULL );
//SetVisible( m_pIncidentData != NULL );
}
void CAbuseReportDlg::Close()
{
TFModalStack()->PopModal( this );
SetVisible( false );
MarkForDeletion();
}
const char *CAbuseReportDlg::GetResFilename()
{
return "Resource/UI/AbuseReportSubmitDialog.res";
//return "Resource/UI/QuickplayDialog.res";
}
void CAbuseReportDlg::PerformLayout()
{
BaseClass::PerformLayout();
// Center it, keeping requested size
int x, y, ww, wt, wide, tall;
vgui::surface()->GetWorkspaceBounds( x, y, ww, wt );
GetSize(wide, tall);
SetPos(x + ((ww - wide) / 2), y + ((wt - tall) / 2));
// @todo setup
}
class CCustomTextureImagePanel : public vgui::Panel
{
public:
CCustomTextureImagePanel( Panel *parent, const char *panelName ) : vgui::Panel( parent, panelName )
{
m_ugcHandle = 0;
}
uint64 m_ugcHandle;
virtual void Paint()
{
if ( m_ugcHandle == 0 )
{
return;
}
int iTextureHandle = GetCustomTextureGuiHandle( m_ugcHandle );
if ( iTextureHandle <= 0)
{
return;
}
vgui::surface()->DrawSetColor(COLOR_WHITE);
vgui::surface()->DrawSetTexture( iTextureHandle );
int iWide, iTall;
GetSize( iWide, iTall );
vgui::Vertex_t verts[4];
verts[0].Init( Vector2D( 0, 0 ), Vector2D( 0.0f, 0.0f ) );
verts[1].Init( Vector2D( iWide, 0 ), Vector2D( 1.0f, 0.0f ) );
verts[2].Init( Vector2D( iWide, iTall ), Vector2D( 1.0f, 1.0f ) );
verts[3].Init( Vector2D( 0, iTall ), Vector2D( 0.0f, 1.0f ) );
vgui::surface()->DrawTexturedPolygon( 4, verts );
vgui::surface()->DrawSetColor(COLOR_WHITE);
}
};
class CAbuseReportScreenShotPanel : public CBitmapPanel
{
public:
CAbuseReportScreenShotPanel( CAbuseReportDlg *pDlg, const char *panelName )
: CBitmapPanel( pDlg, panelName )
, m_pDlg( pDlg )
{}
CAbuseReportDlg *m_pDlg;
virtual void Paint()
{
CBitmapPanel::Paint();
const AbuseIncidentData_t::PlayerData_t *p = m_pDlg->GetAccusedPlayerPtr();
if ( p == NULL || !p->m_bRenderBoundsValid )
{
return;
}
int w, t;
GetSize( w, t );
int x0 = int( p->m_screenBoundsMin.x * (float)w );
int y0 = int( p->m_screenBoundsMin.y * (float)t );
int x1 = int( p->m_screenBoundsMax.x * (float)w );
int y1 = int( p->m_screenBoundsMax.y * (float)t );
vgui::surface()->DrawSetColor( Color(200, 10, 10, 200 ) );
vgui::surface()->DrawOutlinedRect( x0, y0, x1, y1 );
vgui::surface()->DrawSetColor( COLOR_WHITE );
}
};
void CAbuseReportDlg::ApplySchemeSettings( vgui::IScheme *pScheme )
{
EditablePanel::ApplySchemeSettings( pScheme );
m_pScreenShotBitmap = new CAbuseReportScreenShotPanel( this, "ScreenShotBitmap" );
m_pCustomTextureImagePanel = new CCustomTextureImagePanel( this, "CustomTextureImage" );
LoadControlSettings( GetResFilename() );
m_pPlayerRadio = dynamic_cast<vgui::RadioButton *>(FindChildByName( "PlayerRadio", true ));
Assert( m_pPlayerRadio );
if ( m_pPlayerRadio )
{
m_pPlayerRadio->SetVisible( m_pIncidentData->m_bCanReportGameServer );
}
m_pGameServerRadio = dynamic_cast<vgui::RadioButton *>(FindChildByName( "GameServerRadio", true ));
Assert( m_pGameServerRadio );
if ( m_pGameServerRadio )
{
m_pGameServerRadio->SetVisible( m_pIncidentData->m_bCanReportGameServer );
}
m_pPlayerLabel = FindChildByName( "PlayerLabel", true );
Assert( m_pPlayerLabel );
m_pScreenShotAttachCheckButton = dynamic_cast<vgui::CheckButton *>(FindChildByName( "ScreenShotAttachCheckButton", true ));
Assert( m_pScreenShotAttachCheckButton );
if ( m_pScreenShotAttachCheckButton )
{
m_pScreenShotAttachCheckButton->SetSelected( true );
}
m_pSubmitButton = dynamic_cast<vgui::Button *>(FindChildByName( "SubmitButton", true ));
Assert( m_pSubmitButton );
m_pDescriptionTextEntry = dynamic_cast<vgui::TextEntry *>(FindChildByName( "DescriptionTextEntry", true ));
Assert( m_pDescriptionTextEntry );
if ( m_pDescriptionTextEntry )
{
m_pDescriptionTextEntry->SetMultiline( true );
}
m_pAvatarImage = dynamic_cast<CAvatarImagePanel *>(FindChildByName( "AvatarImage", true ));
Assert( m_pAvatarImage );
m_pNoAvatarLabel = FindChildByName( "NoAvatarLabel", true );
Assert( m_pNoAvatarLabel );
m_pNoCustomTexturesLabel = FindChildByName( "NoCustomTexturesLabel", true );
Assert( m_pNoCustomTexturesLabel );
m_pCustomTextureNextButton = dynamic_cast<vgui::Button *>(FindChildByName( "CustomTextureNextButton", true ));
Assert( m_pCustomTextureNextButton );
m_pCustomTexturePrevButton = dynamic_cast<vgui::Button *>(FindChildByName( "CustomTexturePrevButton", true ));
Assert( m_pCustomTexturePrevButton );
m_pPlayerCombo = dynamic_cast<vgui::ComboBox *>(FindChildByName( "PlayerComboBox", true ));
Assert( m_pPlayerCombo );
m_pAbuseContentLabel = FindChildByName( "AbuseContentLabel", true );
Assert( m_pAbuseContentLabel );
m_pAbuseContentCombo = dynamic_cast<vgui::ComboBox *>(FindChildByName( "AbuseContentComboBox", true ));
Assert( m_pAbuseContentCombo );
if ( m_pAbuseContentCombo )
{
m_pAbuseContentCombo->AddItem( "#AbuseReport_SelectOne", new KeyValues( "AbuseContent", "code", k_EAbuseReportContentNoSelection ) );
m_pAbuseContentCombo->AddItem( "#AbuseReport_ContentAvatarImage", new KeyValues( "AbuseContent", "code", k_EAbuseReportContentAvatarImage ) );
m_pAbuseContentCombo->AddItem( "#AbuseReport_ContentPlayerName", new KeyValues( "AbuseContent", "code", k_EAbuseReportContentPersonaName ) );
m_pAbuseContentCombo->AddItem( "#AbuseReport_ContentItemDecal", new KeyValues( "AbuseContent", "code", k_EAbuseReportContentUGCImage ) );
m_pAbuseContentCombo->AddItem( "#AbuseReport_ContentChatText", new KeyValues( "AbuseContent", "code", k_EAbuseReportContentComments ) );
m_pAbuseContentCombo->AddItem( "#AbuseReport_ContentCheating", new KeyValues( "AbuseContent", "code", k_EAbuseReportContentCheating ) );
m_pAbuseContentCombo->AddItem( "#AbuseReport_ContentOther", new KeyValues( "AbuseContent", "code", k_EAbuseReportContentUnspecified ) );
m_pAbuseContentCombo->SilentActivateItemByRow( 0 );
m_pAbuseContentCombo->SetNumberOfEditLines( m_pAbuseContentCombo->GetItemCount() );
}
m_pAbuseTypeLabel = FindChildByName( "AbuseTypeLabel", true );
Assert( m_pAbuseTypeLabel );
m_pAbuseTypeCombo = dynamic_cast<vgui::ComboBox *>(FindChildByName( "AbuseTypeComboBox", true ));
Assert( m_pAbuseTypeCombo );
Assert( m_pScreenShotBitmap );
if ( m_pScreenShotBitmap && m_pIncidentData->m_bitmapScreenshot.IsValid() )
{
m_pScreenShotBitmap->SetBitmap( m_pIncidentData->m_bitmapScreenshot );
}
PopulatePlayerList();
SetIsAccusingGameServer( false );
SetEnabled( true );
SetVisible( true );
}
bool CAbuseReportDlg::IsAccusingGameServer()
{
return m_pIncidentData && m_pIncidentData->m_bCanReportGameServer && m_pGameServerRadio && m_pGameServerRadio->IsSelected();
}
EAbuseReportContentType CAbuseReportDlg::GetAbuseContentType()
{
if ( m_pAbuseContentCombo == NULL || IsAccusingGameServer() )
{
Assert( m_pAbuseContentCombo );
return k_EAbuseReportContentNoSelection;
}
KeyValues *pUserData = m_pAbuseContentCombo->GetActiveItemUserData();
if ( pUserData == NULL )
{
return k_EAbuseReportContentNoSelection;
}
return (EAbuseReportContentType)pUserData->GetInt( "code", k_EAbuseReportContentNoSelection );
}
EAbuseReportType CAbuseReportDlg::GetAbuseType()
{
if ( m_pAbuseTypeCombo == NULL || IsAccusingGameServer() )
{
Assert( m_pAbuseTypeCombo );
return k_EAbuseReportTypeNoSelection;
}
KeyValues *pUserData = m_pAbuseTypeCombo->GetActiveItemUserData();
if ( pUserData == NULL )
{
return k_EAbuseReportTypeNoSelection;
}
return (EAbuseReportType)pUserData->GetInt( "code", k_EAbuseReportTypeNoSelection );
}
CUtlString CAbuseReportDlg::GetAbuseDescription()
{
char buf[ 1024 ] = "";
if ( m_pDescriptionTextEntry )
{
m_pDescriptionTextEntry->GetText( buf, ARRAYSIZE(buf) );
}
return CUtlString( buf );
}
int CAbuseReportDlg::GetAccusedPlayerIndex()
{
// If accusing a game server, then there's no player
if ( IsAccusingGameServer() )
{
return -1;
}
if ( m_pPlayerCombo == NULL )
{
Assert( m_pPlayerCombo );
return -1;
}
// Item 0 is the "<select one>" item
return m_pPlayerCombo->GetActiveItem() - 1;
}
const AbuseIncidentData_t::PlayerData_t *CAbuseReportDlg::GetAccusedPlayerPtr()
{
int iPlayerIndex = GetAccusedPlayerIndex();
if ( iPlayerIndex < 0 )
return NULL;
return &m_pIncidentData->m_vecPlayers[ iPlayerIndex ];
}
bool CAbuseReportDlg::GetAttachScreenShot()
{
if ( m_pScreenShotAttachCheckButton == NULL )
{
return false;
}
if ( !m_pScreenShotAttachCheckButton->IsVisible() )
{
// We hide the checkbutton when the option is not applicable
return false;
}
return m_pScreenShotAttachCheckButton->IsSelected();
}
void CAbuseReportDlg::PopulatePlayerList()
{
if ( m_pIncidentData == NULL || m_pPlayerCombo == NULL )
{
Assert( m_pIncidentData );
Assert( m_pPlayerCombo );
return;
}
m_pPlayerCombo->RemoveAll();
m_pPlayerCombo->AddItem( "#AbuseReport_SelectOne", NULL );
for ( int i = 0 ; i < m_pIncidentData->m_vecPlayers.Count() ; ++i )
{
AbuseIncidentData_t::PlayerData_t *p = &m_pIncidentData->m_vecPlayers[i];
m_pPlayerCombo->AddItem( p->m_sPersona, NULL );
}
m_pPlayerCombo->SilentActivateItemByRow( 0 );
m_pPlayerCombo->SetNumberOfEditLines( MIN( m_pPlayerCombo->GetItemCount()+1, 12 ) );
}
void CAbuseReportDlg::UpdateSubmitButton()
{
if ( !m_pSubmitButton )
{
Assert( m_pSubmitButton );
return;
}
bool bEnable = false;
if ( IsAccusingGameServer() )
{
bEnable = true;
}
else
{
EAbuseReportContentType eContent = GetAbuseContentType();
const AbuseIncidentData_t::PlayerData_t *pAccused = GetAccusedPlayerPtr();
if (
eContent >= 0
&& GetAbuseType() >= 0
&& pAccused != NULL )
{
bEnable = true;
if ( eContent == k_EAbuseReportContentAvatarImage && pAccused->m_iSteamAvatarIndex <= 0 )
{
// Cannot accuse somebody of having a bad avatar image, if they
// don't have one set
bEnable = false;
}
}
}
if ( GetAbuseDescription().IsEmpty() )
{
bEnable = false;
}
m_pSubmitButton->SetEnabled( bEnable );
}
void CAbuseReportDlg::ContentTypeChanged()
{
// Save current abuse type. We want to keep it the same,
// if possible
EAbuseReportType abuseType = GetAbuseType();
EAbuseReportContentType contentType = GetAbuseContentType();
// Show/hide screen shot / image select
bool bShowScreenshot = false;
bool bShowAttach = false;
switch ( contentType )
{
default:
Assert( false );
case k_EAbuseReportContentNoSelection:
case k_EAbuseReportContentPersonaName:
bShowScreenshot = true;
bShowAttach = false;
break;
case k_EAbuseReportContentUnspecified:
case k_EAbuseReportContentComments:
case k_EAbuseReportContentCheating:
bShowScreenshot = true;
bShowAttach = true;
break;
case k_EAbuseReportContentAvatarImage:
case k_EAbuseReportContentUGCImage:
bShowScreenshot = false;
bShowAttach = false;
break;
}
bShowScreenshot = bShowScreenshot && m_pIncidentData->m_bitmapScreenshot.IsValid();
// Make sure we have everything we need to upload a screenshot
bShowAttach = bShowAttach
&& bShowScreenshot
&& ( GetAccusedPlayerIndex() >= 0 )
&& m_pIncidentData->m_bufScreenshotFileData.TellPut() > 0
&& steamapicontext
&& ( steamapicontext->SteamUtils() != NULL )
&& ( steamapicontext->SteamRemoteStorage() != NULL );
if ( m_pScreenShotBitmap )
{
m_pScreenShotBitmap->SetVisible( bShowScreenshot );
}
if ( m_pScreenShotAttachCheckButton )
{
m_pScreenShotAttachCheckButton->SetVisible( bShowAttach );
}
UpdateAvatarImage();
UpdateCustomTextures();
// Populate abuse type
if ( m_pAbuseTypeCombo )
{
// If the combo box was invisible, then they didn't really make a purposeful decision
if ( !m_pAbuseTypeCombo->IsVisible() )
{
abuseType = k_EAbuseReportTypeNoSelection;
}
m_pAbuseTypeCombo->RemoveAll();
switch ( contentType )
{
default:
Assert( false );
case k_EAbuseReportContentNoSelection:
m_pAbuseTypeCombo->SetVisible( false );
abuseType = k_EAbuseReportTypeNoSelection;
m_pAbuseTypeCombo->AddItem( "#AbuseReport_SelectOne", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeNoSelection ) );
break;
case k_EAbuseReportContentCheating:
m_pAbuseTypeCombo->SetVisible( false );
abuseType = k_EAbuseReportTypeCheating;
m_pAbuseTypeCombo->AddItem( "#AbuseReport_TypeCheating", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeCheating ) );
break;
case k_EAbuseReportContentUnspecified:
case k_EAbuseReportContentComments:
case k_EAbuseReportContentPersonaName:
case k_EAbuseReportContentAvatarImage:
case k_EAbuseReportContentUGCImage:
m_pAbuseTypeCombo->SetVisible( true );
m_pAbuseTypeCombo->AddItem( "#AbuseReport_SelectOne", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeNoSelection ) );
m_pAbuseTypeCombo->AddItem( "#AbuseReport_TypeSpam", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeSpamming ) );
m_pAbuseTypeCombo->AddItem( "#AbuseReport_TypeAdvertisement", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeAdvertisement ) );
m_pAbuseTypeCombo->AddItem( "#AbuseReport_TypeLanguage", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeLanguage ) );
m_pAbuseTypeCombo->AddItem( "#AbuseReport_TypeAdultContent", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeAdultContent ) );
m_pAbuseTypeCombo->AddItem( "#AbuseReport_TypeHarassment", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeHarassment ) );
m_pAbuseTypeCombo->AddItem( "#AbuseReport_TypeProhibited", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeProhibited ) );
m_pAbuseTypeCombo->AddItem( "#AbuseReport_TypeSpoofing", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeSpoofing ) );
//m_pAbuseTypeCombo->AddItem( "#AbuseReport_TypeCheating", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeCheating ) );
m_pAbuseTypeCombo->AddItem( "#AbuseReport_TypeInappropriate", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeInappropriate ) );
m_pAbuseTypeCombo->AddItem( "#AbuseReport_TypeOther", new KeyValues( "AbuseType", "code", k_EAbuseReportTypeUnspecified ) );
break;
}
// Now select the proper row
int sel = 0;
for ( int i = 0 ; i < m_pAbuseTypeCombo->GetItemCount() ; ++i ) {
if ( m_pAbuseTypeCombo->GetItemUserData(i)->GetInt("code") == abuseType )
{
sel = i;
break;
}
}
m_pAbuseTypeCombo->SilentActivateItemByRow( sel );
m_pAbuseTypeCombo->SetNumberOfEditLines( m_pAbuseTypeCombo->GetItemCount() );
if ( m_pAbuseTypeLabel )
{
m_pAbuseTypeLabel->SetVisible( m_pAbuseTypeCombo->IsVisible() );
}
}
UpdateSubmitButton();
}
void CAbuseReportDlg::OnRadioButtonChecked( vgui::Panel *panel )
{
if ( panel == m_pPlayerRadio )
{
SetIsAccusingGameServer( false );
}
else if ( panel == m_pGameServerRadio )
{
SetIsAccusingGameServer( true );
}
else
{
Assert( !"Clicked on unknown radio" );
}
}
void CAbuseReportDlg::SetIsAccusingGameServer( bool bAccuseGameServer )
{
if ( m_pGameServerRadio && m_pGameServerRadio->IsSelected() != bAccuseGameServer )
{
m_pGameServerRadio->SetSelected( bAccuseGameServer );
}
if ( m_pPlayerRadio && m_pPlayerRadio->IsSelected() == bAccuseGameServer)
{
m_pPlayerRadio->SetSelected( !bAccuseGameServer );
}
if ( m_pPlayerLabel )
{
m_pPlayerLabel->SetVisible( !bAccuseGameServer );
}
if ( m_pPlayerCombo )
{
m_pPlayerCombo->SetVisible( !bAccuseGameServer );
}
PlayerChanged();
}
void CAbuseReportDlg::PlayerChanged()
{
m_iUserImageIndex = 0;
bool bShow = ( GetAccusedPlayerIndex() >= 0 );
if ( m_pAbuseContentCombo != NULL )
{
m_pAbuseContentCombo->SetVisible( bShow );
}
if ( m_pAbuseContentLabel != NULL )
{
m_pAbuseContentLabel->SetVisible( bShow );
}
ContentTypeChanged();
}
void CAbuseReportDlg::UpdateAvatarImage()
{
if ( m_pAvatarImage == NULL || m_pNoAvatarLabel == NULL )
{
Assert( m_pAvatarImage );
Assert( m_pNoAvatarLabel );
return;
}
const AbuseIncidentData_t::PlayerData_t *pAccused = GetAccusedPlayerPtr();
if ( GetAbuseContentType() == k_EAbuseReportContentAvatarImage && pAccused != NULL )
{
if ( pAccused->m_iSteamAvatarIndex > 0 )
{
m_pAvatarImage->SetShouldDrawFriendIcon( false );
m_pAvatarImage->SetPlayer( pAccused->m_steamID, k_EAvatarSize184x184 );
m_pAvatarImage->SetVisible( true );
m_pNoAvatarLabel->SetVisible( false );
}
else
{
m_pAvatarImage->SetVisible( false );
m_pNoAvatarLabel->SetVisible( true );
}
}
else
{
m_pAvatarImage->SetVisible( false );
m_pNoAvatarLabel->SetVisible( false );
}
}
void CAbuseReportDlg::UpdateCustomTextures()
{
if ( m_pCustomTextureImagePanel == NULL || m_pNoCustomTexturesLabel == NULL || m_pCustomTextureNextButton == NULL || m_pCustomTexturePrevButton == NULL )
{
Assert( m_pCustomTextureImagePanel );
Assert( m_pNoCustomTexturesLabel );
Assert( m_pCustomTextureNextButton );
Assert( m_pCustomTexturePrevButton );
return;
}
const AbuseIncidentData_t::PlayerData_t *pAccused = GetAccusedPlayerPtr();
bool bShowScrollButtons = false;
if ( GetAbuseContentType() == k_EAbuseReportContentUGCImage && pAccused != NULL )
{
int iSelectedCustomImage = GetSelectedCustomImage();
if ( iSelectedCustomImage >= 0 )
{
// Currently the only thing we support...
Assert( pAccused->m_vecImages[ iSelectedCustomImage].m_eType == AbuseIncidentData_t::k_PlayerImageType_UGC );
m_pCustomTextureImagePanel->m_ugcHandle = pAccused->m_vecImages[ iSelectedCustomImage].m_hUGCHandle;
m_pCustomTextureImagePanel->SetVisible( true );
m_pNoCustomTexturesLabel->SetVisible( false );
int n = pAccused->m_vecImages.Count();
if ( n > 1 )
{
bShowScrollButtons = true;
m_pCustomTextureNextButton->SetEnabled( iSelectedCustomImage < n-1 );
m_pCustomTexturePrevButton->SetEnabled( iSelectedCustomImage > 0 );
}
}
else
{
m_pCustomTextureImagePanel->SetVisible( false );
m_pNoCustomTexturesLabel->SetVisible( true );
}
}
else
{
m_pCustomTextureImagePanel->SetVisible( false );
m_pNoCustomTexturesLabel->SetVisible( false );
}
m_pCustomTextureNextButton->SetVisible( bShowScrollButtons );
m_pCustomTexturePrevButton->SetVisible( bShowScrollButtons );
}
int CAbuseReportDlg::GetSelectedCustomImage()
{
if ( GetAbuseContentType() != k_EAbuseReportContentUGCImage )
{
m_iUserImageIndex = 0;
return -1;
}
const AbuseIncidentData_t::PlayerData_t *pAccused = GetAccusedPlayerPtr();
if ( pAccused == NULL )
{
m_iUserImageIndex = 0;
return -1;
}
int n = pAccused->m_vecImages.Count();
if ( n < 1 )
{
m_iUserImageIndex = 0;
return -1;
}
// Wrap currently selected index
m_iUserImageIndex = ( m_iUserImageIndex + n*10 ) % n;
// Return it
return m_iUserImageIndex;
}
void CAbuseReportDlg::OnTextChanged( vgui::Panel *panel )
{
if ( panel == m_pPlayerCombo )
{
PlayerChanged();
}
else if ( panel == m_pAbuseContentCombo )
{
ContentTypeChanged();
}
else
{
UpdateSubmitButton();
}
}
//-----------------------------------------------------------------------------
// Purpose: Job to do the async work of submitting the report
//-----------------------------------------------------------------------------
class CSubmitAbuseReportJob : public GCSDK::CGCClientJob
{
public:
bool m_bGameServer;
CSubmitAbuseReportJob( )
: GCSDK::CGCClientJob( GCClientSystem()->GetGCClient() )
{
m_bGameServer = false;
}
virtual bool BYieldingRunGCJob()
{
EResult result = RunJob();
// Tear down our dialogs
CloseWaitingDialog();
CAbuseReportDlg *pDlg = g_AbuseReportDlg.Get();
if ( pDlg )
{
pDlg->Close();
pDlg = NULL;
}
// And destroy the queued report!
g_AbuseReportMgr->DestroyIncidentData();
// now show a dialog box explaining the outcome
switch ( result )
{
case k_EResultOK:
ShowMessageBox( "#AbuseReport_SucceededTitle", "#AbuseReport_SucceededMessage", "#GameUI_OK" );
break;
case k_EResultLimitExceeded:
ShowMessageBox(
"#AbuseReport_TooMuchFailedTitle",
m_bGameServer ? "#AbuseReport_TooMuchFailedMessageGameServer" : "#AbuseReport_TooMuchFailedMessage",
"#GameUI_OK"
);
break;
default:
ShowMessageBox( "#AbuseReport_GenericFailureTitle", "#AbuseReport_GenericFailureMessage", "#GameUI_OK" );
break;
}
return true;
}
EResult RunJob()
{
CAbuseReportDlg *pDlg = g_AbuseReportDlg.Get();
if ( pDlg == NULL )
{
return k_EResultFail;
}
m_bGameServer = pDlg->IsAccusingGameServer();
EAbuseReportContentType eContentSelected = pDlg->GetAbuseContentType();
EAbuseReportContentType eContentReported = eContentSelected;
EAbuseReportType eAbuseType = pDlg->GetAbuseType();
const AbuseIncidentData_t::PlayerData_t *pAccused = pDlg->GetAccusedPlayerPtr();
const AbuseIncidentData_t *pIncidentData = g_AbuseReportMgr->GetIncidentData();
CUtlString sAbuseDescription = pDlg->GetAbuseDescription();
netadr_t adrGameServer = pIncidentData->m_adrGameServer;
CSteamID steamIDGameServer = pIncidentData->m_steamIDGameServer;
uint64 gid = 0;
// Check if we should upload the screenshot
if ( pDlg->GetAttachScreenShot() && steamapicontext && steamapicontext->SteamUtils() && steamapicontext->SteamRemoteStorage() )
{
// Write the local copy of the file
if ( !steamapicontext->SteamRemoteStorage()->FileWrite( CAbuseReportManager::k_rchScreenShotFilename, pIncidentData->m_bufScreenshotFileData.Base(), pIncidentData->m_bufScreenshotFileData.TellPut() ) )
{
Warning( "Failed to save local cloud copy of %s\n", CAbuseReportManager::k_rchScreenShotFilename );
return k_EResultFail;
}
// Share it. This initiates the upload to cloud
Msg( "Starting upload of %s to UFS....\n", CAbuseReportManager::k_rchScreenShotFilename );
SteamAPICall_t hFileShareApiCall = steamapicontext->SteamRemoteStorage()->FileShare( CAbuseReportManager::k_rchScreenShotFilename );
if ( hFileShareApiCall == k_uAPICallInvalid )
{
Warning( "Failed to share %s\n", CAbuseReportManager::k_rchScreenShotFilename );
return k_EResultFail;
}
// Check if we're busy
bool bFailed;
RemoteStorageFileShareResult_t result;
while ( !steamapicontext->SteamUtils()->GetAPICallResult(hFileShareApiCall,
&result, sizeof(result), RemoteStorageFileShareResult_t::k_iCallback, &bFailed) )
{
BYield();
}
// Clear pointer, it could have been destroyed while we were yielding, make sure we don't reference it
pDlg = NULL;
if ( bFailed || result.m_eResult != k_EResultOK )
{
Warning( "Failed to share %s; result code %d\n", CAbuseReportManager::k_rchScreenShotFilename, result.m_eResult );
return result.m_eResult;
}
Msg( "%s shared to UGC OK\n", CAbuseReportManager::k_rchScreenShotFilename );
gid = result.m_hFile;
// SWitch the content type being reported, so the support tool will know what to
// do with the GID.
eContentReported = k_EAbuseReportContentActorUGCImage;
}
else if ( eContentSelected == k_EAbuseReportContentUGCImage )
{
Assert( !m_bGameServer );
int iImageindex = pDlg->GetSelectedCustomImage();
Assert( iImageindex >= 0 );
gid = pAccused->m_vecImages[iImageindex].m_hUGCHandle;
}
//
// Fill out the report message
//
GCSDK::CProtoBufMsg<CMsgGCReportAbuse> msg( k_EMsgGC_ReportAbuse );
if ( m_bGameServer )
{
msg.Body().set_target_steam_id( steamIDGameServer.ConvertToUint64() );
msg.Body().set_target_game_server_ip( adrGameServer.GetIPHostByteOrder() );
msg.Body().set_target_game_server_port( adrGameServer.GetPort() );
}
else
{
msg.Body().set_target_steam_id( pAccused->m_steamID.ConvertToUint64() );
msg.Body().set_content_type( eContentReported );
msg.Body().set_abuse_type( eAbuseType );
}
msg.Body().set_description( sAbuseDescription );
if (gid != 0 )
{
msg.Body().set_gid( gid );
}
// Send the message to the GC, and await the reply
GCSDK::CProtoBufMsg<CMsgGCReportAbuseResponse> msgReply;
if ( !BYldSendMessageAndGetReply( msg, 10, &msgReply, k_EMsgGC_ReportAbuseResponse ) )
{
Warning( "Abuse report failed: Did not get reply from GC\n" );
return k_EResultTimeout;
}
EResult result = (EResult)msgReply.Body().result();
if ( result != k_EResultOK )
{
Warning( "Abuse report failed with failure code %d. %s\n", result, msgReply.Body().error_message().c_str() );
}
// OK
return result;
}
};
void CAbuseReportDlg::OnSubmitReport()
{
// throw up a waiting dialog
SetEnabled( false );
ShowWaitingDialog( new CGenericWaitingDialog( this ), "#AbuseReport_Busy", true, false, 0.0f );
// We need to be in the global singleton handle, because that's how the job knows
// to get to us (and how it knows if we've died)!
Assert( g_AbuseReportDlg.Get() == this );
// Start a job
CSubmitAbuseReportJob *pJob = new CSubmitAbuseReportJob();
pJob->StartJob( NULL );
}
-100
View File
@@ -1,100 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Generic in-game abuse reporting
//
// $NoKeywords: $
//=============================================================================//
#ifndef ABUSE_REPORT_UI_H
#define ABUSE_REPORT_UI_H
#ifdef _WIN32
#pragma once
#endif
#include "abuse_report.h"
#include <vgui_controls/EditablePanel.h>
class CAvatarImagePanel;
class CCustomTextureImagePanel;
class CAbuseReportScreenShotPanel;
class CAbuseReportDlg : public vgui::EditablePanel
{
DECLARE_CLASS_SIMPLE( CAbuseReportDlg, vgui::EditablePanel );
public:
CAbuseReportDlg( vgui::Panel *parent, AbuseIncidentData_t *pIncidentData );
~CAbuseReportDlg();
virtual void OnCommand(const char *command);
virtual void Close();
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual void PerformLayout();
virtual void MakeModal();
bool IsAccusingGameServer();
EAbuseReportContentType GetAbuseContentType();
EAbuseReportType GetAbuseType();
int GetAccusedPlayerIndex();
const AbuseIncidentData_t::PlayerData_t *GetAccusedPlayerPtr();
int GetUserImageIndex();
int GetSelectedCustomImage();
CUtlString GetAbuseDescription();
bool GetAttachScreenShot();
protected:
MESSAGE_FUNC_PTR( OnRadioButtonChecked, "RadioButtonChecked", panel );
virtual const char *GetResFilename();
vgui::Button *m_pSubmitButton;
vgui::Button *m_pScreenShot;
vgui::CheckButton *m_pScreenShotAttachCheckButton;
vgui::Button *m_pCustomTextureNextButton;
vgui::Button *m_pCustomTexturePrevButton;
vgui::Button *m_pOffensiveImage;
vgui::TextEntry *m_pDescriptionTextEntry;
vgui::Panel *m_pPlayerLabel;
vgui::RadioButton *m_pPlayerRadio;
vgui::RadioButton *m_pGameServerRadio;
vgui::ComboBox *m_pPlayerCombo;
vgui::Panel *m_pAbuseContentLabel;
vgui::ComboBox *m_pAbuseContentCombo;
vgui::Panel *m_pAbuseTypeLabel;
vgui::ComboBox *m_pAbuseTypeCombo;
CAbuseReportScreenShotPanel *m_pScreenShotBitmap;
CAvatarImagePanel *m_pAvatarImage;
vgui::Panel *m_pNoAvatarLabel;
CCustomTextureImagePanel *m_pCustomTextureImagePanel;
vgui::Panel *m_pNoCustomTexturesLabel;
AbuseIncidentData_t *m_pIncidentData;
int m_iUserImageIndex;
MESSAGE_FUNC_PTR( OnTextChanged, "TextChanged", panel ); // send by combo box when it changes
void PopulatePlayerList();
void UpdateSubmitButton();
void SetIsAccusingGameServer( bool bAccuseGameServer );
void PlayerChanged();
void ContentTypeChanged();
void UpdateAvatarImage();
void UpdateCustomTextures();
virtual void OnSubmitReport();
};
/// Global pointer to the submission dialiog.
/// NULL if it's not displayed
extern vgui::DHANDLE<CAbuseReportDlg> g_AbuseReportDlg;
#endif // ABUSE_REPORT_UI_H
@@ -101,7 +101,6 @@ void CAchievementNotificationPanel::FireGameEvent( IGameEvent * event )
int iMax = event->GetInt( "max_val" );
wchar_t szLocalizedName[256]=L"";
#if 0
if ( IsPC() )
{
// shouldn't ever get achievement progress if steam not running and user logged in, but check just in case
@@ -116,7 +115,6 @@ void CAchievementNotificationPanel::FireGameEvent( IGameEvent * event )
}
}
else
#endif
{
// on X360 we need to show our own achievement progress UI
@@ -139,7 +137,7 @@ void CAchievementNotificationPanel::FireGameEvent( IGameEvent * event )
return;
Q_wcsncpy( szFmt, pchFmt, sizeof( szFmt ) );
g_pVGuiLocalize->ConstructString_safe( szText, szFmt, 3, szLocalizedName, szNumFound, szNumTotal );
g_pVGuiLocalize->ConstructString( szText, sizeof( szText ), szFmt, 3, szLocalizedName, szNumFound, szNumTotal );
AddNotification( pchName, g_pVGuiLocalize->Find( "#GameUI_Achievement_Progress" ), szText );
}
}
@@ -247,7 +245,7 @@ void CAchievementNotificationPanel::SetXAndWide( Panel *pPanel, int x, int wide
pPanel->SetWide( wide );
}
CON_COMMAND_F( achievement_notification_test, "Test the hud notification UI", FCVAR_CHEAT )
CON_COMMAND_F( achievement_notification_test, "Test the hud notification UI", FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY )
{
static int iCount=0;
+9 -19
View File
@@ -11,8 +11,6 @@
#include "materialsystem/itexture.h"
#include "tier1/KeyValues.h"
#include "toolframework_client.h"
#include "tier0/minidump.h"
#include "tier0/stacktools.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@@ -41,34 +39,26 @@ CBaseAnimatedTextureProxy::~CBaseAnimatedTextureProxy()
bool CBaseAnimatedTextureProxy::Init( IMaterial *pMaterial, KeyValues *pKeyValues )
{
char const* pAnimatedTextureVarName = pKeyValues->GetString( "animatedTextureVar" );
if( !pAnimatedTextureVarName )
return false;
if( pAnimatedTextureVarName )
{
bool foundVar;
m_AnimatedTextureVar = pMaterial->FindVar( pAnimatedTextureVarName, &foundVar, false );
if( foundVar )
{
if( !foundVar )
return false;
char const* pAnimatedTextureFrameNumVarName = pKeyValues->GetString( "animatedTextureFrameNumVar" );
if( !pAnimatedTextureFrameNumVarName )
return false;
if( pAnimatedTextureFrameNumVarName )
{
m_AnimatedTextureFrameNumVar = pMaterial->FindVar( pAnimatedTextureFrameNumVarName, &foundVar, false );
if( !foundVar )
return false;
if( foundVar )
{
m_FrameRate = pKeyValues->GetFloat( "animatedTextureFrameRate", 15 );
m_WrapAnimation = !pKeyValues->GetInt( "animationNoWrap", 0 );
return true;
}
}
}
}
// Error - null out pointers.
Cleanup();
return false;
}
void CBaseAnimatedTextureProxy::Cleanup()
{
+2 -2
View File
@@ -831,8 +831,8 @@ void DrawSplineSegs( int noise_divisions, float *prgNoise,
}
else if ( flags & FBEAM_SHADEOUT )
{
float fadeFractionOut = fadeLength/length;
brightness = 1.0 - (fraction/ fadeFractionOut);
float fadeFraction = fadeLength/length;
brightness = 1.0 - (fraction/fadeFraction);
if (brightness < 0)
{
brightness = 0;
-170
View File
@@ -1,170 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Exposes bsp tools to game for e.g. workshop use
//
// $NoKeywords: $
//===========================================================================//
#include "cbase.h"
#include <tier2/tier2.h>
#include "filesystem.h"
#include "bsp_utils.h"
#include "utlbuffer.h"
#include "igamesystem.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
bool BSP_SyncRepack( const char *pszInputMapFile,
const char *pszOutputMapFile,
IBSPPack::eRepackBSPFlags eRepackFlags )
{
// load the bsppack dll
IBSPPack *libBSPPack = NULL;
CSysModule *pModule = g_pFullFileSystem->LoadModule( "bsppack" );
if ( pModule )
{
CreateInterfaceFn BSPPackFactory = Sys_GetFactory( pModule );
if ( BSPPackFactory )
{
libBSPPack = ( IBSPPack * )BSPPackFactory( IBSPPACK_VERSION_STRING, NULL );
}
}
if( !libBSPPack )
{
Warning( "Can't load bsppack library - unable to compress bsp\n" );
return false;
}
Msg( "Repacking %s -> %s\n", pszInputMapFile, pszOutputMapFile );
if ( !g_pFullFileSystem->FileExists( pszInputMapFile ) )
{
Warning( "Couldn't open input file %s - BSP recompress failed\n", pszInputMapFile );
return false;
}
CUtlBuffer inputBuffer;
if ( !g_pFullFileSystem->ReadFile( pszInputMapFile, NULL, inputBuffer ) )
{
Warning( "Couldn't read file %s - BSP compression failed\n", pszInputMapFile );
return false;
}
CUtlBuffer outputBuffer;
if ( !libBSPPack->RepackBSP( inputBuffer, outputBuffer, eRepackFlags ) )
{
Warning( "Internal error compressing BSP\n" );
return false;
}
g_pFullFileSystem->WriteFile( pszOutputMapFile, NULL, outputBuffer );
Msg( "Successfully repacked %s as %s -- %u -> %u bytes\n",
pszInputMapFile, pszOutputMapFile, inputBuffer.TellPut(), outputBuffer.TellPut() );
return true;
}
// Helper to create a thread that calls SyncCompressMap, and clean it up when it exists
void BSP_BackgroundRepack( const char *pszInputMapFile,
const char *pszOutputMapFile,
IBSPPack::eRepackBSPFlags eRepackFlags )
{
// Make this a gamesystem and thread, so it can check for completion each frame and clean itself up. Run() is the
// background thread, Update() is the main thread tick.
class BackgroundBSPRepackThread : public CThread, public CAutoGameSystemPerFrame
{
public:
BackgroundBSPRepackThread( const char *pszInputFile, const char *pszOutputFile, IBSPPack::eRepackBSPFlags eRepackFlags )
: m_strInput( pszInputFile )
, m_strOutput( pszOutputFile )
, m_eRepackFlags( eRepackFlags )
{
Start();
}
// CThread job - returns 0 for success
virtual int Run() OVERRIDE
{
return BSP_SyncRepack( m_strInput.Get(), m_strOutput.Get(), m_eRepackFlags ) ? 0 : 1;
}
// GameSystem
virtual const char* Name( void ) OVERRIDE { return "BackgroundBSPRepackThread"; }
// Runs on main thread
void CheckFinished()
{
if ( !IsAlive() )
{
// Thread finished
if ( GetResult() != 0 )
{
Warning( "Map compression thread failed :(\n" );
}
// AutoGameSystem deregisters itself on destruction, we're done
delete this;
}
}
#ifdef CLIENT_DLL
virtual void Update( float frametime ) OVERRIDE { CheckFinished(); }
#else // GAME DLL
virtual void FrameUpdatePostEntityThink() OVERRIDE { CheckFinished(); }
#endif
private:
CUtlString m_strInput;
CUtlString m_strOutput;
IBSPPack::eRepackBSPFlags m_eRepackFlags;
};
Msg( "Starting BSP repack job %s -> %s\n", pszInputMapFile, pszOutputMapFile );
// Deletes itself up when done
new BackgroundBSPRepackThread( pszInputMapFile, pszOutputMapFile, eRepackFlags );
}
CON_COMMAND( bsp_repack, "Repack and output a (re)compressed version of a bsp file" )
{
#ifdef GAME_DLL
if ( !UTIL_IsCommandIssuedByServerAdmin() )
return;
#endif
// Handle -nocompress
bool bCompress = true;
const char *szInFilename = NULL;
const char *szOutFilename = NULL;
if ( args.ArgC() == 4 && V_strcasecmp( args.Arg( 1 ), "-nocompress" ) == 0 )
{
bCompress = false;
szInFilename = args.Arg( 2 );
szOutFilename = args.Arg( 3 );
}
else if ( args.ArgC() == 3 )
{
szInFilename = args.Arg( 1 );
szOutFilename = args.Arg( 2 );
}
if ( !szInFilename || !szOutFilename || !strlen( szInFilename ) || !strlen( szOutFilename ) )
{
Msg( "Usage: bsp_repack [-nocompress] map.bsp output_map.bsp\n" );
return;
}
if ( bCompress )
{
// Use default compress flags
BSP_BackgroundRepack( szInFilename, szOutFilename );
}
else
{
// No compression
BSP_BackgroundRepack( szInFilename, szOutFilename, (IBSPPack::eRepackBSPFlags)0 );
}
}
-21
View File
@@ -1,21 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Exposes bsp tools to game for e.g. workshop use
//
// $NoKeywords: $
//===========================================================================//
#include "../utils/common/bsplib.h"
#include "ibsppack.h"
// Loads bsppack module (IBSPPack) and calls RepackBSP()
bool BSP_SyncRepack( const char *pszInputMapFile,
const char *pszOutputMapFile,
IBSPPack::eRepackBSPFlags eRepackFlags = (IBSPPack::eRepackBSPFlags) ( IBSPPack::eRepackBSP_CompressLumps |
IBSPPack::eRepackBSP_CompressPackfile ) );
// Helper to spawn a background thread that runs SyncRepack
void BSP_BackgroundRepack( const char *pszInputMapFile,
const char *pszOutputMapFile,
IBSPPack::eRepackBSPFlags eRepackFlags = (IBSPPack::eRepackBSPFlags) ( IBSPPack::eRepackBSP_CompressLumps |
IBSPPack::eRepackBSP_CompressPackfile ) );
+4 -15
View File
@@ -135,14 +135,11 @@ void C_AI_BaseNPC::ClientThink( void )
int g = 255 * fFade;
int b = 0 * fFade;
if ( debugoverlay )
{
debugoverlay->AddLineOverlay( p1, p2, r, g, b, true, 0.05f );
debugoverlay->AddLineOverlay( p2, p3, r, g, b, true, 0.05f );
debugoverlay->AddLineOverlay( p3, p1, r, g, b, true, 0.05f );
}
}
}
#endif
}
@@ -156,13 +153,9 @@ void C_AI_BaseNPC::OnDataChanged( DataUpdateType_t type )
}
}
bool C_AI_BaseNPC::GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt )
void C_AI_BaseNPC::GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt )
{
bool bRet = true;
if ( !ForceSetupBonesAtTime( pDeltaBones0, gpGlobals->curtime - boneDt ) )
bRet = false;
ForceSetupBonesAtTime( pDeltaBones0, gpGlobals->curtime - boneDt );
GetRagdollCurSequenceWithDeathPose( this, pDeltaBones1, gpGlobals->curtime, m_iDeathPose, m_iDeathFrame );
float ragdollCreateTime = PhysGetSyncCreateTime();
if ( ragdollCreateTime != gpGlobals->curtime )
@@ -171,15 +164,11 @@ bool C_AI_BaseNPC::GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x
// so initialize the ragdoll at that time so that it will reach the current
// position at curtime. Otherwise the ragdoll will simulate forward from curtime
// and pop into the future a bit at this point of transition
if ( !ForceSetupBonesAtTime( pCurrentBones, ragdollCreateTime ) )
bRet = false;
ForceSetupBonesAtTime( pCurrentBones, ragdollCreateTime );
}
else
{
if ( !SetupBones( pCurrentBones, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, gpGlobals->curtime ) )
bRet = false;
SetupBones( pCurrentBones, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, gpGlobals->curtime );
}
return bRet;
}
+2 -2
View File
@@ -14,7 +14,7 @@
#include "c_basecombatcharacter.h"
// NOTE: Moved all controller code into c_basestudiomodel
// NOTE: MOved all controller code into c_basestudiomodel
class C_AI_BaseNPC : public C_BaseCombatCharacter
{
DECLARE_CLASS( C_AI_BaseNPC, C_BaseCombatCharacter );
@@ -29,7 +29,7 @@ public:
bool ShouldAvoidObstacle( void ){ return m_bPerformAvoidance; }
virtual bool AddRagdollToFadeQueue( void ) { return m_bFadeCorpse; }
virtual bool GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt ) OVERRIDE;
virtual void GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt );
int GetDeathPose( void ) { return m_iDeathPose; }
+109 -386
View File
@@ -58,7 +58,6 @@
#ifdef TF_CLIENT_DLL
#include "c_tf_player.h"
#include "c_baseobject.h"
#include "tf_gamerules.h"
#endif
// memdbgon must be the last include file in a .cpp file!!!
@@ -80,11 +79,6 @@ const float RUN_SPEED_ESTIMATE_SQR = 150.0f * 150.0f;
static ConVar dbganimmodel( "dbganimmodel", "" );
#endif
#if defined( STAGING_ONLY )
static ConVar dbg_bonestack_perturb( "dbg_bonestack_perturb", "0", 0);
static CInterlockedInt dbg_bonestack_reentrant_count = 0;
#endif // STAGING_ONLY
mstudioevent_t *GetEventIndexForSequence( mstudioseqdesc_t &seqdesc );
C_EntityDissolve *DissolveEffect( C_BaseEntity *pTarget, float flTime );
@@ -574,11 +568,8 @@ void C_ClientRagdoll::ClientThink( void )
Vector origin = m_pRagdoll->GetRagdollOrigin();
m_pRagdoll->GetRagdollBounds( vMins, vMaxs );
if ( debugoverlay )
{
debugoverlay->AddBoxOverlay( origin, vMins, vMaxs, QAngle( 0, 0, 0 ), 0, 255, 0, 16, 0 );
}
}
HandleAnimatedFriction();
@@ -641,10 +632,7 @@ void C_ClientRagdoll::Release( void )
}
ClientEntityList().RemoveEntity( GetClientHandle() );
if ( CollisionProp()->GetPartitionHandle() != PARTITION_INVALID_HANDLE )
{
::partition->Remove( PARTITION_CLIENT_SOLID_EDICTS | PARTITION_CLIENT_RESPONSIVE_EDICTS | PARTITION_CLIENT_NON_STATIC_EDICTS, CollisionProp()->GetPartitionHandle() );
}
partition->Remove( PARTITION_CLIENT_SOLID_EDICTS | PARTITION_CLIENT_RESPONSIVE_EDICTS | PARTITION_CLIENT_NON_STATIC_EDICTS, CollisionProp()->GetPartitionHandle() );
RemoveFromLeafSystem();
BaseClass::Release();
@@ -743,9 +731,6 @@ C_BaseAnimating::C_BaseAnimating() :
m_bDynamicModelPending = false;
m_bResetSequenceInfoOnLoad = false;
m_bInitModelEffects = false;
m_bDelayInitModelEffects = false;
Q_memset(&m_mouth, 0, sizeof(m_mouth));
m_flCycle = 0;
m_flOldCycle = 0;
@@ -759,25 +744,15 @@ C_BaseAnimating::~C_BaseAnimating()
int i = g_PreviousBoneSetups.Find( this );
if ( i != -1 )
g_PreviousBoneSetups.FastRemove( i );
RemoveFromClientSideAnimationList();
TermRopes();
Assert( !m_pRagdoll );
delete m_pRagdollInfo;
m_pRagdollInfo = NULL;
Assert(!m_pRagdoll);
delete m_pIk;
m_pIk = NULL;
delete m_pBoneMergeCache;
m_pBoneMergeCache = NULL;
Studio_DestroyBoneCache( m_hitboxBoneCacheHandle );
delete m_pJiggleBones;
m_pJiggleBones = NULL;
InvalidateMdlCache();
// Kill off anything bone attached to us.
@@ -877,7 +852,7 @@ void C_BaseAnimating::UpdateRelevantInterpolatedVars()
{
MDLCACHE_CRITICAL_SECTION();
// Remove any interpolated vars that need to be removed.
if ( !IsMarkedForDeletion() && !GetPredictable() && !IsClientCreated() && GetModelPtr() && GetModelPtr()->SequencesAvailable() )
if ( !GetPredictable() && !IsClientCreated() && GetModelPtr() && GetModelPtr()->SequencesAvailable() )
{
AddBaseAnimatingInterpolatedVars();
}
@@ -917,17 +892,6 @@ void C_BaseAnimating::RemoveBaseAnimatingInterpolatedVars()
}
}
/*
From Ken: Lock() and Unlock() are render frame only, its just so the mdlcache
doesnt toss the memory when it reshuffles the data, or at least used to. I
don't have any idea if mdlcache even does that anymore, but at one point it would
happily throw away the animation data if you ran out of memory on the
consoles. Jay adds: Ken is correct and the pointer should be valid until the end
of the frame lock (provided you are within a MDLCACHE_LOCK() block or whatever
Jay also recommends running with a forced small cache size (1MB) to put maximum
pressure on the cache when testing changes. Look for datacache ConVar in datacache.cpp.
*/
void C_BaseAnimating::LockStudioHdr()
{
Assert( m_hStudioHdr == MDLHANDLE_INVALID && m_pStudioHdr == NULL );
@@ -999,9 +963,6 @@ void C_BaseAnimating::UnlockStudioHdr()
mdlcache->UnlockStudioHdr( m_hStudioHdr );
}
m_hStudioHdr = MDLHANDLE_INVALID;
delete m_pStudioHdr;
m_pStudioHdr = NULL;
}
}
@@ -1261,10 +1222,7 @@ int C_BaseAnimating::GetHitboxBone( int hitboxIndex )
void C_BaseAnimating::InitModelEffects( void )
{
m_bInitModelEffects = true;
m_bDelayInitModelEffects = true;
TermRopes();
ParticleProp()->StopParticlesInvolving( this );
m_bHasAttachedParticles = false;
}
//-----------------------------------------------------------------------------
@@ -1272,11 +1230,7 @@ void C_BaseAnimating::InitModelEffects( void )
//-----------------------------------------------------------------------------
void C_BaseAnimating::DelayedInitModelEffects( void )
{
// don't create the effect if we're not visible
if ( !ShouldDraw() )
return;
m_bDelayInitModelEffects = false;
m_bInitModelEffects = false;
// Parse the keyvalues and see if they want to make ropes on this model.
KeyValues * modelKeyValues = new KeyValues("");
@@ -1333,29 +1287,25 @@ void C_BaseAnimating::DelayedInitModelEffects( void )
{
// Halloween Spell Effect Check
int iHalloweenSpell = 0;
if ( TF_IsHolidayActive( kHoliday_HalloweenOrFullMoon ) )
{
// if the owner is a Sentry, Check its owner
if ( GetOwnerEntity() && GetOwnerEntity()->IsBaseObject() )
CBaseObject *pSentry = dynamic_cast<CBaseObject*>( GetOwnerEntity() );
if ( pSentry )
{
CBaseObject *pSentry = assert_cast< CBaseObject* >( GetOwnerEntity() );
CALL_ATTRIB_HOOK_INT_ON_OTHER( pSentry->GetOwner(), iHalloweenSpell, halloween_pumpkin_explosions );
}
else
{
CALL_ATTRIB_HOOK_INT_ON_OTHER( GetOwnerEntity(), iHalloweenSpell, halloween_pumpkin_explosions );
}
}
if ( iHalloweenSpell > 0 )
{
pszParticleEffect = "halloween_rockettrail";
}
}
#endif // TF_CLIENT_DLL
#endif
// Spawn the particle effect
ParticleProp()->Create( pszParticleEffect, (ParticleAttachment_t)iAttachType, iAttachment );
m_bHasAttachedParticles = true;
}
}
}
@@ -1564,18 +1514,7 @@ void C_BaseAnimating::BuildTransformations( CStudioHdr *hdr, Vector *pos, Quater
}
else
{
// If the parent bone has been scaled (like with BuildBigHeadTransformations)
// scale it back down so the jiggly bones show up non-scaled in the correct location.
matrix3x4_t parentMX = GetBone( pbones[i].parent );
float fScale = Square( parentMX[0][0] ) + Square( parentMX[1][0] ) + Square( parentMX[2][0] );
if ( fScale > Square( 1.0001f ) )
{
fScale = 1.0f / FastSqrt( fScale );
MatrixScaleBy( fScale, parentMX );
}
ConcatTransforms( parentMX, bonematrix, goalMX );
ConcatTransforms( GetBone( pbones[i].parent ), bonematrix, goalMX );
}
// get jiggle properties from QC data
@@ -2056,10 +1995,10 @@ bool C_BaseAnimating::PutAttachment( int number, const matrix3x4_t &attachmentTo
}
bool C_BaseAnimating::SetupBones_AttachmentHelper( CStudioHdr *hdr )
void C_BaseAnimating::SetupBones_AttachmentHelper( CStudioHdr *hdr )
{
if ( !hdr )
return false;
if ( !hdr || !hdr->GetNumAttachments() )
return;
// calculate attachment points
matrix3x4_t world;
@@ -2085,8 +2024,6 @@ bool C_BaseAnimating::SetupBones_AttachmentHelper( CStudioHdr *hdr )
FormatViewModelAttachment( i, world );
PutAttachment( i + 1, world );
}
return true;
}
bool C_BaseAnimating::CalcAttachments()
@@ -2127,10 +2064,10 @@ bool C_BaseAnimating::GetAttachment( int number, Vector &origin, QAngle &angles
}
CAttachmentData *pData = &m_Attachments[number-1];
if ( pData->m_bAnglesComputed == 0 )
if ( !pData->m_bAnglesComputed )
{
MatrixAngles( pData->m_AttachmentToWorld, pData->m_angRotation );
pData->m_bAnglesComputed = -1;
pData->m_bAnglesComputed = true;
}
angles = pData->m_angRotation;
MatrixPosition( pData->m_AttachmentToWorld, origin );
@@ -2277,36 +2214,18 @@ bool C_BaseAnimating::GetSoundSpatialization( SpatializationInfo_t& info )
return true;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool C_BaseAnimating::IsViewModel() const
{
return false;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_BaseAnimating::UpdateOnRemove( void )
{
RemoveFromClientSideAnimationList( true );
BaseClass::UpdateOnRemove();
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool C_BaseAnimating::IsMenuModel() const
{
return false;
}
// UNDONE: Seems kind of silly to have this when we also have the cached bones in C_BaseAnimating
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
CBoneCache *C_BaseAnimating::GetBoneCache( CStudioHdr *pStudioHdr )
{
int boneMask = BONE_USED_BY_HITBOX;
@@ -2437,8 +2356,8 @@ void C_BaseAnimating::CalculateIKLocks( float currentTime )
// In TF, we might be attaching a player's view to a walking model that's using IK. If we are, it can
// get in here during the view setup code, and it's not normally supposed to be able to access the spatial
// partition that early in the rendering loop. So we allow access right here for that special case.
SpatialPartitionListMask_t curSuppressed = ::partition->GetSuppressedLists();
::partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, false );
SpatialPartitionListMask_t curSuppressed = partition->GetSuppressedLists();
partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, false );
CBaseEntity::PushEnableAbsRecomputations( false );
Ray_t ray;
@@ -2658,18 +2577,18 @@ void C_BaseAnimating::CalculateIKLocks( float currentTime )
#endif
CBaseEntity::PopEnableAbsRecomputations();
::partition->SuppressLists( curSuppressed, true );
partition->SuppressLists( curSuppressed, true );
}
bool C_BaseAnimating::GetPoseParameterRange( int index_, float &minValue, float &maxValue )
bool C_BaseAnimating::GetPoseParameterRange( int index, float &minValue, float &maxValue )
{
CStudioHdr *pStudioHdr = GetModelPtr();
if (pStudioHdr)
{
if ( index_ >= 0 && index_ < pStudioHdr->GetNumPoseParameters())
if (index >= 0 && index < pStudioHdr->GetNumPoseParameters())
{
const mstudioposeparamdesc_t &pose = pStudioHdr->pPoseParameter( index_ );
const mstudioposeparamdesc_t &pose = pStudioHdr->pPoseParameter( index );
minValue = pose.start;
maxValue = pose.end;
return true;
@@ -2692,9 +2611,9 @@ void C_BaseAnimating::ControlMouth( CStudioHdr *pstudiohdr )
if ( !pstudiohdr )
return;
int index_ = LookupPoseParameter( pstudiohdr, LIPSYNC_POSEPARAM_NAME );
int index = LookupPoseParameter( pstudiohdr, LIPSYNC_POSEPARAM_NAME );
if ( index_ != -1 )
if ( index != -1 )
{
float value = GetMouth()->mouthopen / 64.0;
@@ -2704,15 +2623,15 @@ void C_BaseAnimating::ControlMouth( CStudioHdr *pstudiohdr )
value = 1.0;
float start, end;
GetPoseParameterRange( index_, start, end );
GetPoseParameterRange( index, start, end );
value = (1.0 - value) * start + value * end;
//Adrian - Set the pose parameter value.
//It has to be called "mouth".
SetPoseParameter( pstudiohdr, index_, value );
SetPoseParameter( pstudiohdr, index, value );
// Reset interpolation here since the client is controlling this rather than the server...
m_iv_flPoseParameter.SetHistoryValuesForItem( index_, raw );
m_iv_flPoseParameter.SetHistoryValuesForItem( index, raw );
}
}
@@ -2724,11 +2643,7 @@ CMouthInfo *C_BaseAnimating::GetMouth( void )
#ifdef DEBUG_BONE_SETUP_THREADING
ConVar cl_warn_thread_contested_bone_setup("cl_warn_thread_contested_bone_setup", "0" );
#endif
// Marked this developmentonly because it currently crashes, and users are enabling it and complaining because of
// course. Once this actually works it should just be FCVAR_INTERNAL_USE.
ConVar cl_threaded_bone_setup("cl_threaded_bone_setup", "0", FCVAR_DEVELOPMENTONLY | FCVAR_INTERNAL_USE,
"Enable parallel processing of C_BaseAnimating::SetupBones()" );
ConVar cl_threaded_bone_setup("cl_threaded_bone_setup", "0", 0, "Enable parallel processing of C_BaseAnimating::SetupBones()" );
//-----------------------------------------------------------------------------
// Purpose: Do the default sequence blending rules as done in HL1
@@ -2993,11 +2908,7 @@ bool C_BaseAnimating::SetupBones( matrix3x4_t *pBoneToWorldOut, int nMaxBones, i
if( !( oldReadableBones & BONE_USED_BY_ATTACHMENT ) && ( boneMask & BONE_USED_BY_ATTACHMENT ) )
{
if ( !SetupBones_AttachmentHelper( hdr ) )
{
DevWarning( 2, "SetupBones: SetupBones_AttachmentHelper failed.\n" );
return false;
}
SetupBones_AttachmentHelper( hdr );
}
}
@@ -3011,7 +2922,7 @@ bool C_BaseAnimating::SetupBones( matrix3x4_t *pBoneToWorldOut, int nMaxBones, i
}
else
{
ExecuteNTimes( 25, Warning( "SetupBones: invalid bone array size (%d - needs %d)\n", nMaxBones, m_CachedBoneData.Count() ) );
Warning( "SetupBones: invalid bone array size (%d - needs %d)\n", nMaxBones, m_CachedBoneData.Count() );
return false;
}
}
@@ -3078,9 +2989,6 @@ struct BoneAccess
char const *tag;
};
// the modelcache critical section is insufficient for preventing us from getting into the bone cache at the same time.
// The bonecache itself is protected by a mutex, but the actual bone access stack needs to be protected separately.
static CThreadFastMutex g_BoneAccessMutex;
static CUtlVector< BoneAccess > g_BoneAccessStack;
static BoneAccess g_BoneAcessBase;
@@ -3095,9 +3003,6 @@ bool C_BaseAnimating::IsBoneAccessAllowed() const
// (static function)
void C_BaseAnimating::PushAllowBoneAccess( bool bAllowForNormalModels, bool bAllowForViewModels, char const *tagPush )
{
AUTO_LOCK( g_BoneAccessMutex );
STAGING_ONLY_EXEC( ReentrancyVerifier rv( &dbg_bonestack_reentrant_count, dbg_bonestack_perturb.GetInt() ) );
BoneAccess save = g_BoneAcessBase;
g_BoneAccessStack.AddToTail( save );
@@ -3109,9 +3014,6 @@ void C_BaseAnimating::PushAllowBoneAccess( bool bAllowForNormalModels, bool bAll
void C_BaseAnimating::PopBoneAccess( char const *tagPop )
{
AUTO_LOCK( g_BoneAccessMutex );
STAGING_ONLY_EXEC( ReentrancyVerifier rv( &dbg_bonestack_reentrant_count, dbg_bonestack_perturb.GetInt() ) );
// Validate that pop matches the push
Assert( ( g_BoneAcessBase.tag == tagPop ) || ( g_BoneAcessBase.tag && g_BoneAcessBase.tag != ( char const * ) 1 && tagPop && tagPop != ( char const * ) 1 && !strcmp( g_BoneAcessBase.tag, tagPop ) ) );
int lastIndex = g_BoneAccessStack.Count() - 1;
@@ -3145,25 +3047,6 @@ bool C_BaseAnimating::ShouldDraw()
return !IsDynamicModelLoading() && BaseClass::ShouldDraw();
}
void C_BaseAnimating::UpdateVisibility()
{
BaseClass::UpdateVisibility();
if ( ShouldDraw() )
{
if ( !m_bInitModelEffects )
{
InitModelEffects();
}
}
else if ( m_bHasAttachedParticles )
{
ParticleProp()->StopParticlesInvolving( this );
m_bHasAttachedParticles = false;
m_bInitModelEffects = false;
}
}
ConVar r_drawothermodels( "r_drawothermodels", "1", FCVAR_CHEAT, "0=Off, 1=Normal, 2=Wireframe" );
//-----------------------------------------------------------------------------
@@ -3208,11 +3091,6 @@ int C_BaseAnimating::DrawModel( int flags )
extraFlags |= STUDIO_GENERATE_STATS;
}
if ( flags & ( STUDIO_NO_OVERRIDE_FOR_ATTACH ) )
{
extraFlags |= STUDIO_NO_OVERRIDE_FOR_ATTACH;
}
// Necessary for lighting blending
CreateModelInstance();
@@ -3327,6 +3205,7 @@ void C_BaseAnimating::DoInternalDrawModel( ClientModelRenderInfo_t *pInfo, DrawM
if ( VPhysicsGetObject() )
{
static color32 debugColorPhys = {255,0,0,0};
matrix3x4_t matrix;
VPhysicsGetObject()->GetPositionMatrix( &matrix );
engine->DebugDrawPhysCollide( pCollide->solids[0], NULL, matrix, debugColorPhys );
}
@@ -3335,38 +3214,6 @@ void C_BaseAnimating::DoInternalDrawModel( ClientModelRenderInfo_t *pInfo, DrawM
}
}
#ifdef TF_CLIENT_DLL
// Move this elsewhere if we ever need it again.
class MaterialOverrideRestore
{
public:
MaterialOverrideRestore()
: m_bRestore( false )
, m_pOverrideMaterial( NULL )
, m_nOverrideType( OVERRIDE_NORMAL )
{ }
~MaterialOverrideRestore()
{
if ( m_bRestore )
{
modelrender->ForcedMaterialOverride( m_pOverrideMaterial, m_nOverrideType );
}
}
void RestoreOverride( IMaterial* pRestoreOverride, OverrideType_t overType )
{
m_bRestore = true;
m_pOverrideMaterial = pRestoreOverride;
m_nOverrideType = overType;
}
private:
bool m_bRestore;
IMaterial* m_pOverrideMaterial;
OverrideType_t m_nOverrideType;
};
#endif
//-----------------------------------------------------------------------------
// Purpose: Draws the object
@@ -3376,57 +3223,6 @@ int C_BaseAnimating::InternalDrawModel( int flags )
{
VPROF( "C_BaseAnimating::InternalDrawModel" );
#ifdef TF_CLIENT_DLL
MaterialOverrideRestore overrideRestore;
// TODO: We should listen for TF_COND_TAUNTING changing and then just do this then,
// rather than every frame.
bool bIgnoreOverride = false;
C_TFPlayer *pOwner = ToTFPlayer( GetOwnerEntity() );
if ( pOwner )
{
CTFPlayerInventory *pInv = pOwner->Inventory();
if ( pInv )
{
if ( pOwner->m_Shared.InCond( TF_COND_TAUNTING ) )
{
int iClass = pOwner->GetPlayerClass()->GetClassIndex();
CEconItemView *pMiscItemView = pInv->GetItemInLoadout( iClass, pOwner->GetActiveTauntSlot() );
if ( pMiscItemView && pMiscItemView->IsValid() )
{
if ( pMiscItemView->GetStaticData()->GetTauntData() )
{
bIgnoreOverride = pMiscItemView->GetStaticData()->GetTauntData()->GetProp( iClass ) != NULL;
}
}
}
}
}
if ( !bIgnoreOverride )
{
// If there is some other material override, it's probably the client asking for us to render invuln or the
// spy cloaking. Those are way more important than ours, so do them instead.
IMaterial* pOverrideMaterial = NULL;
OverrideType_t nDontcare = OVERRIDE_NORMAL;
modelrender->GetMaterialOverride( &pOverrideMaterial, &nDontcare );
bIgnoreOverride = ( pOverrideMaterial != NULL );
}
IMaterial* pOverrideMaterial = GetEconWeaponMaterialOverride( GetTeamNumber() );
bool bUseOverride = !bIgnoreOverride && pOverrideMaterial != NULL;
if ( bUseOverride && ( flags & STUDIO_RENDER ) )
{
// Set us up to restore properly on exit
overrideRestore.RestoreOverride( NULL, OVERRIDE_NORMAL );
modelrender->ForcedMaterialOverride( pOverrideMaterial );
flags |= STUDIO_NO_OVERRIDE_FOR_ATTACH; // Don't apply override materials to attachments.
}
#endif
if ( !GetModel() )
return 0;
@@ -3685,7 +3481,7 @@ void C_BaseAnimating::DoAnimationEvents( CStudioHdr *pStudioHdr )
}
// Necessary to get the next loop working
m_flPrevEventCycle = flEventCycle - 0.001f;
m_flPrevEventCycle = -0.01;
}
for (int i = 0; i < (int)seqdesc.numevents; i++)
@@ -3735,7 +3531,7 @@ bool C_BaseAnimating::DispatchMuzzleEffect( const char *options, bool isFirstPer
p = nexttoken( token, p, ' ' );
// Find the weapon type
if ( token[0] )
if ( token )
{
//TODO: Parse the type from a list instead
if ( Q_stricmp( token, "COMBINE" ) == 0 )
@@ -3781,7 +3577,7 @@ bool C_BaseAnimating::DispatchMuzzleEffect( const char *options, bool isFirstPer
int attachmentIndex = -1;
// Find the attachment name
if ( token[0] )
if ( token )
{
attachmentIndex = LookupAttachment( token );
@@ -3873,48 +3669,54 @@ void MaterialFootstepSound( C_BaseAnimating *pEnt, bool bLeftFoot, float flVolum
//-----------------------------------------------------------------------------
void C_BaseAnimating::FireEvent( const Vector& origin, const QAngle& angles, int event, const char *options )
{
Vector attachOrigin;
QAngle attachAngles;
switch( event )
{
case AE_CL_CREATE_PARTICLE_EFFECT:
{
int iAttachment = -1;
int iAttachType = PATTACH_ABSORIGIN_FOLLOW;
char token[256];
char szParticleEffect[256];
CSplitString splitString( options, " " );
if ( splitString.Count() < 2 )
{
Warning( "Invalid options specified for AE_CL_CREATE_PARTICLE_EFFECT event. Must specify \"<particle effect name> <attachment type> <attachment point>\"\n" );
return;
}
// Get the particle effect name
const char* mtoken = ModifyEventParticles( splitString[0] );
const char *p = options;
p = nexttoken(token, p, ' ');
if ( token )
{
const char* mtoken = ModifyEventParticles( token );
if ( !mtoken || mtoken[0] == '\0' )
return;
V_strncpy( szParticleEffect, mtoken, sizeof(szParticleEffect) );
Q_strncpy( szParticleEffect, mtoken, sizeof(szParticleEffect) );
}
const char *pszAttachType = splitString[1];
iAttachType = GetAttachTypeFromString( pszAttachType );
// Get the attachment type
p = nexttoken(token, p, ' ');
if ( token )
{
iAttachType = GetAttachTypeFromString( token );
if ( iAttachType == -1 )
{
Warning( "Invalid attach type specified for AE_CL_CREATE_PARTICLE_EFFECT event. Trying to spawn effect '%s' with attach type of '%s'\n", szParticleEffect, pszAttachType );
Warning("Invalid attach type specified for particle effect anim event. Trying to spawn effect '%s' with attach type of '%s'\n", szParticleEffect, token );
return;
}
}
// Get the attachment point index
if ( splitString.Count() > 2 )
p = nexttoken(token, p, ' ');
if ( token )
{
const char *pszAttachment = splitString[2];
iAttachment = atoi( pszAttachment );
iAttachment = atoi(token);
// See if we can find any attachment points matching the name
if ( pszAttachment[0] != '0' && iAttachment == 0 )
if ( token[0] != '0' && iAttachment == 0 )
{
iAttachment = LookupAttachment( pszAttachment );
iAttachment = LookupAttachment( token );
if ( iAttachment <= 0 )
{
Warning( "Failed to find attachment point specified for AE_CL_CREATE_PARTICLE_EFFECT event. Trying to spawn effect '%s' on attachment named '%s'\n", szParticleEffect, pszAttachment );
Warning( "Failed to find attachment point specified for particle effect anim event. Trying to spawn effect '%s' on attachment named '%s'\n", szParticleEffect, token );
return;
}
}
@@ -3925,56 +3727,9 @@ void C_BaseAnimating::FireEvent( const Vector& origin, const QAngle& angles, int
}
break;
case AE_CL_REMOVE_PARTICLE_EFFECT:
{
int iAttachment = -1;
char szParticleEffect[256];
CSplitString splitString( options, " " );
if ( splitString.Count() < 1 )
{
Warning( "Invalid options specified for AE_CL_REMOVE_PARTICLE_EFFECT event. Must specify \"<particle effect name> <attachment point>\"\n" );
return;
}
const char* mtoken = ModifyEventParticles( splitString[0] );
if ( !mtoken || mtoken[0] == '\0' )
return;
V_strncpy( szParticleEffect, mtoken, sizeof(szParticleEffect) );
if ( splitString.Count() > 1 )
{
const char *pszAttachment = splitString[1];
iAttachment = atoi( pszAttachment );
// See if we can find any attachment points matching the name
if ( pszAttachment[0] != '0' && iAttachment == 0 )
{
iAttachment = LookupAttachment( pszAttachment );
if ( iAttachment <= 0 )
{
Warning( "Failed to find attachment point specified for AE_CL_REMOVE_PARTICLE_EFFECT event. Trying to spawn effect '%s' on attachment named '%s'\n", szParticleEffect, pszAttachment );
return;
}
}
}
if ( iAttachment != -1 )
{
ParticleProp()->StopParticlesWithNameAndAttachment( szParticleEffect, iAttachment );
}
else
{
// if no attachment specicied, just remove all particles with specified name from this entity
ParticleProp()->StopParticlesNamed( szParticleEffect );
}
}
break;
case AE_CL_PLAYSOUND:
{
CLocalPlayerFilter filter;
Vector attachOrigin;
QAngle attachAngles;
if ( m_Attachments.Count() > 0)
{
@@ -4127,44 +3882,51 @@ void C_BaseAnimating::FireEvent( const Vector& origin, const QAngle& angles, int
case AE_CL_ENABLE_BODYGROUP:
{
int index_ = FindBodygroupByName( options );
if ( index_ >= 0 )
int index = FindBodygroupByName( options );
if ( index >= 0 )
{
SetBodygroup( index_, 1 );
SetBodygroup( index, 1 );
}
}
break;
case AE_CL_DISABLE_BODYGROUP:
{
int index_ = FindBodygroupByName( options );
if ( index_ >= 0 )
int index = FindBodygroupByName( options );
if ( index >= 0 )
{
SetBodygroup( index_, 0 );
SetBodygroup( index, 0 );
}
}
break;
case AE_CL_BODYGROUP_SET_VALUE:
{
int value;
char token[256];
char szBodygroupName[256];
int value = 0;
char token[256];
const char *p = options;
// Bodygroup Name
p = nexttoken(token, p, ' ');
if ( token )
{
Q_strncpy( szBodygroupName, token, sizeof(szBodygroupName) );
}
// Get the desired value
p = nexttoken(token, p, ' ');
value = token[0] ? atoi( token ) : 0;
int index_ = FindBodygroupByName( szBodygroupName );
if ( index_ >= 0 )
if ( token )
{
SetBodygroup( index_, value );
value = atoi( token );
}
int index = FindBodygroupByName( szBodygroupName );
if ( index >= 0 )
{
SetBodygroup( index, value );
}
}
break;
@@ -4188,21 +3950,33 @@ void C_BaseAnimating::FireObsoleteEvent( const Vector& origin, const QAngle& ang
// Obsolete. Use the AE_CL_CREATE_PARTICLE_EFFECT event instead, which uses the artist driven particle system & editor.
case AE_CLIENT_EFFECT_ATTACH:
{
int iAttachment;
int iParam;
int iAttachment = -1;
int iParam = 0;
char token[128];
char effectFunc[128];
const char *p = options;
p = nexttoken(token, p, ' ');
if( token )
{
Q_strncpy( effectFunc, token, sizeof(effectFunc) );
}
p = nexttoken(token, p, ' ');
iAttachment = token[0] ? atoi(token) : -1;
if( token )
{
iAttachment = atoi(token);
}
p = nexttoken(token, p, ' ');
iParam = token[0] ? atoi(token) : 0;
if( token )
{
iParam = atoi(token);
}
if ( iAttachment != -1 && m_Attachments.Count() >= iAttachment )
{
@@ -4745,7 +4519,7 @@ void C_BaseAnimating::OnPreDataChanged( DataUpdateType_t updateType )
m_bLastClientSideFrameReset = m_bClientSideFrameReset;
}
bool C_BaseAnimating::ForceSetupBonesAtTime( matrix3x4_t *pBonesOut, float flTime )
void C_BaseAnimating::ForceSetupBonesAtTime( matrix3x4_t *pBonesOut, float flTime )
{
// blow the cached prev bones
InvalidateBoneCache();
@@ -4754,18 +4528,13 @@ bool C_BaseAnimating::ForceSetupBonesAtTime( matrix3x4_t *pBonesOut, float flTim
Interpolate( flTime );
// Setup bone state at the given time
return SetupBones( pBonesOut, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, flTime );
SetupBones( pBonesOut, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, flTime );
}
bool C_BaseAnimating::GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt )
void C_BaseAnimating::GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt )
{
bool bSuccess = true;
if ( !ForceSetupBonesAtTime( pDeltaBones0, gpGlobals->curtime - boneDt ) )
bSuccess = false;
if ( !ForceSetupBonesAtTime( pDeltaBones1, gpGlobals->curtime ) )
bSuccess = false;
ForceSetupBonesAtTime( pDeltaBones0, gpGlobals->curtime - boneDt );
ForceSetupBonesAtTime( pDeltaBones1, gpGlobals->curtime );
float ragdollCreateTime = PhysGetSyncCreateTime();
if ( ragdollCreateTime != gpGlobals->curtime )
{
@@ -4773,15 +4542,12 @@ bool C_BaseAnimating::GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matri
// so initialize the ragdoll at that time so that it will reach the current
// position at curtime. Otherwise the ragdoll will simulate forward from curtime
// and pop into the future a bit at this point of transition
if ( !ForceSetupBonesAtTime( pCurrentBones, ragdollCreateTime ) )
bSuccess = false;
ForceSetupBonesAtTime( pCurrentBones, ragdollCreateTime );
}
else
{
memcpy( pCurrentBones, m_CachedBoneData.Base(), sizeof( matrix3x4_t ) * m_CachedBoneData.Count() );
}
return bSuccess;
}
C_BaseAnimating *C_BaseAnimating::CreateRagdollCopy()
@@ -4795,8 +4561,8 @@ C_BaseAnimating *C_BaseAnimating::CreateRagdollCopy()
TermRopes();
const model_t *pModel = GetModel();
const char *pModelName = modelinfo->GetModelName( pModel );
const model_t *model = GetModel();
const char *pModelName = modelinfo->GetModelName( model );
if ( pRagdoll->InitializeAsClientEntity( pModelName, RENDER_GROUP_OPAQUE_ENTITY ) == false )
{
@@ -4849,32 +4615,14 @@ C_BaseAnimating *C_BaseAnimating::BecomeRagdollOnClient()
{
MoveToLastReceivedPosition( true );
GetAbsOrigin();
C_BaseAnimating *pRagdoll = CreateRagdollCopy();
if ( pRagdoll )
{
matrix3x4_t boneDelta0[MAXSTUDIOBONES];
matrix3x4_t boneDelta1[MAXSTUDIOBONES];
matrix3x4_t currentBones[MAXSTUDIOBONES];
const float boneDt = 0.1f;
bool bInitAsClient = false;
bool bInitBoneArrays = GetRagdollInitBoneArrays( boneDelta0, boneDelta1, currentBones, boneDt );
if ( bInitBoneArrays )
{
bInitAsClient = pRagdoll->InitAsClientRagdoll( boneDelta0, boneDelta1, currentBones, boneDt );
}
if ( !bInitAsClient || !bInitBoneArrays )
{
Warning( "C_BaseAnimating::BecomeRagdollOnClient failed. pRagdoll:%p bInitBoneArrays:%d bInitAsClient:%d\n",
pRagdoll, bInitBoneArrays, bInitAsClient );
pRagdoll->Release();
return NULL;
}
}
GetRagdollInitBoneArrays( boneDelta0, boneDelta1, currentBones, boneDt );
pRagdoll->InitAsClientRagdoll( boneDelta0, boneDelta1, currentBones, boneDt );
return pRagdoll;
}
@@ -5139,7 +4887,7 @@ void C_BaseAnimating::UpdateClientSideAnimation()
void C_BaseAnimating::Simulate()
{
if ( m_bDelayInitModelEffects )
if ( m_bInitModelEffects )
{
DelayedInitModelEffects();
}
@@ -5242,13 +4990,10 @@ bool C_BaseAnimating::TestHitboxes( const Ray_t &ray, unsigned int fContentsMask
//-----------------------------------------------------------------------------
float C_BaseAnimating::GetSequenceCycleRate( CStudioHdr *pStudioHdr, int iSequence )
{
float t = SequenceDuration( pStudioHdr, iSequence );
if ( !pStudioHdr )
return 0.0f;
if ( t != 0.0f )
{
return 1.0f / t;
}
return t;
return Studio_CPS( pStudioHdr, pStudioHdr->pSeqdesc(iSequence), iSequence, m_flPoseParameter );
}
float C_BaseAnimating::GetAnimTimeInterval( void ) const
@@ -5538,7 +5283,6 @@ void C_BaseAnimating::ResetSequenceInfo( void )
{
if (GetSequence() == -1)
{
// This shouldn't happen. Setting m_nSequence blindly is a horrible coding practice.
SetSequence( 0 );
}
@@ -5560,11 +5304,8 @@ void C_BaseAnimating::ResetSequenceInfo( void )
m_nResetEventsParity = ( m_nResetEventsParity + 1 ) & EF_PARITY_MASK;
// FIXME: why is this called here? Nothing should have changed to make this nessesary
if ( pStudioHdr )
{
SetEventIndexForSequence( pStudioHdr->pSeqdesc( GetSequence() ) );
}
}
//=========================================================
//=========================================================
@@ -5581,11 +5322,6 @@ float C_BaseAnimating::SequenceDuration( CStudioHdr *pStudioHdr, int iSequence )
return 0.1f;
}
if ( !pStudioHdr->SequencesAvailable() )
{
return 0.1;
}
if (iSequence >= pStudioHdr->GetNumSeq() || iSequence < 0 )
{
DevWarning( 2, "C_BaseAnimating::SequenceDuration( %d ) out of range\n", iSequence );
@@ -5777,12 +5513,9 @@ void C_BaseAnimating::DrawClientHitboxes( float duration /*= 0.0f*/, bool monoco
b = ( int ) ( 255.0f * hullcolor[j][2] );
}
if ( debugoverlay )
{
debugoverlay->AddBoxOverlay( position, pbox->bbmin, pbox->bbmax, angles, r, g, b, 0 ,duration );
}
}
}
//-----------------------------------------------------------------------------
@@ -5798,13 +5531,6 @@ int C_BaseAnimating::SelectWeightedSequence ( int activity )
}
int C_BaseAnimating::SelectWeightedSequenceFromModifiers( Activity activity, CUtlSymbol *pActivityModifiers, int iModifierCount )
{
Assert( activity != ACT_INVALID );
Assert( GetModelPtr() );
return GetModelPtr()->SelectWeightedSequenceFromModifiers( activity, pActivityModifiers, iModifierCount );
}
//=========================================================
//=========================================================
int C_BaseAnimating::LookupPoseParameter( CStudioHdr *pstudiohdr, const char *szName )
@@ -6311,7 +6037,7 @@ void C_BaseAnimating::AddToClientSideAnimationList()
UpdateRelevantInterpolatedVars();
}
void C_BaseAnimating::RemoveFromClientSideAnimationList( bool bBeingDestroyed /*= false*/ )
void C_BaseAnimating::RemoveFromClientSideAnimationList()
{
// Not in list yet
if ( INVALID_CLIENTSIDEANIMATION_LIST_HANDLE == m_ClientSideAnimationListHandle )
@@ -6342,11 +6068,8 @@ void C_BaseAnimating::RemoveFromClientSideAnimationList( bool bBeingDestroyed /*
// Invalidate our handle no matter what.
m_ClientSideAnimationListHandle = INVALID_CLIENTSIDEANIMATION_LIST_HANDLE;
if ( !bBeingDestroyed )
{
UpdateRelevantInterpolatedVars();
}
}
// static method
+13 -13
View File
@@ -147,15 +147,12 @@ public:
virtual void UpdateIKLocks( float currentTime );
virtual void CalculateIKLocks( float currentTime );
virtual bool ShouldDraw();
virtual void UpdateVisibility() OVERRIDE;
virtual int DrawModel( int flags );
virtual int InternalDrawModel( int flags );
virtual bool OnInternalDrawModel( ClientModelRenderInfo_t *pInfo );
virtual bool OnPostInternalDrawModel( ClientModelRenderInfo_t *pInfo );
void DoInternalDrawModel( ClientModelRenderInfo_t *pInfo, DrawModelState_t *pState, matrix3x4_t *pBoneToWorldArray = NULL );
virtual IMaterial* GetEconWeaponMaterialOverride( int iTeam ) { return NULL; }
//
virtual CMouthInfo *GetMouth();
virtual void ControlMouth( CStudioHdr *pStudioHdr );
@@ -250,7 +247,7 @@ public:
void ForceClientSideAnimationOn();
void AddToClientSideAnimationList();
void RemoveFromClientSideAnimationList( bool bBeingDestroyed = false );
void RemoveFromClientSideAnimationList();
virtual bool IsSelfAnimating();
virtual void ResetLatched();
@@ -301,8 +298,8 @@ public:
virtual void Clear( void );
void ClearRagdoll();
void CreateUnragdollInfo( C_BaseAnimating *pRagdoll );
bool ForceSetupBonesAtTime( matrix3x4_t *pBonesOut, float flTime );
virtual bool GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt );
void ForceSetupBonesAtTime( matrix3x4_t *pBonesOut, float flTime );
virtual void GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt );
// For shadows rendering the correct body + sequence...
virtual int GetBody() { return m_nBody; }
@@ -432,7 +429,6 @@ public:
// For prediction
int SelectWeightedSequence ( int activity );
int SelectWeightedSequenceFromModifiers( Activity activity, CUtlSymbol *pActivityModifiers, int iModifierCount );
void ResetSequenceInfo( void );
float SequenceDuration( void );
float SequenceDuration( CStudioHdr *pStudioHdr, int iSequence );
@@ -448,7 +444,6 @@ public:
virtual bool ShouldResetSequenceOnNewModel( void );
virtual bool IsViewModel() const;
virtual void UpdateOnRemove( void );
protected:
// View models scale their attachment positions to account for FOV. To get the unmodified
@@ -610,7 +605,7 @@ private:
// Calculated attachment points
CUtlVector<CAttachmentData> m_Attachments;
bool SetupBones_AttachmentHelper( CStudioHdr *pStudioHdr );
void SetupBones_AttachmentHelper( CStudioHdr *pStudioHdr );
EHANDLE m_hLightingOrigin;
EHANDLE m_hLightingOriginRelative;
@@ -620,7 +615,6 @@ private:
unsigned char m_nOldMuzzleFlashParity;
bool m_bInitModelEffects;
bool m_bDelayInitModelEffects;
// Dynamic models
bool m_bDynamicModelAllowed;
@@ -639,7 +633,6 @@ private:
mutable CStudioHdr *m_pStudioHdr;
mutable MDLHandle_t m_hStudioHdr;
CThreadFastMutex m_StudioHdrInitLock;
bool m_bHasAttachedParticles;
};
enum
@@ -764,13 +757,20 @@ inline CStudioHdr *C_BaseAnimating::GetModelPtr() const
inline void C_BaseAnimating::InvalidateMdlCache()
{
if ( m_pStudioHdr )
{
UnlockStudioHdr();
delete m_pStudioHdr;
m_pStudioHdr = NULL;
}
}
inline bool C_BaseAnimating::IsModelScaleFractional() const
inline bool C_BaseAnimating::IsModelScaleFractional() const /// very fast way to ask if the model scale is < 1.0f
{
return ( m_flModelScale < 1.0f );
COMPILE_TIME_ASSERT( sizeof( m_flModelScale ) == sizeof( int ) );
return *((const int *) &m_flModelScale) < 0x3f800000;
}
inline bool C_BaseAnimating::IsModelScaled() const
+2
View File
@@ -206,6 +206,8 @@ void C_BaseAnimatingOverlay::GetRenderBounds( Vector& theMins, Vector& theMaxs )
void C_BaseAnimatingOverlay::CheckForLayerChanges( CStudioHdr *hdr, float currentTime )
{
CDisableRangeChecks disableRangeChecks;
bool bLayersChanged = false;
// FIXME: damn, there has to be a better way than this.
+1 -18
View File
@@ -34,7 +34,6 @@ C_BaseCombatCharacter::C_BaseCombatCharacter()
m_pGlowEffect = NULL;
m_bGlowEnabled = false;
m_bOldGlowEnabled = false;
m_bClientSideGlowEnabled = false;
#endif // GLOWS_ENABLE
}
@@ -114,22 +113,6 @@ void C_BaseCombatCharacter::GetGlowEffectColor( float *r, float *g, float *b )
*b = 0.76f;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
/*
void C_BaseCombatCharacter::EnableGlowEffect( float r, float g, float b )
{
// destroy the existing effect
if ( m_pGlowEffect )
{
DestroyGlowEffect();
}
m_pGlowEffect = new CGlowObject( this, Vector( r, g, b ), 1.0, true );
}
*/
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
@@ -142,7 +125,7 @@ void C_BaseCombatCharacter::UpdateGlowEffect( void )
}
// create a new effect
if ( m_bGlowEnabled || m_bClientSideGlowEnabled )
if ( m_bGlowEnabled )
{
float r, g, b;
GetGlowEffectColor( &r, &g, &b );
+1 -6
View File
@@ -97,10 +97,6 @@ public:
#ifdef GLOWS_ENABLE
CGlowObject *GetGlowObject( void ){ return m_pGlowEffect; }
virtual void GetGlowEffectColor( float *r, float *g, float *b );
// void EnableGlowEffect( float r, float g, float b );
void SetClientSideGlowEnabled( bool bEnabled ){ m_bClientSideGlowEnabled = bEnabled; UpdateGlowEffect(); }
bool IsClientSideGlowEnabled( void ){ return m_bClientSideGlowEnabled; }
#endif // GLOWS_ENABLE
public:
@@ -125,8 +121,7 @@ private:
CHandle< C_BaseCombatWeapon > m_hActiveWeapon;
#ifdef GLOWS_ENABLE
bool m_bClientSideGlowEnabled; // client-side only value used for spectator
bool m_bGlowEnabled; // networked value
bool m_bGlowEnabled;
bool m_bOldGlowEnabled;
CGlowObject *m_pGlowEffect;
#endif // GLOWS_ENABLE
+8 -11
View File
@@ -163,10 +163,7 @@ void C_BaseCombatWeapon::OnDataChanged( DataUpdateType_t updateType )
}
}
if ( updateType == DATA_UPDATE_CREATED )
{
UpdateVisibility();
}
m_iOldState = m_iState;
@@ -261,8 +258,8 @@ void C_BaseCombatWeapon::DrawCrosshair()
}
*/
CHudCrosshair *pCrosshair = GET_HUDELEMENT( CHudCrosshair );
if ( !pCrosshair )
CHudCrosshair *crosshair = GET_HUDELEMENT( CHudCrosshair );
if ( !crosshair )
return;
// Find out if this weapon's auto-aimed onto a target
@@ -275,16 +272,16 @@ void C_BaseCombatWeapon::DrawCrosshair()
{
clr[3] = 255;
pCrosshair->SetCrosshair( GetWpnData().iconAutoaim, clr );
crosshair->SetCrosshair( GetWpnData().iconAutoaim, clr );
}
else if ( GetWpnData().iconCrosshair )
{
clr[3] = 255;
pCrosshair->SetCrosshair( GetWpnData().iconCrosshair, clr );
crosshair->SetCrosshair( GetWpnData().iconCrosshair, clr );
}
else
{
pCrosshair->ResetCrosshair();
crosshair->ResetCrosshair();
}
}
else
@@ -293,11 +290,11 @@ void C_BaseCombatWeapon::DrawCrosshair()
// zoomed crosshairs
if (bOnTarget && GetWpnData().iconZoomedAutoaim)
pCrosshair->SetCrosshair(GetWpnData().iconZoomedAutoaim, white);
crosshair->SetCrosshair(GetWpnData().iconZoomedAutoaim, white);
else if ( GetWpnData().iconZoomedCrosshair )
pCrosshair->SetCrosshair( GetWpnData().iconZoomedCrosshair, white );
crosshair->SetCrosshair( GetWpnData().iconZoomedCrosshair, white );
else
pCrosshair->ResetCrosshair();
crosshair->ResetCrosshair();
}
}
+39 -71
View File
@@ -41,10 +41,6 @@
#include "inetchannelinfo.h"
#include "proto_version.h"
#ifdef TF_CLIENT_DLL
#include "c_tf_player.h"
#endif
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@@ -80,7 +76,7 @@ void cc_cl_interp_all_changed( IConVar *pConVar, const char *pOldString, float f
static ConVar cl_extrapolate( "cl_extrapolate", "1", FCVAR_CHEAT, "Enable/disable extrapolation if interpolation history runs out." );
static ConVar cl_interp_npcs( "cl_interp_npcs", "0.0", FCVAR_USERINFO, "Interpolate NPC positions starting this many seconds in past (or cl_interp, if greater)" );
static ConVar cl_interp_all( "cl_interp_all", "0", 0, "Disable interpolation list optimizations.", 0, 0, 0, 0, cc_cl_interp_all_changed );
ConVar r_drawmodeldecals( "r_drawmodeldecals", "1", FCVAR_ALLOWED_IN_COMPETITIVE );
ConVar r_drawmodeldecals( "r_drawmodeldecals", "1" );
extern ConVar cl_showerror;
int C_BaseEntity::m_nPredictionRandomSeed = -1;
C_BasePlayer *C_BaseEntity::m_pPredictionPlayer = NULL;
@@ -575,8 +571,7 @@ void SpewInterpolatedVar( CInterpolatedVar< Vector > *pVar )
{
Msg( "--------------------------------------------------\n" );
int i = pVar->GetHead();
Vector v0(0, 0, 0);
CApparentVelocity<Vector> apparent(v0);
CApparentVelocity<Vector> apparent;
float prevtime = 0.0f;
while ( 1 )
{
@@ -599,8 +594,7 @@ void SpewInterpolatedVar( CInterpolatedVar< Vector > *pVar, float flNow, float f
Msg( "--------------------------------------------------\n" );
int i = pVar->GetHead();
Vector v0(0, 0, 0);
CApparentVelocity<Vector> apparent(v0);
CApparentVelocity<Vector> apparent;
float newtime = 999999.0f;
Vector newVec( 0, 0, 0 );
bool bSpew = true;
@@ -668,7 +662,7 @@ void SpewInterpolatedVar( CInterpolatedVar< float > *pVar )
{
Msg( "--------------------------------------------------\n" );
int i = pVar->GetHead();
CApparentVelocity<float> apparent(0.0f);
CApparentVelocity<float> apparent;
while ( 1 )
{
float changetime;
@@ -690,8 +684,7 @@ void GetInterpolatedVarTimeRange( CInterpolatedVar<T> *pVar, float &flMin, float
flMax = -1e23;
int i = pVar->GetHead();
Vector v0(0, 0, 0);
CApparentVelocity<Vector> apparent(v0);
CApparentVelocity<Vector> apparent;
while ( 1 )
{
float changetime;
@@ -899,8 +892,6 @@ C_BaseEntity::C_BaseEntity() :
m_iv_angRotation( "C_BaseEntity::m_iv_angRotation" ),
m_iv_vecVelocity( "C_BaseEntity::m_iv_vecVelocity" )
{
m_pAttributes = NULL;
AddVar( &m_vecOrigin, &m_iv_vecOrigin, LATCH_SIMULATION_VAR );
AddVar( &m_angRotation, &m_iv_angRotation, LATCH_SIMULATION_VAR );
// Removing this until we figure out why velocity introduces view hitching.
@@ -1154,13 +1145,6 @@ bool C_BaseEntity::InitializeAsClientEntityByIndex( int iIndex, RenderGroup_t re
return true;
}
void C_BaseEntity::TrackAngRotation( bool bTrack )
{
if ( bTrack )
AddVar( &m_angRotation, &m_iv_angRotation, LATCH_SIMULATION_VAR );
else
RemoveVar( &m_angRotation, false );
}
void C_BaseEntity::Term()
{
@@ -1315,6 +1299,19 @@ bool C_BaseEntity::VPhysicsIsFlesh( void )
return false;
}
//-----------------------------------------------------------------------------
// Returns the health fraction
//-----------------------------------------------------------------------------
float C_BaseEntity::HealthFraction() const
{
if (GetMaxHealth() == 0)
return 1.0f;
float flFraction = (float)GetHealth() / (float)GetMaxHealth();
flFraction = clamp( flFraction, 0.0f, 1.0f );
return flFraction;
}
//-----------------------------------------------------------------------------
// Purpose: Retrieves the coordinate frame for this entity.
@@ -1749,9 +1746,9 @@ void C_BaseEntity::SetNetworkAngles( const QAngle& ang )
// Purpose:
// Input : index -
//-----------------------------------------------------------------------------
void C_BaseEntity::SetModelIndex( int index_ )
void C_BaseEntity::SetModelIndex( int index )
{
m_nModelIndex = index_;
m_nModelIndex = index;
const model_t *pModel = modelinfo->GetModel( m_nModelIndex );
SetModelPointer( pModel );
}
@@ -2043,7 +2040,7 @@ void C_BaseEntity::UpdatePartitionListEntry()
list |= PARTITION_CLIENT_RESPONSIVE_EDICTS;
// add the entity to the KD tree so we will collide against it
::partition->RemoveAndInsert( PARTITION_CLIENT_SOLID_EDICTS | PARTITION_CLIENT_RESPONSIVE_EDICTS | PARTITION_CLIENT_NON_STATIC_EDICTS, list, CollisionProp()->GetPartitionHandle() );
partition->RemoveAndInsert( PARTITION_CLIENT_SOLID_EDICTS | PARTITION_CLIENT_RESPONSIVE_EDICTS | PARTITION_CLIENT_NON_STATIC_EDICTS, list, CollisionProp()->GetPartitionHandle() );
}
@@ -2099,7 +2096,7 @@ void C_BaseEntity::NotifyShouldTransmit( ShouldTransmitState_t state )
SetDormant( true );
// remove the entity from the KD tree so we won't collide against it
::partition->Remove( PARTITION_CLIENT_SOLID_EDICTS | PARTITION_CLIENT_RESPONSIVE_EDICTS | PARTITION_CLIENT_NON_STATIC_EDICTS, CollisionProp()->GetPartitionHandle() );
partition->Remove( PARTITION_CLIENT_SOLID_EDICTS | PARTITION_CLIENT_RESPONSIVE_EDICTS | PARTITION_CLIENT_NON_STATIC_EDICTS, CollisionProp()->GetPartitionHandle() );
}
break;
@@ -2173,7 +2170,6 @@ void C_BaseEntity::PreDataUpdate( DataUpdateType_t updateType )
}
m_ubOldInterpolationFrame = m_ubInterpolationFrame;
m_bOldShouldDraw = ShouldDraw();
}
const Vector& C_BaseEntity::GetOldOrigin()
@@ -2471,6 +2467,8 @@ void C_BaseEntity::UnlinkFromHierarchy()
void C_BaseEntity::ValidateModelIndex( void )
{
#ifdef TF_CLIENT_DLL
if ( m_nModelIndexOverrides[VISION_MODE_NONE] > 0 )
{
if ( IsLocalPlayerUsingVisionFilterFlags( TF_VISION_FILTER_HALLOWEEN ) )
{
if ( m_nModelIndexOverrides[VISION_MODE_HALLOWEEN] > 0 )
@@ -2498,9 +2496,8 @@ void C_BaseEntity::ValidateModelIndex( void )
}
}
if ( m_nModelIndexOverrides[VISION_MODE_NONE] > 0 )
{
SetModelByIndex( m_nModelIndexOverrides[VISION_MODE_NONE] );
return;
}
#endif
@@ -2625,23 +2622,6 @@ void C_BaseEntity::PostDataUpdate( DataUpdateType_t updateType )
{
UpdateVisibility();
}
// if ShouldDraw state changes, recalculate visibility
if ( m_bOldShouldDraw != ShouldDraw() )
{
UpdateVisibility();
}
}
//-----------------------------------------------------------------------------
// Purpose: Latch simulation values when the entity has not changed
//-----------------------------------------------------------------------------
void C_BaseEntity::OnDataUnchangedInPVS()
{
Assert( m_hNetworkMoveParent.Get() || !m_hNetworkMoveParent.IsValid() );
HierarchySetParent(m_hNetworkMoveParent);
MarkMessageReceived();
}
//-----------------------------------------------------------------------------
@@ -3323,6 +3303,7 @@ void C_BaseEntity::ComputeFxBlend( void )
if ( m_nFXComputeFrame == gpGlobals->framecount )
return;
MDLCACHE_CRITICAL_SECTION();
int blend=0;
float offset;
@@ -3760,7 +3741,7 @@ void C_BaseEntity::AddColoredDecal( const Vector& rayStart, const Vector& rayEnd
case mod_brush:
{
color32 cColor32 = { (byte)cColor.r(), (byte)cColor.g(), (byte)cColor.b(), (byte)cColor.a() };
color32 cColor32 = { cColor.r(), cColor.g(), cColor.b(), cColor.a() };
effects->DecalColorShoot( decalIndex, index, model, GetAbsOrigin(), GetAbsAngles(), decalCenter, 0, 0, cColor32 );
}
break;
@@ -3859,7 +3840,7 @@ void C_BaseEntity::operator delete( void *pMem )
//========================================================================================
// TEAM HANDLING
//========================================================================================
C_Team *C_BaseEntity::GetTeam( void ) const
C_Team *C_BaseEntity::GetTeam( void )
{
return GetGlobalTeam( m_iTeamNum );
}
@@ -3884,7 +3865,7 @@ int C_BaseEntity::GetRenderTeamNumber( void )
//-----------------------------------------------------------------------------
// Purpose: Returns true if these entities are both in at least one team together
//-----------------------------------------------------------------------------
bool C_BaseEntity::InSameTeam( const C_BaseEntity *pEntity ) const
bool C_BaseEntity::InSameTeam( C_BaseEntity *pEntity )
{
if ( !pEntity )
return false;
@@ -5597,24 +5578,18 @@ CON_COMMAND_F( cl_ent_rbox, "Displays the client's render box for the entity und
void C_BaseEntity::DrawBBoxVisualizations( void )
{
if ( m_fBBoxVisFlags & VISUALIZE_COLLISION_BOUNDS )
{
if ( debugoverlay )
{
debugoverlay->AddBoxOverlay( CollisionProp()->GetCollisionOrigin(), CollisionProp()->OBBMins(),
CollisionProp()->OBBMaxs(), CollisionProp()->GetCollisionAngles(), 190, 190, 0, 0, 0.01 );
}
}
if ( m_fBBoxVisFlags & VISUALIZE_SURROUNDING_BOUNDS )
{
Vector vecSurroundMins, vecSurroundMaxs;
CollisionProp()->WorldSpaceSurroundingBounds( &vecSurroundMins, &vecSurroundMaxs );
if ( debugoverlay )
{
debugoverlay->AddBoxOverlay( vec3_origin, vecSurroundMins,
vecSurroundMaxs, vec3_angle, 0, 255, 255, 0, 0.01 );
}
}
if ( m_fBBoxVisFlags & VISUALIZE_RENDER_BOUNDS || r_drawrenderboxes.GetInt() )
{
@@ -5645,6 +5620,13 @@ RenderGroup_t C_BaseEntity::GetRenderGroup()
if ( m_nRenderMode == kRenderNone )
return RENDER_GROUP_OPAQUE_ENTITY;
// When an entity has a material proxy, we have to recompute
// translucency here because the proxy may have changed it.
if (modelinfo->ModelHasMaterialProxy( GetModel() ))
{
modelinfo->RecomputeTranslucency( const_cast<model_t*>(GetModel()), GetSkin(), GetBody(), GetClientRenderable() );
}
// NOTE: Bypassing the GetFXBlend protection logic because we want this to
// be able to be called from AddToLeafSystem.
int nTempComputeFrame = m_nFXComputeFrame;
@@ -6302,13 +6284,9 @@ bool C_BaseEntity::ValidateEntityAttachedToPlayer( bool &bShouldRetry )
return true;
// Some wearables parent to the view model
C_TFPlayer *pPlayer = ToTFPlayer( pParent );
if ( pPlayer )
C_BasePlayer *pPlayer = ToBasePlayer( pParent );
if ( pPlayer && pPlayer->GetViewModel() == this )
{
if ( pPlayer->GetViewModel() == this )
return true;
if ( pPlayer->HasItem() && ( pPlayer->GetItem()->GetItemID() == TF_ITEM_CAPTURE_FLAG ) && ( pPlayer->GetItem() == this ) )
return true;
}
@@ -6323,7 +6301,7 @@ bool C_BaseEntity::ValidateEntityAttachedToPlayer( bool &bShouldRetry )
return true;
// Temp for MVM testing
if ( FStrEq( pszModel, "models/buildables/sapper_placement.mdl" ) )
if ( FStrEq( pszModel, "models/buildables/sapper_placement_sentry1.mdl" ) )
return true;
if ( FStrEq( pszModel, "models/props_td/atom_bomb.mdl" ) )
@@ -6331,16 +6309,6 @@ bool C_BaseEntity::ValidateEntityAttachedToPlayer( bool &bShouldRetry )
if ( FStrEq( pszModel, "models/props_lakeside_event/bomb_temp_hat.mdl" ) )
return true;
if ( FStrEq( pszModel, "models/props_moonbase/powersupply_flag.mdl" ) )
return true;
// The Halloween 2014 doomsday flag replacement
if ( FStrEq( pszModel, "models/flag/ticket_case.mdl" ) )
return true;
if ( FStrEq( pszModel, "models/weapons/c_models/c_grapple_proj/c_grapple_proj.mdl" ) )
return true;
}
// Any entity that's not an item parented to a player is invalid.
+5 -25
View File
@@ -58,7 +58,6 @@ class C_BaseCombatCharacter;
class CEntityMapData;
class ConVar;
class CDmgAccumulator;
class IHasAttributes;
struct CSoundParameters;
@@ -336,7 +335,6 @@ public:
// save out interpolated values
virtual void PreDataUpdate( DataUpdateType_t updateType );
virtual void PostDataUpdate( DataUpdateType_t updateType );
virtual void OnDataUnchangedInPVS();
virtual void ValidateModelIndex( void );
@@ -518,7 +516,6 @@ public:
// Used when the collision prop is told to ask game code for the world-space surrounding box
virtual void ComputeWorldSpaceSurroundingBox( Vector *pVecWorldMins, Vector *pVecWorldMaxs );
virtual float GetHealthBarHeightOffset() const { return 0.f; }
// Returns the entity-to-world transform
matrix3x4_t &EntityToWorldTransform();
@@ -572,11 +569,11 @@ public:
virtual bool GetAttachmentVelocity( int number, Vector &originVel, Quaternion &angleVel );
// Team handling
virtual C_Team *GetTeam( void ) const;
virtual C_Team *GetTeam( void );
virtual int GetTeamNumber( void ) const;
virtual void ChangeTeam( int iTeamNum ); // Assign this entity to a team.
virtual int GetRenderTeamNumber( void );
virtual bool InSameTeam( const C_BaseEntity *pEntity ) const; // Returns true if the specified entity is on the same team as this one
virtual bool InSameTeam( C_BaseEntity *pEntity ); // Returns true if the specified entity is on the same team as this one
virtual bool InLocalTeam( void );
// ID Target handling
@@ -689,7 +686,7 @@ public:
virtual bool ShouldDraw();
inline bool IsVisible() const { return m_hRender != INVALID_CLIENT_RENDER_HANDLE; }
virtual void UpdateVisibility();
void UpdateVisibility();
// Returns true if the entity changes its position every frame on the server but it doesn't
// set animtime. In that case, the client returns true here so it copies the server time to
@@ -746,8 +743,7 @@ public:
virtual void SetHealth(int iHealth) {}
virtual int GetHealth() const { return 0; }
virtual int GetMaxHealth() const { return 1; }
virtual bool IsVisibleToTargetID( void ) const { return false; }
virtual bool IsHealthBarVisible( void ) const { return false; }
virtual bool IsVisibleToTargetID( void ) { return false; }
// Returns the health fraction
float HealthFraction() const;
@@ -1176,17 +1172,7 @@ public:
// Sets the origin + angles to match the last position received
void MoveToLastReceivedPosition( bool force = false );
// Return the IHasAttributes interface for this base entity. Removes the need for:
// dynamic_cast< IHasAttributes * >( pEntity );
// Which is remarkably slow.
// GetAttribInterface( CBaseEntity *pEntity ) in attribute_manager.h uses
// this function, tests for NULL, and Asserts m_pAttributes == dynamic_cast.
inline IHasAttributes *GetHasAttributesInterfacePtr() const { return m_pAttributes; }
protected:
// NOTE: m_pAttributes needs to be set in the leaf class constructor.
IHasAttributes *m_pAttributes;
// Only meant to be called from subclasses
void DestroyModelInstance();
@@ -1226,7 +1212,7 @@ protected:
public:
// Accessors for above
static int GetPredictionRandomSeed( bool bUseUnSyncedServerPlatTime = false );
static int GetPredictionRandomSeed( void );
static void SetPredictionRandomSeed( const CUserCmd *cmd );
static C_BasePlayer *GetPredictionPlayer( void );
static void SetPredictionPlayer( C_BasePlayer *player );
@@ -1394,7 +1380,6 @@ public:
virtual bool IsDeflectable() { return false; }
bool IsCombatCharacter() { return MyCombatCharacterPointer() == NULL ? false : true; }
protected:
int m_nFXComputeFrame;
@@ -1443,8 +1428,6 @@ public:
// a render handle, and is put into the spatial partition.
bool InitializeAsClientEntityByIndex( int iIndex, RenderGroup_t renderGroup );
void TrackAngRotation( bool bTrack );
private:
friend void OnRenderStart();
@@ -1704,9 +1687,6 @@ protected:
RenderMode_t m_PreviousRenderMode;
color32 m_PreviousRenderColor;
#endif
private:
bool m_bOldShouldDraw;
};
EXTERN_RECV_TABLE(DT_BaseEntity);
+24 -22
View File
@@ -92,7 +92,7 @@ bool GetHWMExpressionFileName( const char *pFilename, char *pHWMFilename )
// Find the hardware morph scene name and pass that along as well.
char szExpression[MAX_PATH];
V_strcpy_safe( szExpression, pFilename );
V_strcpy( szExpression, pFilename );
char szExpressionHWM[MAX_PATH];
szExpressionHWM[0] = '\0';
@@ -431,20 +431,21 @@ void *CFlexSceneFileManager::FindSceneFile( IHasLocalToGlobalFlexSettings *insta
{
char szFilename[MAX_PATH];
Assert( V_strlen( filename ) < MAX_PATH );
V_strcpy_safe( szFilename, filename );
V_strcpy( szFilename, filename );
#if defined( TF_CLIENT_DLL )
char szHWMFilename[MAX_PATH];
if ( GetHWMExpressionFileName( szFilename, szHWMFilename ) )
{
V_strcpy_safe( szFilename, szHWMFilename );
V_strcpy( szFilename, szHWMFilename );
}
#endif
Q_FixSlashes( szFilename );
// See if it's already loaded
for ( int i = 0; i < m_FileList.Count(); i++ )
int i;
for ( i = 0; i < m_FileList.Count(); i++ )
{
CFlexSceneFile *file = m_FileList[ i ];
if ( file && !Q_stricmp( file->filename, szFilename ) )
@@ -561,11 +562,11 @@ Vector C_BaseFlex::SetViewTarget( CStudioHdr *pStudioHdr )
m_iEyeUpdown = FindFlexController( "eyes_updown" );
m_iEyeRightleft = FindFlexController( "eyes_rightleft" );
if ( m_iEyeUpdown != LocalFlexController_t(-1) )
if ( m_iEyeUpdown != -1 )
{
pStudioHdr->pFlexcontroller( m_iEyeUpdown )->localToGlobal = AddGlobalFlexController( "eyes_updown" );
}
if ( m_iEyeRightleft != LocalFlexController_t(-1) )
if ( m_iEyeRightleft != -1 )
{
pStudioHdr->pFlexcontroller( m_iEyeRightleft )->localToGlobal = AddGlobalFlexController( "eyes_rightleft" );
}
@@ -593,13 +594,13 @@ Vector C_BaseFlex::SetViewTarget( CStudioHdr *pStudioHdr )
// calculate animated eye deflection
Vector eyeDeflect;
QAngle eyeAng( 0, 0, 0 );
if ( m_iEyeUpdown != LocalFlexController_t(-1) )
if ( m_iEyeUpdown != -1 )
{
mstudioflexcontroller_t *pflex = pStudioHdr->pFlexcontroller( m_iEyeUpdown );
eyeAng.x = g_flexweight[ pflex->localToGlobal ];
}
if ( m_iEyeRightleft != LocalFlexController_t(-1) )
if ( m_iEyeRightleft != -1 )
{
mstudioflexcontroller_t *pflex = pStudioHdr->pFlexcontroller( m_iEyeRightleft );
eyeAng.y = g_flexweight[ pflex->localToGlobal ];
@@ -1056,7 +1057,7 @@ void C_BaseFlex::GetToolRecordingState( KeyValues *msg )
Vector viewtarget = m_viewtarget; // Use the unfiltered value
// HACK HACK: Unmap eyes right/left amounts
if (m_iEyeUpdown != LocalFlexController_t(-1) && m_iEyeRightleft != LocalFlexController_t(-1))
if (m_iEyeUpdown != -1 && m_iEyeRightleft != -1)
{
mstudioflexcontroller_t *flexupdown = hdr->pFlexcontroller( m_iEyeUpdown );
mstudioflexcontroller_t *flexrightleft = hdr->pFlexcontroller( m_iEyeRightleft );
@@ -1594,6 +1595,7 @@ void C_BaseFlex::RemoveSceneEvent( CChoreoScene *scene, CChoreoEvent *event, boo
info->m_bStarted = false;
m_SceneEvents.Remove( i );
return;
}
}
@@ -1630,15 +1632,15 @@ bool C_BaseFlex::CheckSceneEventCompletion( CSceneEventInfo *info, float current
return true;
}
void C_BaseFlex::SetFlexWeight( LocalFlexController_t index_, float value )
void C_BaseFlex::SetFlexWeight( LocalFlexController_t index, float value )
{
if ( index_ >= 0 && index_ < GetNumFlexControllers())
if (index >= 0 && index < GetNumFlexControllers())
{
CStudioHdr *pstudiohdr = GetModelPtr( );
if (! pstudiohdr)
return;
mstudioflexcontroller_t *pflexcontroller = pstudiohdr->pFlexcontroller( index_ );
mstudioflexcontroller_t *pflexcontroller = pstudiohdr->pFlexcontroller( index );
if (pflexcontroller->max != pflexcontroller->min)
{
@@ -1646,26 +1648,26 @@ void C_BaseFlex::SetFlexWeight( LocalFlexController_t index_, float value )
value = clamp( value, 0.0f, 1.0f );
}
m_flexWeight[index_] = value;
m_flexWeight[ index ] = value;
}
}
float C_BaseFlex::GetFlexWeight( LocalFlexController_t index_ )
float C_BaseFlex::GetFlexWeight( LocalFlexController_t index )
{
if ( index_ >= 0 && index_ < GetNumFlexControllers())
if (index >= 0 && index < GetNumFlexControllers())
{
CStudioHdr *pstudiohdr = GetModelPtr( );
if (! pstudiohdr)
return 0;
mstudioflexcontroller_t *pflexcontroller = pstudiohdr->pFlexcontroller( index_ );
mstudioflexcontroller_t *pflexcontroller = pstudiohdr->pFlexcontroller( index );
if (pflexcontroller->max != pflexcontroller->min)
{
return m_flexWeight[index_] * (pflexcontroller->max - pflexcontroller->min) + pflexcontroller->min;
return m_flexWeight[index] * (pflexcontroller->max - pflexcontroller->min) + pflexcontroller->min;
}
return m_flexWeight[index_];
return m_flexWeight[index];
}
return 0.0;
}
@@ -1833,8 +1835,8 @@ int C_BaseFlex::FlexControllerLocalToGlobal( const flexsettinghdr_t *pSettinghdr
FS_LocalToGlobal_t& result = m_LocalToGlobal[ idx ];
// Validate lookup
Assert( result.m_nCount != 0 && key < result.m_nCount );
int iMap = result.m_Mapping[ key ];
return iMap;
int index = result.m_Mapping[ key ];
return index;
}
//-----------------------------------------------------------------------------
@@ -1877,11 +1879,11 @@ void C_BaseFlex::AddFlexSetting( const char *expr, float scale,
{
// Translate to local flex controller
// this is translating from the settings's local index to the models local index
int iFlex = FlexControllerLocalToGlobal( pSettinghdr, pWeights->key );
int index = FlexControllerLocalToGlobal( pSettinghdr, pWeights->key );
// blend scaled weighting in to total (post networking g_flexweight!!!!)
float s = clamp( scale * pWeights->influence, 0.0f, 1.0f );
g_flexweight[iFlex] = g_flexweight[iFlex] * (1.0f - s) + pWeights->weight * s;
g_flexweight[index] = g_flexweight[index] * (1.0f - s) + pWeights->weight * s;
}
}
+34 -64
View File
@@ -50,10 +50,6 @@
#include "sourcevr/isourcevirtualreality.h"
#include "client_virtualreality.h"
#ifdef TF_CLIENT_DLL
#include "tf_gamerules.h"
#endif
#if defined USES_ECON_ITEMS
#include "econ_wearable.h"
#endif
@@ -115,7 +111,7 @@ ConVar spec_freeze_distance_min( "spec_freeze_distance_min", "96", FCVAR_CHEAT,
ConVar spec_freeze_distance_max( "spec_freeze_distance_max", "200", FCVAR_CHEAT, "Maximum random distance from the target to stop when framing them in observer freeze cam." );
#endif
static ConVar cl_first_person_uses_world_model ( "cl_first_person_uses_world_model", "0", FCVAR_NONE, "Causes the third person model to be drawn instead of the view model" );
static ConVar cl_first_person_uses_world_model ( "cl_first_person_uses_world_model", "0", FCVAR_ARCHIVE, "Causes the third person model to be drawn instead of the view model" );
ConVar demo_fov_override( "demo_fov_override", "0", FCVAR_CLIENTDLL | FCVAR_DONTRECORD, "If nonzero, this value will be used to override FOV during demo playback." );
@@ -126,9 +122,6 @@ ConVar demo_fov_override( "demo_fov_override", "0", FCVAR_CLIENTDLL | FCVAR_DONT
ConVar cl_meathook_neck_pivot_ingame_up( "cl_meathook_neck_pivot_ingame_up", "7.0" );
ConVar cl_meathook_neck_pivot_ingame_fwd( "cl_meathook_neck_pivot_ingame_fwd", "3.0" );
static ConVar cl_clean_textures_on_death( "cl_clean_textures_on_death", "0", FCVAR_DEVELOPMENTONLY, "If enabled, attempts to purge unused textures every time a freeze cam is shown" );
void RecvProxy_LocalVelocityX( const CRecvProxyData *pData, void *pStruct, void *pOut );
void RecvProxy_LocalVelocityY( const CRecvProxyData *pData, void *pStruct, void *pOut );
void RecvProxy_LocalVelocityZ( const CRecvProxyData *pData, void *pStruct, void *pOut );
@@ -345,7 +338,6 @@ BEGIN_PREDICTION_DATA_NO_BASE( CPlayerLocalData )
DEFINE_PRED_FIELD_TOL( m_flFallVelocity, FIELD_FLOAT, FTYPEDESC_INSENDTABLE, 0.5f ),
// DEFINE_PRED_FIELD( m_nOldButtons, FIELD_INTEGER, FTYPEDESC_INSENDTABLE ),
DEFINE_FIELD( m_nOldButtons, FIELD_INTEGER ),
DEFINE_FIELD( m_flOldForwardMove, FIELD_FLOAT ),
DEFINE_PRED_FIELD( m_flStepSize, FIELD_FLOAT, FTYPEDESC_INSENDTABLE ),
DEFINE_FIELD( m_flFOVRate, FIELD_FLOAT ),
@@ -444,7 +436,6 @@ C_BasePlayer::C_BasePlayer() : m_iv_vecViewOffset( "C_BasePlayer::m_iv_vecViewOf
m_bFiredWeapon = false;
m_nForceVisionFilterFlags = 0;
m_nLocalPlayerVisionFlags = 0;
ListenForGameEvent( "base_player_teleported" );
}
@@ -473,8 +464,8 @@ void C_BasePlayer::Spawn( void )
ClearFlags();
AddFlag( FL_CLIENT );
int fEffects = GetEffects() & EF_NOSHADOW;
SetEffects( fEffects );
int effects = GetEffects() & EF_NOSHADOW;
SetEffects( effects );
m_iFOV = 0; // init field of view.
@@ -550,7 +541,6 @@ CBaseEntity *C_BasePlayer::GetObserverTarget() const // returns players target o
case OBS_MODE_FIXED: // view from a fixed camera position
case OBS_MODE_IN_EYE: // follow a player in first person view
case OBS_MODE_CHASE: // follow a player in third person view
case OBS_MODE_POI: // PASSTIME point of interest - game objective, big fight, anything interesting
case OBS_MODE_ROAMING: // free roaming
return m_hObserverTarget;
break;
@@ -645,7 +635,6 @@ int C_BasePlayer::GetObserverMode() const
case OBS_MODE_FIXED: // view from a fixed camera position
case OBS_MODE_IN_EYE: // follow a player in first person view
case OBS_MODE_CHASE: // follow a player in third person view
case OBS_MODE_POI: // PASSTIME point of interest - game objective, big fight, anything interesting
case OBS_MODE_ROAMING: // free roaming
return m_iObserverMode;
break;
@@ -722,8 +711,8 @@ void C_BasePlayer::FireGameEvent( IGameEvent *event )
{
if ( FStrEq( event->GetName(), "base_player_teleported" ) )
{
const int index_ = event->GetInt( "entindex" );
if ( index_ == entindex() && IsLocalPlayer() )
const int index = event->GetInt( "entindex" );
if ( index == entindex() && IsLocalPlayer() )
{
// In VR, we want to make sure our head and body
// are aligned after we teleport.
@@ -891,10 +880,6 @@ void C_BasePlayer::PostDataUpdate( DataUpdateType_t updateType )
// Force the sound mixer to the freezecam mixer
ConVar *pVar = (ConVar *)cvar->FindVar( "snd_soundmixer" );
pVar->SetValue( "FreezeCam_Only" );
// When we start, give unused textures an opportunity to unload
if ( cl_clean_textures_on_death.GetBool() )
g_pMaterialSystem->UncacheUnusedMaterials( false );
}
else if ( m_bWasFreezeFraming && GetObserverMode() != OBS_MODE_FREEZECAM )
{
@@ -912,14 +897,6 @@ void C_BasePlayer::PostDataUpdate( DataUpdateType_t updateType )
m_nForceVisionFilterFlags = 0;
CalculateVisionUsingCurrentFlags();
}
// force calculate vision when the local vision flags changed
int nCurrentLocalPlayerVisionFlags = GetLocalPlayerVisionFilterFlags();
if ( m_nLocalPlayerVisionFlags != nCurrentLocalPlayerVisionFlags )
{
CalculateVisionUsingCurrentFlags();
m_nLocalPlayerVisionFlags = nCurrentLocalPlayerVisionFlags;
}
}
// If we are updated while paused, allow the player origin to be snapped by the
@@ -1594,11 +1571,11 @@ void C_BasePlayer::CalcRoamingView(Vector& eyeOrigin, QAngle& eyeAngles, float&
if ( spec_track.GetInt() > 0 )
{
C_BaseEntity *pTarget = ClientEntityList().GetBaseEntity( spec_track.GetInt() );
C_BaseEntity *target = ClientEntityList().GetBaseEntity( spec_track.GetInt() );
if ( pTarget )
if ( target )
{
Vector v = pTarget->GetAbsOrigin(); v.z += 54;
Vector v = target->GetAbsOrigin(); v.z += 54;
QAngle a; VectorAngles( v - eyeOrigin, a );
NormalizeAngles( a );
@@ -1892,14 +1869,6 @@ void C_BasePlayer::ThirdPersonSwitch( bool bThirdperson )
{
return false;
}
#ifdef TF_CLIENT_DLL
if ( TFGameRules() && TFGameRules()->IsCompetitiveMode() && TFGameRules()->PlayersAreOnMatchSummaryStage() )
{
return false;
}
#endif
int ObserverMode = pLocalPlayer->GetObserverMode();
if ( ( ObserverMode == OBS_MODE_NONE ) || ( ObserverMode == OBS_MODE_IN_EYE ) )
{
@@ -2109,7 +2078,7 @@ void C_BasePlayer::GetToolRecordingState( KeyValues *msg )
// then this code can (should!) be removed
if ( state.m_bThirdPerson )
{
const Vector& cam_ofs = g_ThirdPersonManager.GetCameraOffsetAngles();
Vector cam_ofs = g_ThirdPersonManager.GetCameraOffsetAngles();
QAngle camAngles;
camAngles[ PITCH ] = cam_ofs[ PITCH ];
@@ -2164,11 +2133,11 @@ void C_BasePlayer::Simulate()
// Consider using GetRenderedWeaponModel() instead - it will get the
// viewmodel or the active weapon as appropriate.
//-----------------------------------------------------------------------------
C_BaseViewModel *C_BasePlayer::GetViewModel( int index_ /*= 0*/, bool bObserverOK )
C_BaseViewModel *C_BasePlayer::GetViewModel( int index /*= 0*/, bool bObserverOK )
{
Assert( index_ >= 0 && index_ < MAX_VIEWMODELS );
Assert( index >= 0 && index < MAX_VIEWMODELS );
C_BaseViewModel *vm = m_hViewModel[index_];
C_BaseViewModel *vm = m_hViewModel[ index ];
if ( bObserverOK && GetObserverMode() == OBS_MODE_IN_EYE )
{
@@ -2177,7 +2146,7 @@ C_BaseViewModel *C_BasePlayer::GetViewModel( int index_ /*= 0*/, bool bObserverO
// get the targets viewmodel unless the target is an observer itself
if ( target && target != this && !target->IsObserver() )
{
vm = target->GetViewModel( index_ );
vm = target->GetViewModel( index );
}
}
@@ -2625,7 +2594,7 @@ void C_BasePlayer::NotePredictionError( const Vector &vDelta )
// offset curtime and setup bones at that time using fake interpolation
// fake interpolation means we don't have reliable interpolation history (the local player doesn't animate locally)
// so we just modify cycle and origin directly and use that as a fake guess
bool C_BasePlayer::ForceSetupBonesAtTimeFakeInterpolation( matrix3x4_t *pBonesOut, float curtimeOffset )
void C_BasePlayer::ForceSetupBonesAtTimeFakeInterpolation( matrix3x4_t *pBonesOut, float curtimeOffset )
{
// we don't have any interpolation data, so fake it
float cycle = m_flCycle;
@@ -2640,37 +2609,30 @@ bool C_BasePlayer::ForceSetupBonesAtTimeFakeInterpolation( matrix3x4_t *pBonesOu
m_flCycle = fmod( 10 + cycle + m_flPlaybackRate * curtimeOffset, 1.0f );
SetLocalOrigin( origin + curtimeOffset * GetLocalVelocity() );
// Setup bone state to extrapolate physics velocity
bool bSuccess = SetupBones( pBonesOut, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, gpGlobals->curtime + curtimeOffset );
SetupBones( pBonesOut, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, gpGlobals->curtime + curtimeOffset );
m_flCycle = cycle;
SetLocalOrigin( origin );
return bSuccess;
}
bool C_BasePlayer::GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt )
void C_BasePlayer::GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt )
{
if ( !IsLocalPlayer() )
return BaseClass::GetRagdollInitBoneArrays(pDeltaBones0, pDeltaBones1, pCurrentBones, boneDt);
bool bSuccess = true;
if ( !ForceSetupBonesAtTimeFakeInterpolation( pDeltaBones0, -boneDt ) )
bSuccess = false;
if ( !ForceSetupBonesAtTimeFakeInterpolation( pDeltaBones1, 0 ) )
bSuccess = false;
{
BaseClass::GetRagdollInitBoneArrays(pDeltaBones0, pDeltaBones1, pCurrentBones, boneDt);
return;
}
ForceSetupBonesAtTimeFakeInterpolation( pDeltaBones0, -boneDt );
ForceSetupBonesAtTimeFakeInterpolation( pDeltaBones1, 0 );
float ragdollCreateTime = PhysGetSyncCreateTime();
if ( ragdollCreateTime != gpGlobals->curtime )
{
if ( !ForceSetupBonesAtTimeFakeInterpolation( pCurrentBones, ragdollCreateTime - gpGlobals->curtime ) )
bSuccess = false;
ForceSetupBonesAtTimeFakeInterpolation( pCurrentBones, ragdollCreateTime - gpGlobals->curtime );
}
else
{
if ( !SetupBones( pCurrentBones, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, gpGlobals->curtime ) )
bSuccess = false;
SetupBones( pCurrentBones, MAXSTUDIOBONES, BONE_USED_BY_ANYTHING, gpGlobals->curtime );
}
return bSuccess;
}
@@ -2846,7 +2808,16 @@ bool C_BasePlayer::GetSteamID( CSteamID *pID )
{
if ( pi.friendsID && steamapicontext && steamapicontext->SteamUtils() )
{
pID->InstancedSet( pi.friendsID, 1, GetUniverse(), k_EAccountTypeIndividual );
#if 1 // new
static EUniverse universe = k_EUniverseInvalid;
if ( universe == k_EUniverseInvalid )
universe = steamapicontext->SteamUtils()->GetConnectedUniverse();
pID->InstancedSet( pi.friendsID, 1, universe, k_EAccountTypeIndividual );
#else // old
pID->InstancedSet( pi.friendsID, 1, steamapicontext->SteamUtils()->GetConnectedUniverse(), k_EAccountTypeIndividual );
#endif
return true;
}
@@ -2867,7 +2838,6 @@ void C_BasePlayer::UpdateWearables( void )
{
pItem->ValidateModelIndex();
pItem->UpdateVisibility();
pItem->CreateShadow();
}
}
}
+3 -5
View File
@@ -169,7 +169,7 @@ public:
virtual IRagdoll* GetRepresentativeRagdoll() const;
// override the initial bone position for ragdolls
virtual bool GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt ) OVERRIDE;
virtual void GetRagdollInitBoneArrays( matrix3x4_t *pDeltaBones0, matrix3x4_t *pDeltaBones1, matrix3x4_t *pCurrentBones, float boneDt );
// Returns eye vectors
void EyeVectors( Vector *pForward, Vector *pRight = NULL, Vector *pUp = NULL );
@@ -264,7 +264,6 @@ public:
virtual void UpdateClientData( void );
bool IsLerpingFOV( void ) const;
virtual float GetFOV( void );
int GetDefaultFOV( void ) const;
virtual bool IsZoomed( void ) { return false; }
@@ -389,7 +388,7 @@ public:
#if defined USES_ECON_ITEMS
// Wearables
virtual void UpdateWearables();
void UpdateWearables();
C_EconWearable *GetWearable( int i ) { return m_hMyWearables[i]; }
int GetNumWearables( void ) { return m_hMyWearables.Count(); }
#endif
@@ -586,7 +585,7 @@ protected:
virtual bool IsDucked( void ) const { return m_Local.m_bDucked; }
virtual bool IsDucking( void ) const { return m_Local.m_bDucking; }
virtual float GetFallVelocity( void ) { return m_Local.m_flFallVelocity; }
bool ForceSetupBonesAtTimeFakeInterpolation( matrix3x4_t *pBonesOut, float curtimeOffset );
void ForceSetupBonesAtTimeFakeInterpolation( matrix3x4_t *pBonesOut, float curtimeOffset );
float m_flLaggedMovementValue;
@@ -612,7 +611,6 @@ protected:
float m_flNextAchievementAnnounceTime;
int m_nForceVisionFilterFlags; // Force our vision filter to a specific setting
int m_nLocalPlayerVisionFlags;
#if defined USES_ECON_ITEMS
// Wearables
+17 -17
View File
@@ -92,11 +92,11 @@ void C_BaseTempEntity::Precache( void )
//-----------------------------------------------------------------------------
void C_BaseTempEntity::PrecacheTempEnts( void )
{
C_BaseTempEntity *pTe = GetList();
while ( pTe )
C_BaseTempEntity *te = GetList();
while ( te )
{
pTe->Precache();
pTe = pTe->GetNext();
te->Precache();
te = te->GetNext();
}
}
@@ -106,12 +106,12 @@ void C_BaseTempEntity::PrecacheTempEnts( void )
void C_BaseTempEntity::ClearDynamicTempEnts( void )
{
C_BaseTempEntity *next;
C_BaseTempEntity *pTe = s_pDynamicEntities;
while ( pTe )
C_BaseTempEntity *te = s_pDynamicEntities;
while ( te )
{
next = pTe->GetNextDynamic();
delete pTe;
pTe = next;
next = te->GetNextDynamic();
delete te;
te = next;
}
s_pDynamicEntities = NULL;
@@ -123,20 +123,20 @@ void C_BaseTempEntity::ClearDynamicTempEnts( void )
void C_BaseTempEntity::CheckDynamicTempEnts( void )
{
C_BaseTempEntity *next, *newlist = NULL;
C_BaseTempEntity *pTe = s_pDynamicEntities;
while ( pTe )
C_BaseTempEntity *te = s_pDynamicEntities;
while ( te )
{
next = pTe->GetNextDynamic();
if ( pTe->ShouldDestroy() )
next = te->GetNextDynamic();
if ( te->ShouldDestroy() )
{
delete pTe;
delete te;
}
else
{
pTe->m_pNextDynamic = newlist;
newlist = pTe;
te->m_pNextDynamic = newlist;
newlist = te;
}
pTe = next;
te = next;
}
s_pDynamicEntities = newlist;
-1
View File
@@ -55,7 +55,6 @@ public:
virtual void NotifyShouldTransmit( ShouldTransmitState_t state );
virtual void PreDataUpdate( DataUpdateType_t updateType );
virtual void PostDataUpdate( DataUpdateType_t updateType );
virtual void OnDataUnchangedInPVS( void ) { }
virtual void OnPreDataChanged( DataUpdateType_t updateType );
virtual void OnDataChanged( DataUpdateType_t updateType );
virtual void SetDormant( bool bDormant );
+3 -16
View File
@@ -18,9 +18,6 @@
#include "tools/bonelist.h"
#include <KeyValues.h>
#include "hltvcamera.h"
#ifdef TF_CLIENT_DLL
#include "tf_weaponbase.h"
#endif
#if defined( REPLAY_ENABLED )
#include "replay/replaycamera.h"
@@ -56,8 +53,8 @@ void FormatViewModelAttachment( Vector &vOrigin, bool bInverse )
// aspect ratio cancels out, so only need one factor
// the difference between the screen coordinates of the 2 systems is the ratio
// of the coefficients of the projection matrices (tan (fov/2) is that coefficient)
// NOTE: viewx was coming in as 0 when folks set their viewmodel_fov to 0 and show their weapon.
float factorX = viewx ? ( worldx / viewx ) : 0.0f;
float factorX = worldx / viewx;
float factorY = factorX;
// Get the coordinates in the viewer's space.
@@ -195,7 +192,7 @@ bool C_BaseViewModel::Interpolate( float currentTime )
}
bool C_BaseViewModel::ShouldFlipViewModel()
inline bool C_BaseViewModel::ShouldFlipViewModel()
{
#ifdef CSTRIKE_DLL
// If cl_righthand is set, then we want them all right-handed.
@@ -334,16 +331,6 @@ int C_BaseViewModel::DrawModel( int flags )
}
}
#ifdef TF_CLIENT_DLL
CTFWeaponBase* pTFWeapon = dynamic_cast<CTFWeaponBase*>( pWeapon );
if ( ( flags & STUDIO_RENDER ) && pTFWeapon && pTFWeapon->m_viewmodelStatTrakAddon )
{
pTFWeapon->m_viewmodelStatTrakAddon->RemoveEffects( EF_NODRAW );
pTFWeapon->m_viewmodelStatTrakAddon->DrawModel( flags );
pTFWeapon->m_viewmodelStatTrakAddon->AddEffects( EF_NODRAW );
}
#endif
return ret;
}
+1 -4
View File
@@ -1875,16 +1875,13 @@ void CSnowFallManager::FindSnowVolumes( Vector &vecCenter, float flRadius, Vecto
{
for ( iSnow = 0; iSnow < m_nActiveSnowCount; ++iSnow )
{
Vector vecMin, vecMax;
Vector vecCenter, vecMin, vecMax;
vecCenter = ( m_aSnow[iSnow].m_vecMin, m_aSnow[iSnow].m_vecMax ) * 0.5;
vecMin = m_aSnow[iSnow].m_vecMin - vecCenter;
vecMax = m_aSnow[iSnow].m_vecMax - vecCenter;
if ( debugoverlay )
{
debugoverlay->AddBoxOverlay( vecCenter, vecMin, vecMax, QAngle( 0, 0, 0 ), 200, 0, 0, 25, r_SnowDebugBox.GetFloat() );
}
}
}
#endif
}
+3 -5
View File
@@ -228,6 +228,7 @@ void C_EntityDissolve::BuildTeslaEffect( mstudiobbox_t *pHitBox, const matrix3x4
{
// Move it towards the camera
Vector vecFlash = tr.endpos;
Vector vecForward;
AngleVectors( MainViewAngles(), &vecForward );
vecFlash -= (vecForward * 8);
@@ -555,7 +556,7 @@ void C_EntityDissolve::ClientThink( void )
// because when the server says to destroy it, the client won't be able to find it.
// ClientEntityList().RemoveEntity( GetClientHandle() );
::partition->Remove( PARTITION_CLIENT_SOLID_EDICTS | PARTITION_CLIENT_RESPONSIVE_EDICTS | PARTITION_CLIENT_NON_STATIC_EDICTS, CollisionProp()->GetPartitionHandle() );
partition->Remove( PARTITION_CLIENT_SOLID_EDICTS | PARTITION_CLIENT_RESPONSIVE_EDICTS | PARTITION_CLIENT_NON_STATIC_EDICTS, CollisionProp()->GetPartitionHandle() );
RemoveFromLeafSystem();
@@ -574,10 +575,7 @@ void C_EntityDissolve::ClientThink( void )
#ifdef TF_CLIENT_DLL
else
{
// Hide the ragdoll -- don't actually delete it or else things get unhappy when
// we get a message from the server telling us to delete it
pEnt->AddEffects( EF_NODRAW );
pEnt->ParticleProp()->StopEmission();
pEnt->Release();
}
#endif
}
+1 -1
View File
@@ -217,7 +217,7 @@ void C_FireSmoke::RemoveClientOnly(void)
// Remove from the client entity list.
ClientEntityList().RemoveEntity( GetClientHandle() );
::partition->Remove( PARTITION_CLIENT_SOLID_EDICTS | PARTITION_CLIENT_RESPONSIVE_EDICTS | PARTITION_CLIENT_NON_STATIC_EDICTS, CollisionProp()->GetPartitionHandle() );
partition->Remove( PARTITION_CLIENT_SOLID_EDICTS | PARTITION_CLIENT_RESPONSIVE_EDICTS | PARTITION_CLIENT_NON_STATIC_EDICTS, CollisionProp()->GetPartitionHandle() );
RemoveFromLeafSystem();
}
-3
View File
@@ -133,8 +133,6 @@ void C_Fish::Spawn( void )
void C_Fish::ClientThink()
{
if (FishDebug.GetBool())
{
if ( debugoverlay )
{
debugoverlay->AddLineOverlay( m_pos, m_actualPos, 255, 0, 0, true, 0.1f );
switch( m_localLifeState )
@@ -148,7 +146,6 @@ void C_Fish::ClientThink()
break;
}
}
}
float deltaT = gpGlobals->frametime;
+9 -9
View File
@@ -94,14 +94,14 @@ private:
return &m_pSmokeParticleInfos[GetSmokeParticleIndex(x,y,z)];
}
inline void GetParticleInfoXYZ(int index_, int &x, int &y, int &z)
inline void GetParticleInfoXYZ(int index, int &x, int &y, int &z)
{
Assert( index_ >= 0 && index_ < m_xCount * m_yCount * m_zCount );
z = index_ / (m_xCount*m_yCount);
Assert( index >= 0 && index < m_xCount * m_yCount * m_zCount );
z = index / (m_xCount*m_yCount);
int zIndex = z*m_xCount*m_yCount;
y = (index_ - zIndex) / m_xCount;
y = (index - zIndex) / m_xCount;
int yIndex = y*m_xCount;
x = index_ - zIndex - yIndex;
x = index - zIndex - yIndex;
Assert( IsValidXYZCoords( x, y, z ) );
}
@@ -118,10 +118,10 @@ private:
z * m_SpacingRadius * 2 + m_SpacingRadius );
}
inline Vector GetSmokeParticlePosIndex(int index_ )
inline Vector GetSmokeParticlePosIndex(int index)
{
int x, y, z;
GetParticleInfoXYZ( index_, x, y, z);
GetParticleInfoXYZ(index, x, y, z);
return GetSmokeParticlePos(x, y, z);
}
@@ -595,8 +595,8 @@ void C_FuncSmokeVolume::FillVolume()
#ifdef _DEBUG
int testX, testY, testZ;
int index_ = GetSmokeParticleIndex(x,y,z);
GetParticleInfoXYZ( index_, testX, testY, testZ);
int index = GetSmokeParticleIndex(x,y,z);
GetParticleInfoXYZ(index, testX, testY, testZ);
assert(testX == x && testY == y && testZ == z);
#endif
+15 -15
View File
@@ -128,13 +128,13 @@ private:
inline int GetSmokeParticleIndex(int x, int y, int z) {return z*m_xCount*m_yCount+y*m_yCount+x;}
inline SmokeParticleInfo* GetSmokeParticleInfo(int x, int y, int z) {return &m_SmokeParticleInfos[GetSmokeParticleIndex(x,y,z)];}
inline void GetParticleInfoXYZ(int index_, int &x, int &y, int &z)
inline void GetParticleInfoXYZ(int index, int &x, int &y, int &z)
{
z = index_ / (m_xCount*m_yCount);
z = index / (m_xCount*m_yCount);
int zIndex = z*m_xCount*m_yCount;
y = (index_ - zIndex) / m_yCount;
y = (index - zIndex) / m_yCount;
int yIndex = y*m_yCount;
x = index_ - zIndex - yIndex;
x = index - zIndex - yIndex;
}
inline bool IsValidXYZCoords(int x, int y, int z)
@@ -150,10 +150,10 @@ private:
((float)z / (m_zCount-1)) * m_SpacingRadius * 2 - m_SpacingRadius);
}
inline Vector GetSmokeParticlePosIndex(int index_)
inline Vector GetSmokeParticlePosIndex(int index)
{
int x, y, z;
GetParticleInfoXYZ( index_, x, y, z);
GetParticleInfoXYZ(index, x, y, z);
return GetSmokeParticlePos(x, y, z);
}
@@ -875,8 +875,8 @@ void C_ParticleSmokeGrenade::FillVolume()
#ifdef _DEBUG
int testX, testY, testZ;
int index_ = GetSmokeParticleIndex(x,y,z);
GetParticleInfoXYZ( index_, testX, testY, testZ);
int index = GetSmokeParticleIndex(x,y,z);
GetParticleInfoXYZ(index, testX, testY, testZ);
assert(testX == x && testY == y && testZ == z);
#endif
@@ -943,12 +943,12 @@ void C_ParticleSmokeGrenade::CleanupToolRecordingState( KeyValues *msg )
int nId = AllocateToolParticleEffectId();
KeyValues *oldmsg = new KeyValues( "OldParticleSystem_Create" );
oldmsg->SetString( "name", "C_ParticleSmokeGrenade" );
oldmsg->SetInt( "id", nId );
oldmsg->SetFloat( "time", gpGlobals->curtime );
KeyValues *msg = new KeyValues( "OldParticleSystem_Create" );
msg->SetString( "name", "C_ParticleSmokeGrenade" );
msg->SetInt( "id", nId );
msg->SetFloat( "time", gpGlobals->curtime );
KeyValues *pEmitter = oldmsg->FindKey( "DmeSpriteEmitter", true );
KeyValues *pEmitter = msg->FindKey( "DmeSpriteEmitter", true );
pEmitter->SetInt( "count", NUM_PARTICLES_PER_DIMENSION * NUM_PARTICLES_PER_DIMENSION * NUM_PARTICLES_PER_DIMENSION );
pEmitter->SetFloat( "duration", 0 );
pEmitter->SetString( "material", "particle/particle_smokegrenade1" );
@@ -1025,8 +1025,8 @@ void C_ParticleSmokeGrenade::CleanupToolRecordingState( KeyValues *msg )
pSmokeGrenadeUpdater->SetFloat( "radiusExpandTime", SMOKESPHERE_EXPAND_TIME );
pSmokeGrenadeUpdater->SetFloat( "cutoffFraction", 0.7f );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, oldmsg );
oldmsg->deleteThis();
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
+2 -9
View File
@@ -198,19 +198,12 @@ void ParticleEffectCallback( const CEffectData &data )
pEnt->ParticleProp()->StopEmission();
}
Vector vOffset = vec3_origin;
ParticleAttachment_t iAttachType = (ParticleAttachment_t)data.m_nDamageType;
if ( iAttachType == PATTACH_ABSORIGIN_FOLLOW || iAttachType == PATTACH_POINT_FOLLOW || iAttachType == PATTACH_ROOTBONE_FOLLOW )
{
vOffset = data.m_vStart;
}
pEffect = pEnt->ParticleProp()->Create( pszName, iAttachType, data.m_nAttachmentIndex, vOffset );
pEffect = pEnt->ParticleProp()->Create( pszName, (ParticleAttachment_t)data.m_nDamageType, data.m_nAttachmentIndex );
AssertMsg2( pEffect.IsValid() && pEffect->IsValid(), "%s could not create particle effect %s",
C_BaseEntity::Instance( data.m_hEntity )->GetDebugName(), pszName );
if ( pEffect.IsValid() && pEffect->IsValid() )
{
if ( iAttachType == PATTACH_CUSTOMORIGIN )
if ( (ParticleAttachment_t)data.m_nDamageType == PATTACH_CUSTOMORIGIN )
{
pEffect->SetSortOrigin( data.m_vOrigin );
pEffect->SetControlPoint( 0, data.m_vOrigin );
+1 -1
View File
@@ -21,7 +21,7 @@
static void PixelvisDrawChanged( IConVar *pPixelvisVar, const char *pOld, float flOldValue );
ConVar r_pixelvisibility_partial( "r_pixelvisibility_partial", "1" );
ConVar r_dopixelvisibility( "r_dopixelvisibility", "1", FCVAR_ALLOWED_IN_COMPETITIVE );
ConVar r_dopixelvisibility( "r_dopixelvisibility", "1" );
ConVar r_drawpixelvisibility( "r_drawpixelvisibility", "0", 0, "Show the occlusion proxies", PixelvisDrawChanged );
ConVar r_pixelvisibility_spew( "r_pixelvisibility_spew", "0" );
+3 -3
View File
@@ -464,10 +464,10 @@ void C_Plasma::Update( void )
C_BaseEntity *ent = cl_entitylist->GetEnt( 0 );
if ( ent )
{
int iDecal = decalsystem->GetDecalIndexForName( "PlasmaGlowFade" );
if ( iDecal >= 0 )
int index = decalsystem->GetDecalIndexForName( "PlasmaGlowFade" );
if ( index >= 0 )
{
effects->DecalShoot( iDecal, 0, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), GetAbsOrigin(), 0, 0 );
effects->DecalShoot( index, 0, ent->GetModel(), ent->GetAbsOrigin(), ent->GetAbsAngles(), GetAbsOrigin(), 0, 0 );
}
}
}
-1
View File
@@ -52,7 +52,6 @@ public:
int m_nStepside;
float m_flFallVelocity;
int m_nOldButtons;
float m_flOldForwardMove;
// Base velocity that was passed in to server physics so
// client can predict conveyors correctly. Server zeroes it, so we need to store here, too.
Vector m_vecClientBaseVelocity;
+24 -61
View File
@@ -26,8 +26,6 @@ IMPLEMENT_CLIENTCLASS_DT_NOBASE(C_PlayerResource, DT_PlayerResource, CPlayerReso
RecvPropArray3( RECVINFO_ARRAY(m_iTeam), RecvPropInt( RECVINFO(m_iTeam[0]))),
RecvPropArray3( RECVINFO_ARRAY(m_bAlive), RecvPropInt( RECVINFO(m_bAlive[0]))),
RecvPropArray3( RECVINFO_ARRAY(m_iHealth), RecvPropInt( RECVINFO(m_iHealth[0]))),
RecvPropArray3( RECVINFO_ARRAY(m_iAccountID), RecvPropInt( RECVINFO(m_iAccountID[0]))),
RecvPropArray3( RECVINFO_ARRAY(m_bValid), RecvPropInt( RECVINFO(m_bValid[0]))),
END_RECV_TABLE()
BEGIN_PREDICTION_DATA( C_PlayerResource )
@@ -40,8 +38,6 @@ BEGIN_PREDICTION_DATA( C_PlayerResource )
DEFINE_PRED_ARRAY( m_iTeam, FIELD_INTEGER, MAX_PLAYERS+1, FTYPEDESC_PRIVATE ),
DEFINE_PRED_ARRAY( m_bAlive, FIELD_BOOLEAN, MAX_PLAYERS+1, FTYPEDESC_PRIVATE ),
DEFINE_PRED_ARRAY( m_iHealth, FIELD_INTEGER, MAX_PLAYERS+1, FTYPEDESC_PRIVATE ),
DEFINE_PRED_ARRAY( m_iAccountID, FIELD_INTEGER, MAX_PLAYERS+1, FTYPEDESC_PRIVATE ),
DEFINE_PRED_ARRAY( m_bValid, FIELD_BOOLEAN, MAX_PLAYERS+1, FTYPEDESC_PRIVATE ),
END_PREDICTION_DATA()
@@ -62,8 +58,6 @@ C_PlayerResource::C_PlayerResource()
memset( m_iTeam, 0, sizeof( m_iTeam ) );
memset( m_bAlive, 0, sizeof( m_bAlive ) );
memset( m_iHealth, 0, sizeof( m_iHealth ) );
memset( m_iAccountID, 0, sizeof( m_iAccountID ) );
memset( m_bValid, 0, sizeof( m_bValid ) );
m_szUnconnectedName = 0;
for ( int i=0; i<MAX_TEAMS; i++ )
@@ -104,11 +98,8 @@ void C_PlayerResource::UpdatePlayerName( int slot )
Error( "UpdatePlayerName with bogus slot %d\n", slot );
return;
}
if (!m_szUnconnectedName )
{
m_szUnconnectedName = AllocPooledString( PLAYER_UNCONNECTED_NAME );
}
player_info_t sPlayerInfo;
if ( IsConnected( slot ) && engine->GetPlayerInfo( slot, &sPlayerInfo ) )
@@ -116,19 +107,16 @@ void C_PlayerResource::UpdatePlayerName( int slot )
m_szName[slot] = AllocPooledString( sPlayerInfo.name );
}
else
{
if ( !IsValid( slot ) )
{
m_szName[slot] = m_szUnconnectedName;
}
}
}
void C_PlayerResource::ClientThink()
{
BaseClass::ClientThink();
for ( int i = 1; i <= MAX_PLAYERS; ++i )
for ( int i = 1; i <= gpGlobals->maxClients; ++i )
{
UpdatePlayerName( i );
}
@@ -147,7 +135,7 @@ const char *C_PlayerResource::GetPlayerName( int iIndex )
return PLAYER_ERROR_NAME;
}
if ( !IsConnected( iIndex ) && !IsValid( iIndex ) )
if ( !IsConnected( iIndex ) )
return PLAYER_UNCONNECTED_NAME;
// X360TBD: Network - figure out why the name isn't set
@@ -179,9 +167,9 @@ int C_PlayerResource::GetTeam(int iIndex )
}
}
const char * C_PlayerResource::GetTeamName(int index_)
const char * C_PlayerResource::GetTeamName(int index)
{
C_Team *team = GetGlobalTeam( index_ );
C_Team *team = GetGlobalTeam( index );
if ( !team )
return "Unknown";
@@ -189,9 +177,9 @@ const char * C_PlayerResource::GetTeamName(int index_)
return team->Get_Name();
}
int C_PlayerResource::GetTeamScore(int index_ )
int C_PlayerResource::GetTeamScore(int index)
{
C_Team *team = GetGlobalTeam( index_ );
C_Team *team = GetGlobalTeam( index );
if ( !team )
return 0;
@@ -199,30 +187,30 @@ int C_PlayerResource::GetTeamScore(int index_ )
return team->Get_Score();
}
int C_PlayerResource::GetFrags(int index_ )
int C_PlayerResource::GetFrags(int index )
{
return 666;
}
bool C_PlayerResource::IsLocalPlayer(int index_ )
bool C_PlayerResource::IsLocalPlayer(int index)
{
C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
if ( !pPlayer )
return false;
return (index_ == pPlayer->entindex() );
return ( index == pPlayer->entindex() );
}
bool C_PlayerResource::IsHLTV(int index_ )
bool C_PlayerResource::IsHLTV(int index)
{
if ( !IsConnected( index_ ) && !IsValid( index_ ) )
if ( !IsConnected( index ) )
return false;
player_info_t sPlayerInfo;
if ( engine->GetPlayerInfo( index_, &sPlayerInfo ) )
if ( engine->GetPlayerInfo( index, &sPlayerInfo ) )
{
return sPlayerInfo.ishltv;
}
@@ -230,15 +218,15 @@ bool C_PlayerResource::IsHLTV(int index_ )
return false;
}
bool C_PlayerResource::IsReplay(int index_ )
bool C_PlayerResource::IsReplay(int index)
{
#if defined( REPLAY_ENABLED )
if ( !IsConnected( index_ ) && !IsValid( index_ ) )
if ( !IsConnected( index ) )
return false;
player_info_t sPlayerInfo;
if ( engine->GetPlayerInfo( index_, &sPlayerInfo ) )
if ( engine->GetPlayerInfo( index, &sPlayerInfo ) )
{
return sPlayerInfo.isreplay;
}
@@ -252,7 +240,7 @@ bool C_PlayerResource::IsReplay(int index_ )
//-----------------------------------------------------------------------------
bool C_PlayerResource::IsFakePlayer( int iIndex )
{
if ( !IsConnected( iIndex ) && !IsValid( iIndex ) )
if ( !IsConnected( iIndex ) )
return false;
// Yuck, make sure it's up to date
@@ -270,7 +258,7 @@ bool C_PlayerResource::IsFakePlayer( int iIndex )
//-----------------------------------------------------------------------------
int C_PlayerResource::GetPing( int iIndex )
{
if ( !IsConnected( iIndex ) && !IsValid( iIndex ) )
if ( !IsConnected( iIndex ) )
return 0;
return m_iPing[iIndex];
@@ -281,7 +269,7 @@ int C_PlayerResource::GetPing( int iIndex )
/*-----------------------------------------------------------------------------
int C_PlayerResource::GetPacketloss( int iIndex )
{
if ( !IsConnected( iIndex ) && !IsPreservedData( iIndex ) )
if ( !IsConnected( iIndex ) )
return 0;
return m_iPacketloss[iIndex];
@@ -292,7 +280,7 @@ int C_PlayerResource::GetPacketloss( int iIndex )
//-----------------------------------------------------------------------------
int C_PlayerResource::GetPlayerScore( int iIndex )
{
if ( !IsConnected( iIndex ) && !IsValid( iIndex ) )
if ( !IsConnected( iIndex ) )
return 0;
return m_iScore[iIndex];
@@ -303,7 +291,7 @@ int C_PlayerResource::GetPlayerScore( int iIndex )
//-----------------------------------------------------------------------------
int C_PlayerResource::GetDeaths( int iIndex )
{
if ( !IsConnected( iIndex ) && !IsValid( iIndex ) )
if ( !IsConnected( iIndex ) )
return 0;
return m_iDeaths[iIndex];
@@ -314,15 +302,15 @@ int C_PlayerResource::GetDeaths( int iIndex )
//-----------------------------------------------------------------------------
int C_PlayerResource::GetHealth( int iIndex )
{
if ( !IsConnected( iIndex ) && !IsValid( iIndex ) )
if ( !IsConnected( iIndex ) )
return 0;
return m_iHealth[iIndex];
}
const Color &C_PlayerResource::GetTeamColor(int index_ )
const Color &C_PlayerResource::GetTeamColor(int index )
{
if ( index_ < 0 || index_ >= MAX_TEAMS )
if ( index < 0 || index >= MAX_TEAMS )
{
Assert( false );
static Color blah;
@@ -330,7 +318,7 @@ const Color &C_PlayerResource::GetTeamColor(int index_ )
}
else
{
return m_Colors[index_];
return m_Colors[index];
}
}
@@ -344,28 +332,3 @@ bool C_PlayerResource::IsConnected( int iIndex )
else
return m_bConnected[iIndex];
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
uint32 C_PlayerResource::GetAccountID( int iIndex )
{
if ( ( iIndex < 0 ) || ( iIndex >= ARRAYSIZE( m_iAccountID ) ) )
return 0;
if ( !IsConnected( iIndex ) && !IsValid( iIndex ) )
return 0;
return m_iAccountID[iIndex];
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool C_PlayerResource::IsValid( int iIndex )
{
if ( ( iIndex < 0 ) || ( iIndex >= ARRAYSIZE( m_bValid ) ) )
return false;
return m_bValid[iIndex];
}
+2 -6
View File
@@ -29,7 +29,7 @@ public:
C_PlayerResource();
virtual ~C_PlayerResource();
public : // IGameResources interface
public : // IGameResources intreface
// Team data access
virtual int GetTeamScore( int index );
@@ -56,9 +56,6 @@ public : // IGameResources interface
virtual void ClientThink();
virtual void OnDataChanged(DataUpdateType_t updateType);
uint32 GetAccountID( int iIndex );
bool IsValid( int iIndex );
protected:
void UpdatePlayerName( int slot );
@@ -73,9 +70,8 @@ protected:
bool m_bAlive[MAX_PLAYERS+1];
int m_iHealth[MAX_PLAYERS+1];
Color m_Colors[MAX_TEAMS];
uint32 m_iAccountID[MAX_PLAYERS+1];
bool m_bValid[MAX_PLAYERS+1];
string_t m_szUnconnectedName;
};
extern C_PlayerResource *g_PR;
+10 -20
View File
@@ -12,7 +12,6 @@
#include "input.h"
#ifdef TF_CLIENT_DLL
#include "cdll_util.h"
#include "tf_gamerules.h"
#endif
#include "rope_helpers.h"
#include "engine/ivmodelinfo.h"
@@ -194,7 +193,7 @@ public:
if( pReturn == NULL )
{
int iMaxSize = m_QueuedRopeMemory[m_nCurrentStack].GetMaxSize();
Warning( "Overflowed rope queued rendering memory stack. Needed %llu, have %d/%d\n", (uint64)bytes, iMaxSize - m_QueuedRopeMemory[m_nCurrentStack].GetUsed(), iMaxSize );
Warning( "Overflowed rope queued rendering memory stack. Needed %d, have %d/%d\n", bytes, iMaxSize - m_QueuedRopeMemory[m_nCurrentStack].GetUsed(), iMaxSize );
pReturn = malloc( bytes );
m_DeleteOnSwitch[m_nCurrentStack].AddToTail( pReturn );
}
@@ -377,7 +376,7 @@ void CRopeManager::AddToRenderCache( C_RopeKeyframe *pRope )
// If we didn't find one, then allocate the mofo.
if ( iRenderCache == nRenderCacheCount )
{
iRenderCache = m_aRenderCache.AddToTail();
int iRenderCache = m_aRenderCache.AddToTail();
m_aRenderCache[iRenderCache].m_pSolidMaterial = pRope->GetSolidMaterial();
if ( m_aRenderCache[iRenderCache].m_pSolidMaterial )
{
@@ -641,15 +640,6 @@ bool CRopeManager::IsHolidayLightMode( void )
return false;
}
#ifdef TF_CLIENT_DLL
if ( TFGameRules() && TFGameRules()->IsPowerupMode() )
{
// We don't want to draw the lights for the grapple.
// They get left behind for a while and look bad.
return false;
}
#endif
bool bDrawHolidayLights = false;
#ifdef USES_ECON_ITEMS
@@ -1648,12 +1638,12 @@ struct catmull_t
};
// bake out the terms of the catmull rom spline
void Catmull_Rom_Spline_Matrix( const Vector &vecP1, const Vector &vecP2, const Vector &vecP3, const Vector &vecP4, catmull_t &output )
void Catmull_Rom_Spline_Matrix( const Vector &p1, const Vector &p2, const Vector &p3, const Vector &p4, catmull_t &output )
{
output.t3 = 0.5f * ( ( -1 * vecP1 ) + ( 3 * vecP2 ) + ( -3 * vecP3 ) + vecP4 ); // 0.5 t^3 * [ (-1*p1) + ( 3*p2) + (-3*p3) + p4 ]
output.t2 = 0.5f * ( ( 2 * vecP1 ) + ( -5 * vecP2 ) + ( 4 * vecP3 ) - vecP4 ); // 0.5 t^2 * [ ( 2*p1) + (-5*p2) + ( 4*p3) - p4 ]
output.t = 0.5f * ( ( -1 * vecP1 ) + vecP3 ); // 0.5 t * [ (-1*p1) + p3 ]
output.c = vecP2; // p2
output.t3 = 0.5f * ((-1*p1) + (3*p2) + (-3*p3) + p4); // 0.5 t^3 * [ (-1*p1) + ( 3*p2) + (-3*p3) + p4 ]
output.t2 = 0.5f * ((2*p1) + (-5*p2) + (4*p3) - p4); // 0.5 t^2 * [ ( 2*p1) + (-5*p2) + ( 4*p3) - p4 ]
output.t = 0.5f * ((-1*p1) + p3); // 0.5 t * [ (-1*p1) + p3 ]
output.c = p2; // p2
}
// evaluate one point on the spline, t is a vector of (t, t^2, t^3)
@@ -1927,10 +1917,10 @@ bool C_RopeKeyframe::CalculateEndPointAttachment( C_BaseEntity *pEnt, int iAttac
if ( !pModel )
return false;
int iAttachmentBuf = pModel->LookupAttachment( "buff_attach" );
int iAttachment = pModel->LookupAttachment( "buff_attach" );
if ( pAngles )
return pModel->GetAttachment( iAttachmentBuf, vPos, *pAngles );
return pModel->GetAttachment( iAttachmentBuf, vPos );
return pModel->GetAttachment( iAttachment, vPos, *pAngles );
return pModel->GetAttachment( iAttachment, vPos );
}
}
+16 -18
View File
@@ -115,7 +115,7 @@ bool C_SceneEntity::GetHWMorphSceneFileName( const char *pFilename, char *pHWMFi
// Find the hardware morph scene name and pass that along as well.
char szScene[MAX_PATH];
V_strcpy_safe( szScene, pFilename );
V_strcpy( szScene, pFilename );
char szSceneHWM[MAX_PATH];
szSceneHWM[0] = '\0';
@@ -206,20 +206,20 @@ void C_SceneEntity::SetupClientOnlyScene( const char *pszFilename, C_BaseFlex *p
char szFilename[128];
Assert( V_strlen( pszFilename ) < 128 );
V_strcpy_safe( szFilename, pszFilename );
V_strcpy( szFilename, pszFilename );
char szSceneHWM[128];
if ( GetHWMorphSceneFileName( szFilename, szSceneHWM ) )
{
V_strcpy_safe( szFilename, szSceneHWM );
V_strcpy( szFilename, szSceneHWM );
}
Assert( szFilename[ 0 ] );
if ( szFilename[ 0 ] )
Assert( szFilename && szFilename[ 0 ] );
if ( szFilename && szFilename[ 0 ] )
{
LoadSceneFromFile( szFilename );
if ( !HushAsserts() )
if (!CommandLine()->FindParm("-hushasserts"))
{
Assert( m_pScene );
}
@@ -257,7 +257,7 @@ void C_SceneEntity::SetupClientOnlyScene( const char *pszFilename, C_BaseFlex *p
if ( m_hOwner.Get() )
{
if ( !HushAsserts() )
if (!CommandLine()->FindParm("-hushasserts"))
{
Assert( m_pScene );
}
@@ -320,7 +320,7 @@ void C_SceneEntity::PostDataUpdate( DataUpdateType_t updateType )
if ( str )
{
Assert( V_strlen( str ) < MAX_PATH );
V_strcpy_safe( szFilename, str );
V_strcpy( szFilename, str );
}
else
{
@@ -330,13 +330,13 @@ void C_SceneEntity::PostDataUpdate( DataUpdateType_t updateType )
char szSceneHWM[MAX_PATH];
if ( GetHWMorphSceneFileName( szFilename, szSceneHWM ) )
{
V_strcpy_safe( szFilename, szSceneHWM );
V_strcpy( szFilename, szSceneHWM );
}
if ( updateType == DATA_UPDATE_CREATED )
{
Assert( szFilename[ 0 ] );
if ( szFilename[ 0 ] )
Assert( szFilename && szFilename[ 0 ] );
if ( szFilename && szFilename[ 0 ] )
{
LoadSceneFromFile( szFilename );
@@ -373,8 +373,6 @@ void C_SceneEntity::PostDataUpdate( DataUpdateType_t updateType )
SetNextClientThink( CLIENT_THINK_ALWAYS );
}
m_bWasPlaying = !m_bIsPlayingBack; // force it to be "changed"
}
// Playback state changed...
@@ -1108,7 +1106,7 @@ void C_SceneEntity::SetCurrentTime( float t, bool forceClientSync )
//-----------------------------------------------------------------------------
void C_SceneEntity::PrefetchAnimBlocks( CChoreoScene *pScene )
{
if ( !HushAsserts() )
if (!CommandLine()->FindParm("-hushasserts"))
{
Assert( pScene && m_bMultiplayer );
}
@@ -1162,11 +1160,11 @@ void C_SceneEntity::PrefetchAnimBlocks( CChoreoScene *pScene )
{
// Now look up the animblock
mstudioseqdesc_t &seqdesc = pStudioHdr->pSeqdesc( iSequence );
for ( int iGroup = 0 ; iGroup < seqdesc.groupsize[ 0 ] ; ++iGroup )
for ( int i = 0 ; i < seqdesc.groupsize[ 0 ] ; ++i )
{
for ( int j = 0; j < seqdesc.groupsize[ 1 ]; ++j )
{
int iAnimation = seqdesc.anim( iGroup, j );
int iAnimation = seqdesc.anim( i, j );
int iBaseAnimation = pStudioHdr->iRelativeAnim( iSequence, iAnimation );
mstudioanimdesc_t &animdesc = pStudioHdr->pAnimdesc( iBaseAnimation );
@@ -1185,14 +1183,14 @@ void C_SceneEntity::PrefetchAnimBlocks( CChoreoScene *pScene )
++nResident;
if ( nSpew > 1 )
{
Msg( "%s:%s[%i:%i] was resident\n", pStudioHdr->pszName(), animdesc.pszName(), iGroup, j );
Msg( "%s:%s[%i:%i] was resident\n", pStudioHdr->pszName(), animdesc.pszName(), i, j );
}
}
else
{
if ( nSpew != 0 )
{
Msg( "%s:%s[%i:%i] async load\n", pStudioHdr->pszName(), animdesc.pszName(), iGroup, j );
Msg( "%s:%s[%i:%i] async load\n", pStudioHdr->pszName(), animdesc.pszName(), i, j );
}
}
}
+4 -4
View File
@@ -272,8 +272,8 @@ void C_SlideshowDisplay::BuildSlideShowImagesList( void )
if ( bLoaded )
{
char szKeywords[ 256 ] = {0};
V_strcpy_safe( szKeywords, pMaterialKeys->GetString( "%keywords", "" ) );
char szKeywords[ 256 ];
Q_strcpy( szKeywords, pMaterialKeys->GetString( "%keywords", "" ) );
char *pchKeyword = szKeywords;
@@ -306,7 +306,7 @@ void C_SlideshowDisplay::BuildSlideShowImagesList( void )
{
// Couldn't find the list, so create it
iList = m_SlideMaterialLists.AddToTail( new SlideMaterialList_t );
V_strcpy_safe( m_SlideMaterialLists[iList]->szSlideKeyword, pchKeyword );
Q_strcpy( m_SlideMaterialLists[ iList ]->szSlideKeyword, pchKeyword );
}
// Add material index to this list
@@ -329,7 +329,7 @@ void C_SlideshowDisplay::BuildSlideShowImagesList( void )
{
// Couldn't find the generic list, so create it
iList = m_SlideMaterialLists.AddToHead( new SlideMaterialList_t );
V_strcpy_safe( m_SlideMaterialLists[iList]->szSlideKeyword, "" );
Q_strcpy( m_SlideMaterialLists[ iList ]->szSlideKeyword, "" );
}
// Add material index to this list
+31 -28
View File
@@ -396,12 +396,12 @@ void C_SmokeTrail::CleanupToolRecordingState( KeyValues *msg )
{
int nId = m_pSmokeEmitter->AllocateToolParticleEffectId();
KeyValues *oldmsg = new KeyValues( "OldParticleSystem_Create" );
oldmsg->SetString( "name", "C_SmokeTrail" );
oldmsg->SetInt( "id", nId );
oldmsg->SetFloat( "time", gpGlobals->curtime );
KeyValues *msg = new KeyValues( "OldParticleSystem_Create" );
msg->SetString( "name", "C_SmokeTrail" );
msg->SetInt( "id", nId );
msg->SetFloat( "time", gpGlobals->curtime );
KeyValues *pRandomEmitter = oldmsg->FindKey( "DmeRandomEmitter", true );
KeyValues *pRandomEmitter = msg->FindKey( "DmeRandomEmitter", true );
pRandomEmitter->SetInt( "count", m_SpawnRate ); // particles per second, when duration is < 0
pRandomEmitter->SetFloat( "duration", -1 );
pRandomEmitter->SetInt( "active", bEmitterActive );
@@ -487,18 +487,18 @@ void C_SmokeTrail::CleanupToolRecordingState( KeyValues *msg )
pEmitter2->SetString( "material", "particle/particle_noisesphere" );
pEmitterParent2->AddSubKey( pEmitter2 );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, oldmsg );
oldmsg->deleteThis();
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
else
{
KeyValues *oldmsg = new KeyValues( "OldParticleSystem_ActivateEmitter" );
oldmsg->SetInt( "id", m_pSmokeEmitter->GetToolParticleEffectId() );
oldmsg->SetInt( "emitter", 0 );
oldmsg->SetInt( "active", bEmitterActive );
oldmsg->SetFloat( "time", gpGlobals->curtime );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, oldmsg );
oldmsg->deleteThis();
KeyValues *msg = new KeyValues( "OldParticleSystem_ActivateEmitter" );
msg->SetInt( "id", m_pSmokeEmitter->GetToolParticleEffectId() );
msg->SetInt( "emitter", 0 );
msg->SetInt( "active", bEmitterActive );
msg->SetFloat( "time", gpGlobals->curtime );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
@@ -771,6 +771,8 @@ void C_RocketTrail::Update( float fTimeDelta )
if ( m_bDamaged )
{
SimpleParticle *pParticle;
Vector offset;
Vector offsetColor;
CSmartPtr<CEmberEffect> pEmitter = CEmberEffect::Create("C_RocketTrail::damaged");
@@ -1507,6 +1509,7 @@ void C_FireTrail::Update( float fTimeDelta )
numPuffs = clamp( numPuffs, 1, 32 );
SimpleParticle *pParticle;
Vector offset;
Vector offsetColor;
float step = moveLength / numPuffs;
@@ -1915,12 +1918,12 @@ void C_DustTrail::CleanupToolRecordingState( KeyValues *msg )
{
int nId = m_pDustEmitter->AllocateToolParticleEffectId();
KeyValues *oldmsg = new KeyValues( "OldParticleSystem_Create" );
oldmsg->SetString( "name", "C_DustTrail" );
oldmsg->SetInt( "id", nId );
oldmsg->SetFloat( "time", gpGlobals->curtime );
KeyValues *msg = new KeyValues( "OldParticleSystem_Create" );
msg->SetString( "name", "C_DustTrail" );
msg->SetInt( "id", nId );
msg->SetFloat( "time", gpGlobals->curtime );
KeyValues *pEmitter = oldmsg->FindKey( "DmeSpriteEmitter", true );
KeyValues *pEmitter = msg->FindKey( "DmeSpriteEmitter", true );
pEmitter->SetString( "material", "particle/smokesprites_0001" );
pEmitter->SetInt( "count", m_SpawnRate ); // particles per second, when duration is < 0
pEmitter->SetFloat( "duration", -1 ); // FIXME
@@ -1994,17 +1997,17 @@ void C_DustTrail::CleanupToolRecordingState( KeyValues *msg )
pUpdaters->FindKey( "DmeColorUpdater", true );
pUpdaters->FindKey( "DmeSizeUpdater", true );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, oldmsg );
oldmsg->deleteThis();
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
else
{
KeyValues *oldmsg = new KeyValues( "OldParticleSystem_ActivateEmitter" );
oldmsg->SetInt( "id", m_pDustEmitter->GetToolParticleEffectId() );
oldmsg->SetInt( "emitter", 0 );
oldmsg->SetInt( "active", bEmitterActive );
oldmsg->SetFloat( "time", gpGlobals->curtime );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, oldmsg );
oldmsg->deleteThis();
KeyValues *msg = new KeyValues( "OldParticleSystem_ActivateEmitter" );
msg->SetInt( "id", m_pDustEmitter->GetToolParticleEffectId() );
msg->SetInt( "emitter", 0 );
msg->SetInt( "active", bEmitterActive );
msg->SetFloat( "time", gpGlobals->curtime );
ToolFramework_PostToolMessage( HTOOLHANDLE_INVALID, msg );
msg->deleteThis();
}
}
+1
View File
@@ -463,6 +463,7 @@ void C_SmokeStack::SimulateParticles( CParticleSimulateIterator *pIterator )
else
{
// Transform.
Vector tPos;
if( m_bTwist )
{
Vector vTwist(
+1 -1
View File
@@ -150,7 +150,7 @@ public:
{
Msg( "- %d: %s\n", i, m_soundscapes[i]->GetName() );
}
if ( m_forcedSoundscapeIndex >= 0 )
if ( m_forcedSoundscapeIndex )
{
Msg( "- PLAYING DEBUG SOUNDSCAPE: %d [%s]\n", m_forcedSoundscapeIndex, SoundscapeNameByIndex(m_forcedSoundscapeIndex) );
}
+1 -1
View File
@@ -159,7 +159,7 @@ void StickRagdollNow( const Vector &vecOrigin, const Vector &vecDirection )
shotRay.Init( vecOrigin, vecEnd );
CRagdollBoltEnumerator ragdollEnum( shotRay, vecOrigin );
::partition->EnumerateElementsAlongRay( PARTITION_CLIENT_RESPONSIVE_EDICTS, shotRay, false, &ragdollEnum );
partition->EnumerateElementsAlongRay( PARTITION_CLIENT_RESPONSIVE_EDICTS, shotRay, false, &ragdollEnum );
CreateCrossbowBolt( vecOrigin, vecDirection );
}
+2 -2
View File
@@ -509,11 +509,11 @@ public:
}
}
virtual void PhysicsProp( IRecipientFilter& filter, float delay, int modelindex, int skin,
const Vector& pos, const QAngle &angles, const Vector& vel, int flags, int fEffects )
const Vector& pos, const QAngle &angles, const Vector& vel, int flags, int effects )
{
if ( !SuppressTE( filter ) )
{
TE_PhysicsProp( filter, delay, modelindex, skin, pos, angles, vel, flags, fEffects );
TE_PhysicsProp( filter, delay, modelindex, skin, pos, angles, vel, flags, effects );
}
}
virtual void ClientProjectile( IRecipientFilter& filter, float delay,
+8 -8
View File
@@ -173,18 +173,18 @@ void TE_BloodStream( IRecipientFilter& filter, float delay,
// 'chunkier' appearance.
for (count2 = 0; count2 < 2; count2++)
{
StandardParticle_t *pChunky = pRen->AddParticle();
if( pChunky )
StandardParticle_t *p = pRen->AddParticle();
if(p)
{
pRen->SetParticleLifetime( pChunky, 3);
pChunky->SetColor(random->RandomFloat(0.7, 1.0), g, b);
pChunky->SetAlpha(a);
pChunky->m_Pos.Init(
pRen->SetParticleLifetime(p, 3);
p->SetColor(random->RandomFloat(0.7, 1.0), g, b);
p->SetAlpha(a);
p->m_Pos.Init(
(*org)[0] + random->RandomFloat(-1,1),
(*org)[1] + random->RandomFloat(-1,1),
(*org)[2] + random->RandomFloat(-1,1));
pRen->SetParticleType( pChunky, pt_vox_slowgrav);
pRen->SetParticleType(p, pt_vox_slowgrav);
VectorCopy (dir, dirCopy);
@@ -192,7 +192,7 @@ void TE_BloodStream( IRecipientFilter& filter, float delay,
VectorScale (dirCopy, num, dirCopy);// randomize a bit
pChunky->m_Velocity = dirCopy * speedCopy;
p->m_Velocity = dirCopy * speedCopy;
}
}
}
+1 -1
View File
@@ -173,7 +173,7 @@ void C_TEExplosion::AffectRagdolls( void )
return;
CRagdollExplosionEnumerator ragdollEnum( m_vecOrigin, m_nRadius, m_nMagnitude );
::partition->EnumerateElementsInSphere( PARTITION_CLIENT_RESPONSIVE_EDICTS, m_vecOrigin, m_nRadius, false, &ragdollEnum );
partition->EnumerateElementsInSphere( PARTITION_CLIENT_RESPONSIVE_EDICTS, m_vecOrigin, m_nRadius, false, &ragdollEnum );
}
//
+11 -10
View File
@@ -153,7 +153,7 @@ void C_LocalTempEntity::SetAcceleration( const Vector &vecVelocity )
// Purpose:
// Output : int
//-----------------------------------------------------------------------------
int C_LocalTempEntity::DrawStudioModel( int modelFlags )
int C_LocalTempEntity::DrawStudioModel( int flags )
{
VPROF_BUDGET( "C_LocalTempEntity::DrawStudioModel", VPROF_BUDGETGROUP_MODEL_RENDERING );
int drawn = 0;
@@ -168,12 +168,12 @@ int C_LocalTempEntity::DrawStudioModel( int modelFlags )
if ( m_pfnDrawHelper )
{
drawn = ( *m_pfnDrawHelper )( this, modelFlags);
drawn = ( *m_pfnDrawHelper )( this, flags );
}
else
{
drawn = modelrender->DrawModel(
modelFlags,
flags,
this,
MODEL_INSTANCE_INVALID,
index,
@@ -191,7 +191,7 @@ int C_LocalTempEntity::DrawStudioModel( int modelFlags )
// Purpose:
// Input : flags -
//-----------------------------------------------------------------------------
int C_LocalTempEntity::DrawModel( int modelFlags )
int C_LocalTempEntity::DrawModel( int flags )
{
int drawn = 0;
@@ -238,7 +238,7 @@ int C_LocalTempEntity::DrawModel( int modelFlags )
);
break;
case mod_studio:
drawn = DrawStudioModel( modelFlags );
drawn = DrawStudioModel( flags );
break;
default:
break;
@@ -1097,7 +1097,7 @@ void CTempEnts::BreakModel( const Vector &pos, const QAngle &angles, const Vecto
}
}
void CTempEnts::PhysicsProp( int modelindex, int skin, const Vector& pos, const QAngle &angles, const Vector& vel, int physFlags, int physEffects )
void CTempEnts::PhysicsProp( int modelindex, int skin, const Vector& pos, const QAngle &angles, const Vector& vel, int flags, int effects )
{
C_PhysPropClientside *pEntity = C_PhysPropClientside::CreateNew();
@@ -1117,7 +1117,7 @@ void CTempEnts::PhysicsProp( int modelindex, int skin, const Vector& pos, const
pEntity->SetAbsOrigin( pos );
pEntity->SetAbsAngles( angles );
pEntity->SetPhysicsMode( PHYSICS_MULTIPLAYER_CLIENTSIDE );
pEntity->SetEffects( physEffects );
pEntity->SetEffects( effects );
if ( !pEntity->Initialize() )
{
@@ -1138,7 +1138,7 @@ void CTempEnts::PhysicsProp( int modelindex, int skin, const Vector& pos, const
return;
}
if ( physFlags & 1 )
if ( flags & 1 )
{
pEntity->SetHealth( 0 );
pEntity->Break();
@@ -1539,7 +1539,7 @@ void CTempEnts::BloodSprite( const Vector &org, int r, int g, int b, int a, int
{
C_LocalTempEntity *pTemp;
int frameCount = modelinfo->GetModelFrameCount( model );
color32 impactcolor = { (byte)r, (byte)g, (byte)b, (byte)a };
color32 impactcolor = { r, g, b, a };
//Large, single blood sprite is a high-priority tent
if ( ( pTemp = TempEntAllocHigh( org, model ) ) != NULL )
@@ -2941,6 +2941,7 @@ void CTempEnts::MuzzleFlash_Shotgun_NPC( ClientEntityHandle_t hEntity, int attac
QAngle angles;
Vector forward;
int i;
// Setup the origin.
Vector origin;
@@ -3007,7 +3008,7 @@ void CTempEnts::MuzzleFlash_Shotgun_NPC( ClientEntityHandle_t hEntity, int attac
int numEmbers = random->RandomInt( 4, 8 );
for ( int i = 0; i < numEmbers; i++ )
for ( i = 0; i < numEmbers; i++ )
{
pTrailParticle = (TrailParticle *) pTrails->AddParticle( sizeof( TrailParticle ), g_Mat_SMG_Muzzleflash[0], origin );
+3 -3
View File
@@ -123,10 +123,10 @@ static inline void RecordPhysicsProp( const Vector& start, const QAngle &angles,
// Purpose:
//-----------------------------------------------------------------------------
void TE_PhysicsProp( IRecipientFilter& filter, float delay,
int modelindex, int skin, const Vector& pos, const QAngle &angles, const Vector& vel, bool breakmodel, int fEffects )
int modelindex, int skin, const Vector& pos, const QAngle &angles, const Vector& vel, bool breakmodel, int effects )
{
tempents->PhysicsProp( modelindex, skin, pos, angles, vel, breakmodel, fEffects );
RecordPhysicsProp( pos, angles, vel, modelindex, breakmodel, skin, fEffects );
tempents->PhysicsProp( modelindex, skin, pos, angles, vel, breakmodel, effects );
RecordPhysicsProp( pos, angles, vel, modelindex, breakmodel, skin, effects );
}
//-----------------------------------------------------------------------------
+25 -25
View File
@@ -248,12 +248,12 @@ void C_BaseTeamObjectiveResource::OnDataChanged( DataUpdateType_t updateType )
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_BaseTeamObjectiveResource::UpdateControlPoint( const char *pszEvent, int index_ )
void C_BaseTeamObjectiveResource::UpdateControlPoint( const char *pszEvent, int index )
{
IGameEvent *event = gameeventmanager->CreateEvent( pszEvent );
if ( event )
{
event->SetInt( "index", index_ );
event->SetInt( "index", index );
gameeventmanager->FireEventClientSide( event );
}
}
@@ -261,16 +261,16 @@ void C_BaseTeamObjectiveResource::UpdateControlPoint( const char *pszEvent, int
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
float C_BaseTeamObjectiveResource::GetCPCapPercentage( int index_ )
float C_BaseTeamObjectiveResource::GetCPCapPercentage( int index )
{
Assert( 0 <= index_ && index_ <= m_iNumControlPoints );
Assert( 0 <= index && index <= m_iNumControlPoints );
float flCapLength = m_flTeamCapTime[ TEAM_ARRAY(index_,m_iCappingTeam[index_]) ];
float flCapLength = m_flTeamCapTime[ TEAM_ARRAY(index,m_iCappingTeam[index]) ];
if( flCapLength <= 0 )
return 0.0f;
float flElapsedTime = flCapLength - m_flCapTimeLeft[index_];
float flElapsedTime = flCapLength - m_flCapTimeLeft[index];
if( flElapsedTime > flCapLength )
return 1.0f;
@@ -303,41 +303,41 @@ int C_BaseTeamObjectiveResource::GetNumControlPointsOwned( void )
// Purpose:
// team -
//-----------------------------------------------------------------------------
void C_BaseTeamObjectiveResource::SetOwningTeam( int index_, int team )
void C_BaseTeamObjectiveResource::SetOwningTeam( int index, int team )
{
if ( team == m_iCappingTeam[index_] )
if ( team == m_iCappingTeam[index] )
{
// successful cap, reset things
m_iCappingTeam[index_] = TEAM_UNASSIGNED;
m_flCapTimeLeft[index_] = 0.0f;
m_flCapLastThinkTime[index_] = 0;
m_iCappingTeam[index] = TEAM_UNASSIGNED;
m_flCapTimeLeft[index] = 0.0f;
m_flCapLastThinkTime[index] = 0;
}
m_iOwner[index_] = team;
m_iOwner[index] = team;
UpdateControlPoint( "controlpoint_updateowner", index_ );
UpdateControlPoint( "controlpoint_updateowner", index );
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void C_BaseTeamObjectiveResource::SetCappingTeam( int index_, int team )
void C_BaseTeamObjectiveResource::SetCappingTeam( int index, int team )
{
if ( team != GetOwningTeam( index_ ) && ( team > LAST_SHARED_TEAM ) )
if ( team != GetOwningTeam( index ) && ( team > LAST_SHARED_TEAM ) )
{
m_flCapTimeLeft[index_] = m_flTeamCapTime[ TEAM_ARRAY( index_,team) ];
m_flCapTimeLeft[index] = m_flTeamCapTime[ TEAM_ARRAY(index,team) ];
}
else
{
m_flCapTimeLeft[index_] = 0.0;
m_flCapTimeLeft[index] = 0.0;
}
m_iCappingTeam[index_] = team;
m_bWarnedOnFinalCap[index_] = false;
m_iCappingTeam[index] = team;
m_bWarnedOnFinalCap[index] = false;
m_flCapLastThinkTime[index_] = gpGlobals->curtime;
m_flCapLastThinkTime[index] = gpGlobals->curtime;
SetNextClientThink( gpGlobals->curtime + RESOURCE_THINK_TIME );
UpdateControlPoint( "controlpoint_updatecapping", index_ );
UpdateControlPoint( "controlpoint_updatecapping", index );
}
//-----------------------------------------------------------------------------
@@ -353,14 +353,14 @@ void C_BaseTeamObjectiveResource::SetCapLayout( const char *pszLayout )
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool C_BaseTeamObjectiveResource::CapIsBlocked( int index_ )
bool C_BaseTeamObjectiveResource::CapIsBlocked( int index )
{
Assert( 0 <= index_ && index_ <= m_iNumControlPoints );
Assert( 0 <= index && index <= m_iNumControlPoints );
if ( m_flCapTimeLeft[index_] )
if ( m_flCapTimeLeft[index] )
{
// Blocked caps have capping teams & cap times, but no players on the point
if ( GetNumPlayersInArea( index_, m_iCappingTeam[index_] ) == 0 )
if ( GetNumPlayersInArea( index, m_iCappingTeam[index] ) == 0 )
return true;
}
+72 -72
View File
@@ -45,94 +45,94 @@ public:
void SetCapLayout( const char *pszLayout );
// Is the point visible in the objective display
bool IsCPVisible( int index_ )
bool IsCPVisible( int index )
{
Assert( index_ < m_iNumControlPoints );
return m_bCPIsVisible[index_];
Assert( index < m_iNumControlPoints );
return m_bCPIsVisible[index];
}
bool IsCPBlocked( int index_ )
bool IsCPBlocked( int index )
{
Assert( index_ < m_iNumControlPoints );
return m_bBlocked[index_];
Assert( index < m_iNumControlPoints );
return m_bBlocked[index];
}
// Get the world location of this control point
Vector& GetCPPosition( int index_ )
Vector& GetCPPosition( int index )
{
Assert( index_ < m_iNumControlPoints );
return m_vCPPositions[index_];
Assert( index < m_iNumControlPoints );
return m_vCPPositions[index];
}
int GetOwningTeam( int index_ )
int GetOwningTeam( int index )
{
if ( index_ >= m_iNumControlPoints )
if ( index >= m_iNumControlPoints )
return TEAM_UNASSIGNED;
return m_iOwner[index_];
return m_iOwner[index];
}
int GetCappingTeam( int index_ )
int GetCappingTeam( int index )
{
if ( index_ >= m_iNumControlPoints )
if ( index >= m_iNumControlPoints )
return TEAM_UNASSIGNED;
return m_iCappingTeam[index_];
return m_iCappingTeam[index];
}
int GetTeamInZone( int index_ )
int GetTeamInZone( int index )
{
if ( index_ >= m_iNumControlPoints )
if ( index >= m_iNumControlPoints )
return TEAM_UNASSIGNED;
return m_iTeamInZone[index_];
return m_iTeamInZone[index];
}
// Icons
int GetCPCurrentOwnerIcon( int index_, int iOwner )
int GetCPCurrentOwnerIcon( int index, int iOwner )
{
Assert( index_ < m_iNumControlPoints );
Assert( index < m_iNumControlPoints );
return GetIconForTeam( index_, iOwner );
return GetIconForTeam( index, iOwner );
}
int GetCPCappingIcon( int index_ )
int GetCPCappingIcon( int index )
{
Assert( index_ < m_iNumControlPoints );
Assert( index < m_iNumControlPoints );
int iCapper = GetCappingTeam( index_ );
int iCapper = GetCappingTeam(index);
Assert( iCapper != TEAM_UNASSIGNED );
return GetIconForTeam( index_, iCapper );
return GetIconForTeam( index, iCapper );;
}
// Icon for the specified team
int GetIconForTeam( int index_, int team )
int GetIconForTeam( int index, int team )
{
Assert( index_ < m_iNumControlPoints );
return m_iTeamIcons[ TEAM_ARRAY( index_,team) ];
Assert( index < m_iNumControlPoints );
return m_iTeamIcons[ TEAM_ARRAY(index,team) ];
}
// Overlay for the specified team
int GetOverlayForTeam( int index_, int team )
int GetOverlayForTeam( int index, int team )
{
Assert( index_ < m_iNumControlPoints );
return m_iTeamOverlays[ TEAM_ARRAY( index_,team) ];
Assert( index < m_iNumControlPoints );
return m_iTeamOverlays[ TEAM_ARRAY(index,team) ];
}
// Number of players in the area
int GetNumPlayersInArea( int index_, int team )
int GetNumPlayersInArea( int index, int team )
{
Assert( index_ < m_iNumControlPoints );
return m_iNumTeamMembers[ TEAM_ARRAY( index_,team) ];
Assert( index < m_iNumControlPoints );
return m_iNumTeamMembers[ TEAM_ARRAY(index,team) ];
}
// get the required cappers for the passed team
int GetRequiredCappers( int index_, int team )
int GetRequiredCappers( int index, int team )
{
Assert( index_ < m_iNumControlPoints );
return m_iTeamReqCappers[ TEAM_ARRAY( index_,team) ];
Assert( index < m_iNumControlPoints );
return m_iTeamReqCappers[ TEAM_ARRAY(index,team) ];
}
// Base Icon for the specified team
@@ -148,84 +148,84 @@ public:
return m_iBaseControlPoints[iTeam];
}
int GetPreviousPointForPoint( int index_, int team, int iPrevIndex )
int GetPreviousPointForPoint( int index, int team, int iPrevIndex )
{
Assert( index_ < m_iNumControlPoints );
Assert( index < m_iNumControlPoints );
Assert( iPrevIndex >= 0 && iPrevIndex < MAX_PREVIOUS_POINTS );
int iIntIndex = iPrevIndex + (index_ * MAX_PREVIOUS_POINTS) + (team * MAX_CONTROL_POINTS * MAX_PREVIOUS_POINTS);
int iIntIndex = iPrevIndex + (index * MAX_PREVIOUS_POINTS) + (team * MAX_CONTROL_POINTS * MAX_PREVIOUS_POINTS);
return m_iPreviousPoints[ iIntIndex ];
}
bool TeamCanCapPoint( int index_, int team )
bool TeamCanCapPoint( int index, int team )
{
Assert( index_ < m_iNumControlPoints );
return m_bTeamCanCap[ TEAM_ARRAY( index_, team ) ];
Assert( index < m_iNumControlPoints );
return m_bTeamCanCap[ TEAM_ARRAY( index, team ) ];
}
const char *GetCapLayoutInHUD( void ) { return m_pszCapLayoutInHUD; }
void GetCapLayoutCustomPosition( float& flCustomPositionX, float& flCustomPositionY ) { flCustomPositionX = m_flCustomPositionX; flCustomPositionY = m_flCustomPositionY; }
bool PlayingMiniRounds( void ){ return m_bPlayingMiniRounds; }
bool IsInMiniRound( int index_ ) { return m_bInMiniRound[index_]; }
bool IsInMiniRound( int index ) { return m_bInMiniRound[index]; }
int GetCapWarningLevel( int index_ )
int GetCapWarningLevel( int index )
{
Assert( index_ < m_iNumControlPoints );
return m_iWarnOnCap[index_];
Assert( index < m_iNumControlPoints );
return m_iWarnOnCap[index];
}
int GetCPGroup( int index_ )
int GetCPGroup( int index )
{
Assert( index_ < m_iNumControlPoints );
return m_iCPGroup[index_];
Assert( index < m_iNumControlPoints );
return m_iCPGroup[index];
}
const char *GetWarnSound( int index_ )
const char *GetWarnSound( int index )
{
Assert( index_ < m_iNumControlPoints );
return m_iszWarnSound[index_];
Assert( index < m_iNumControlPoints );
return m_iszWarnSound[index];
}
virtual const char *GetGameSpecificCPCappingSwipe( int index_, int iCappingTeam )
virtual const char *GetGameSpecificCPCappingSwipe( int index, int iCappingTeam )
{
// You need to implement this in your game's objective resource.
Assert(0);
return NULL;
}
virtual const char *GetGameSpecificCPBarFG( int index_, int iOwningTeam )
virtual const char *GetGameSpecificCPBarFG( int index, int iOwningTeam )
{
// You need to implement this in your game's objective resource.
Assert(0);
return NULL;
}
virtual const char *GetGameSpecificCPBarBG( int index_, int iCappingTeam )
virtual const char *GetGameSpecificCPBarBG( int index, int iCappingTeam )
{
// You need to implement this in your game's objective resource.
Assert(0);
return NULL;
}
bool CapIsBlocked( int index_ );
bool CapIsBlocked( int index );
int GetTimerToShowInHUD( void ) { return m_iTimerToShowInHUD; }
int GetStopWatchTimer( void ) { return m_iStopWatchTimer; }
float GetPathDistance( int index_ )
float GetPathDistance( int index )
{
Assert( index_ < m_iNumControlPoints );
return m_flPathDistance[index_];
Assert( index < m_iNumControlPoints );
return m_flPathDistance[index];
}
bool GetCPLocked( int index_ )
bool GetCPLocked( int index )
{
Assert( index_ < m_iNumControlPoints );
return m_bCPLocked[index_];
Assert( index < m_iNumControlPoints );
return m_bCPLocked[index];
}
bool GetTrackAlarm( int index_ )
bool GetTrackAlarm( int index )
{
Assert( index_ < TEAM_TRAIN_MAX_TEAMS );
return m_bTrackAlarm[index_];
Assert( index < TEAM_TRAIN_MAX_TEAMS );
return m_bTrackAlarm[index];
}
int GetNumNodeHillData( int team ){ return ( team < TEAM_TRAIN_MAX_TEAMS ) ? m_nNumNodeHillData[team] : 0; }
@@ -234,11 +234,11 @@ public:
{
if ( hill < TEAM_TRAIN_MAX_HILLS && team < TEAM_TRAIN_MAX_TEAMS )
{
int index_ = ( hill * TEAM_TRAIN_FLOATS_PER_HILL ) + ( team * TEAM_TRAIN_MAX_HILLS * TEAM_TRAIN_FLOATS_PER_HILL );
if ( index_ < TEAM_TRAIN_HILLS_ARRAY_SIZE - 1 ) // - 1 because we want to look at 2 entries
int index = ( hill * TEAM_TRAIN_FLOATS_PER_HILL ) + ( team * TEAM_TRAIN_MAX_HILLS * TEAM_TRAIN_FLOATS_PER_HILL );
if ( index < TEAM_TRAIN_HILLS_ARRAY_SIZE - 1 ) // - 1 because we want to look at 2 entries
{
flStart = m_flNodeHillData[index_];
flEnd = m_flNodeHillData[index_ +1];
flStart = m_flNodeHillData[index];
flEnd = m_flNodeHillData[index+1];
}
}
}
@@ -247,8 +247,8 @@ public:
{
if ( team < TEAM_TRAIN_MAX_TEAMS && hill < TEAM_TRAIN_MAX_HILLS )
{
int index_ = hill + ( team * TEAM_TRAIN_MAX_HILLS );
m_bTrainOnHill[index_] = state;
int index = hill + ( team * TEAM_TRAIN_MAX_HILLS );
m_bTrainOnHill[index] = state;
}
}
+9 -4
View File
@@ -163,13 +163,18 @@ void C_TeamTrainWatcher::OnDataChanged( DataUpdateType_t updateType )
int nNumHills = ObjectiveResource()->GetNumNodeHillData( GetTeamNumber() );
if ( nNumHills > 0 )
{
float flStart = 0, flEnd = 0;
float flStart, flEnd;
for ( int i = 0 ; i < nNumHills ; i++ )
{
ObjectiveResource()->GetHillData( GetTeamNumber(), i, flStart, flEnd );
bool state = ( m_flTotalProgress >= flStart && m_flTotalProgress <= flEnd );
ObjectiveResource()->SetTrainOnHill( GetTeamNumber(), i, state );
if ( m_flTotalProgress >= flStart && m_flTotalProgress<= flEnd )
{
ObjectiveResource()->SetTrainOnHill( GetTeamNumber(), i, true );
}
else
{
ObjectiveResource()->SetTrainOnHill( GetTeamNumber(), i, false );
}
}
}
}
+38 -2
View File
@@ -42,6 +42,41 @@ CLIENTEFFECT_REGISTER_BEGIN( PrecacheEffectVGuiScreen )
CLIENTEFFECT_MATERIAL( "engine/writez" )
CLIENTEFFECT_REGISTER_END()
// ----------------------------------------------------------------------------- //
// This is a cache of preloaded keyvalues.
// ----------------------------------------------------------------------------- //
CUtlDict<KeyValues*, int> g_KeyValuesCache;
KeyValues* CacheKeyValuesForFile( const char *pFilename )
{
MEM_ALLOC_CREDIT();
int i = g_KeyValuesCache.Find( pFilename );
if ( i == g_KeyValuesCache.InvalidIndex() )
{
KeyValues *rDat = new KeyValues( pFilename );
rDat->LoadFromFile( filesystem, pFilename, NULL );
g_KeyValuesCache.Insert( pFilename, rDat );
return rDat;
}
else
{
return g_KeyValuesCache[i];
}
}
void ClearKeyValuesCache()
{
MEM_ALLOC_CREDIT();
for ( int i=g_KeyValuesCache.First(); i != g_KeyValuesCache.InvalidIndex(); i=g_KeyValuesCache.Next( i ) )
{
g_KeyValuesCache[i]->deleteThis();
}
g_KeyValuesCache.Purge();
}
IMPLEMENT_CLIENTCLASS_DT(C_VGuiScreen, DT_VGuiScreen, CVGuiScreen)
RecvPropFloat( RECVINFO(m_flWidth) ),
RecvPropFloat( RECVINFO(m_flHeight) ),
@@ -671,7 +706,7 @@ C_BaseEntity *FindNearbyVguiScreen( const Vector &viewPosition, const QAngle &vi
// 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 );
partition->EnumerateElementsInSphere( PARTITION_CLIENT_NON_STATIC_EDICTS, viewPosition, VGUI_SCREEN_MODE_RADIUS, false, &localScreens );
Vector vecOut, vecViewDelta;
@@ -781,7 +816,8 @@ bool CVGuiScreenPanel::Init( KeyValues* pKeyValues, VGuiScreenInitData_t* pInitD
const char *pResFile = pKeyValues->GetString( "resfile" );
if (pResFile[0] != 0)
{
LoadControlSettings( pResFile, NULL, NULL );
KeyValues *pCachedKeyValues = CacheKeyValuesForFile( pResFile );
LoadControlSettings( pResFile, NULL, pCachedKeyValues );
}
// Dimensions in pixels
+4
View File
@@ -179,5 +179,9 @@ void DeactivateVguiScreen( C_BaseEntity *pVguiScreen );
void SetVGuiScreenButtonState( C_BaseEntity *pVguiScreen, int nButtonState );
// Called at shutdown.
void ClearKeyValuesCache();
#endif // C_VGUISCREEN_H
+6 -8
View File
@@ -81,10 +81,10 @@ C_VoteController::~C_VoteController()
void C_VoteController::ResetData()
{
m_iActiveIssueIndex = INVALID_ISSUE;
m_iOnlyTeamToVote = TEAM_UNASSIGNED;
for( int i = 0; i < MAX_VOTE_OPTIONS; i++ )
m_iOnlyTeamToVote = TEAM_INVALID;
for( int index = 0; index < MAX_VOTE_OPTIONS; index++ )
{
m_nVoteOptionCount[i] = 0;
m_nVoteOptionCount[index] = 0;
}
m_nPotentialVotes = 0;
m_bVotesDirty = false;
@@ -118,24 +118,22 @@ void C_VoteController::ClientThink()
{
if ( m_nPotentialVotes > 0 )
{
#ifdef STAGING_ONLY
// Currently hard-coded to MAX_VOTE_COUNT options per issue
DevMsg( "Votes: Option1 - %d, Option2 - %d, Option3 - %d, Option4 - %d, Option5 - %d\n",
m_nVoteOptionCount[0], m_nVoteOptionCount[1], m_nVoteOptionCount[2], m_nVoteOptionCount[3], m_nVoteOptionCount[4] );
#endif // STAGING_ONLY
IGameEvent *event = gameeventmanager->CreateEvent( "vote_changed" );
if ( event )
{
for ( int i = 0; i < MAX_VOTE_OPTIONS; i++ )
for ( int index = 0; index < MAX_VOTE_OPTIONS; index++ )
{
char szOption[2];
Q_snprintf( szOption, sizeof( szOption ), "%i", i + 1 );
Q_snprintf( szOption, sizeof( szOption ), "%i", index + 1 );
char szVoteOption[13] = "vote_option";
Q_strncat( szVoteOption, szOption, sizeof( szVoteOption ), COPY_ALL_CHARACTERS );
event->SetInt( szVoteOption, m_nVoteOptionCount[i] );
event->SetInt( szVoteOption, m_nVoteOptionCount[index] );
}
event->SetInt( "potentialVotes", m_nPotentialVotes );
gameeventmanager->FireEventClientSide( event );
-1
View File
@@ -20,7 +20,6 @@ struct studiohdr_t;
#include <tier0/dbg.h>
#include <tier1/strtools.h>
#include <tier1/fmtstr.h>
#include <vstdlib/random.h>
#include <utlvector.h>
+3 -3
View File
@@ -66,7 +66,7 @@ public:
CBoundedCvar_InterpRatio() :
ConVar_ServerBounded( "cl_interp_ratio",
"2.0",
FCVAR_USERINFO | FCVAR_NOT_CONNECTED | FCVAR_ARCHIVE,
FCVAR_USERINFO | FCVAR_NOT_CONNECTED,
"Sets the interpolation amount (final amount is cl_interp_ratio / cl_updaterate)." )
{
}
@@ -100,7 +100,7 @@ public:
CBoundedCvar_Interp() :
ConVar_ServerBounded( "cl_interp",
"0.1",
FCVAR_USERINFO | FCVAR_NOT_CONNECTED | FCVAR_ARCHIVE,
FCVAR_USERINFO | FCVAR_NOT_CONNECTED,
"Sets the interpolation amount (bounded on low side by server interp ratio settings).", true, 0.0f, true, 0.5f )
{
}
@@ -133,7 +133,7 @@ float GetClientInterpAmount()
}
else
{
if ( !HushAsserts() )
if (!CommandLine()->FindParm("-hushasserts"))
{
AssertMsgOnce( false, "GetInterpolationAmount: can't get cl_updaterate cvar." );
}
+51 -62
View File
@@ -117,7 +117,6 @@
#include "tf_hud_disconnect_prompt.h"
#include "../engine/audio/public/sound.h"
#include "tf_shared_content_manager.h"
#include "tf_gamerules.h"
#endif
#include "clientsteamcontext.h"
#include "renamed_recvtable_compat.h"
@@ -125,8 +124,6 @@
#include "sourcevr/isourcevirtualreality.h"
#include "client_virtualreality.h"
#include "mumble.h"
#include "vgui_controls/BuildGroup.h"
#include "touch.h"
// NVNT includes
#include "hud_macros.h"
@@ -144,13 +141,14 @@
#if defined( TF_CLIENT_DLL )
#include "econ/tool_items/custom_texture_cache.h"
#endif
#ifdef WORKSHOP_IMPORT_ENABLED
#include "fbxsystem/fbxsystem.h"
#endif
#include "touch.h"
extern vgui::IInputInternal *g_InputInternal;
//=============================================================================
@@ -572,8 +570,7 @@ void DisplayBoneSetupEnts()
if ( pEnt->m_Count >= 3 )
{
printInfo.color[0] = 1;
printInfo.color[1] = 0;
printInfo.color[2] = 0;
printInfo.color[1] = printInfo.color[2] = 0;
}
else if ( pEnt->m_Count == 2 )
{
@@ -583,9 +580,7 @@ void DisplayBoneSetupEnts()
}
else
{
printInfo.color[0] = 1;
printInfo.color[1] = 1;
printInfo.color[2] = 1;
printInfo.color[0] = printInfo.color[0] = printInfo.color[0] = 1;
}
engine->Con_NXPrintf( &printInfo, "%25s / %3d / %3d", pEnt->m_ModelName, pEnt->m_Count, pEnt->m_Index );
printInfo.index++;
@@ -730,12 +725,12 @@ public:
// Returns true if the disconnect command has been handled by the client
virtual bool DisconnectAttempt( void );
public:
void PrecacheMaterial( const char *pMaterialName );
virtual bool IsConnectedUserInfoChangeAllowed( IConVar *pCvar );
virtual void IN_TouchEvent( uint data, uint data2, uint data3, uint data4 );
private:
void UncacheAllMaterials( );
void ResetStringTablePointers();
@@ -906,7 +901,7 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
return false;
if ( (networkstringtable = (INetworkStringTableContainer *)appSystemFactory(INTERFACENAME_NETWORKSTRINGTABLECLIENT,NULL)) == NULL )
return false;
if ( (::partition = (ISpatialPartition *)appSystemFactory(INTERFACEVERSION_SPATIALPARTITION, NULL)) == NULL )
if ( (partition = (ISpatialPartition *)appSystemFactory(INTERFACEVERSION_SPATIALPARTITION, NULL)) == NULL )
return false;
if ( (shadowmgr = (IShadowMgr *)appSystemFactory(ENGINE_SHADOWMGR_INTERFACE_VERSION, NULL)) == NULL )
return false;
@@ -956,7 +951,6 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
#endif
// it's ok if this is NULL. That just means the sourcevr.dll wasn't found
if ( CommandLine()->CheckParm( "-vr" ) )
g_pSourceVR = (ISourceVirtualReality *)appSystemFactory(SOURCE_VIRTUAL_REALITY_INTERFACE_VERSION, NULL);
factorylist_t factories;
@@ -1040,7 +1034,6 @@ int CHLClient::Init( CreateInterfaceFn appSystemFactory, CreateInterfaceFn physi
g_pClientMode->InitViewport();
gHUD.Init();
gTouch.Init();
g_pClientMode->Init();
@@ -1210,7 +1203,7 @@ void CHLClient::Shutdown( void )
ParticleMgr()->Term();
vgui::BuildGroup::ClearResFileCache();
ClearKeyValuesCache();
#ifndef NO_STEAM
ClientSteamContext().Shutdown();
@@ -1424,28 +1417,6 @@ int CHLClient::IN_KeyEvent( int eventcode, ButtonCode_t keynum, const char *pszC
return input->KeyEvent( eventcode, keynum, pszCurrentBinding );
}
void CHLClient::IN_TouchEvent( uint data, uint data2, uint data3, uint data4 )
{
if( enginevgui->IsGameUIVisible() )
return;
touch_event_t ev;
ev.type = data & 0xFFFF;
ev.fingerid = (data >> 16) & 0xFFFF;
ev.x = (double)((data2 >> 16) & 0xFFFF) / 0xFFFF;
ev.y = (double)(data2 & 0xFFFF) / 0xFFFF;
union{uint i;float f;} ifconv;
ifconv.i = data3;
ev.dx = ifconv.f;
ifconv.i = data4;
ev.dy = ifconv.f;
gTouch.ProcessEvent( &ev );
}
void CHLClient::ExtraMouseSample( float frametime, bool active )
{
Assert( C_BaseEntity::IsAbsRecomputationsEnabled() );
@@ -1779,10 +1750,10 @@ void CHLClient::LevelShutdown( void )
//-----------------------------------------------------------------------------
void CHLClient::SetCrosshairAngle( const QAngle& angle )
{
CHudCrosshair *pCrosshair = GET_HUDELEMENT( CHudCrosshair );
if ( pCrosshair )
CHudCrosshair *crosshair = GET_HUDELEMENT( CHudCrosshair );
if ( crosshair )
{
pCrosshair->SetCrosshairAngle( angle );
crosshair->SetCrosshairAngle( angle );
}
}
@@ -2139,11 +2110,10 @@ void OnRenderStart()
g_pPortalRender->UpdatePortalPixelVisibility(); //updating this one or two lines before querying again just isn't cutting it. Update as soon as it's cheap to do so.
#endif
::partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, true );
partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, true );
C_BaseEntity::SetAbsQueriesValid( false );
Rope_ResetCounters();
UpdateLocalPlayerVisionFlags();
// Interpolate server entities and move aiments.
{
@@ -2183,7 +2153,7 @@ void OnRenderStart()
// This will place all entities in the correct position in world space and in the KD-tree
C_BaseAnimating::UpdateClientSideAnimations();
::partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, false );
partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, false );
// Process OnDataChanged events.
ProcessOnDataChangedEvents();
@@ -2296,7 +2266,7 @@ void CHLClient::FrameStageNotify( ClientFrameStage_t curStage )
C_BaseEntity::EnableAbsRecomputations( false );
C_BaseEntity::SetAbsQueriesValid( false );
Interpolation_SetLastPacketTimeStamp( engine->GetLastTimeStamp() );
::partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, true );
partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, true );
PREDICTION_STARTTRACKVALUE( "netupdate" );
}
@@ -2308,7 +2278,7 @@ void CHLClient::FrameStageNotify( ClientFrameStage_t curStage )
// reenable abs recomputation since now all entities have been updated
C_BaseEntity::EnableAbsRecomputations( true );
C_BaseEntity::SetAbsQueriesValid( true );
::partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, false );
partition->SuppressLists( PARTITION_ALL_CLIENT_EDICTS, false );
PREDICTION_ENDTRACKVALUE();
}
@@ -2470,18 +2440,10 @@ bool CHLClient::CanRecordDemo( char *errorMsg, int length ) const
void CHLClient::OnDemoRecordStart( char const* pDemoBaseName )
{
if ( GetClientModeNormal() )
{
return GetClientModeNormal()->OnDemoRecordStart( pDemoBaseName );
}
}
void CHLClient::OnDemoRecordStop()
{
if ( GetClientModeNormal() )
{
return GetClientModeNormal()->OnDemoRecordStop();
}
}
void CHLClient::OnDemoPlaybackStart( char const* pDemoBaseName )
@@ -2604,22 +2566,26 @@ void CHLClient::ClientAdjustStartSoundParams( StartSoundParams_t& params )
// Halloween voice futzery?
else
{
float flVoicePitchScale = 1.f;
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pEntity, flVoicePitchScale, voice_pitch_scale );
float flHeadScale = 1.f;
CALL_ATTRIB_HOOK_FLOAT_ON_OTHER( pEntity, flHeadScale, head_scale );
int iHalloweenVoiceSpell = 0;
if ( TF_IsHolidayActive( kHoliday_HalloweenOrFullMoon ) )
{
CALL_ATTRIB_HOOK_INT_ON_OTHER( pEntity, iHalloweenVoiceSpell, halloween_voice_modulation );
}
if ( iHalloweenVoiceSpell > 0 )
{
params.pitch *= 0.8f;
}
else if( flVoicePitchScale != 1.f )
else if( flHeadScale != 1.f )
{
params.pitch *= flVoicePitchScale;
// Big head, deep voice
if( flHeadScale > 1.f )
{
params.pitch *= 0.8f;
}
else // Small head, high voice
{
params.pitch *= 1.3f;
}
}
}
}
@@ -2661,7 +2627,7 @@ CSteamID GetSteamIDForPlayerIndex( int iPlayerIndex )
{
if ( pi.friendsID )
{
return CSteamID( pi.friendsID, 1, GetUniverse(), k_EAccountTypeIndividual );
return CSteamID( pi.friendsID, 1, steamapicontext->SteamUtils()->GetConnectedUniverse(), k_EAccountTypeIndividual );
}
}
}
@@ -2669,3 +2635,26 @@ CSteamID GetSteamIDForPlayerIndex( int iPlayerIndex )
}
#endif
void CHLClient::IN_TouchEvent( uint data, uint data2, uint data3, uint data4 )
{
if( enginevgui->IsGameUIVisible() )
return;
touch_event_t ev;
ev.type = data & 0xFFFF;
ev.fingerid = (data >> 16) & 0xFFFF;
ev.x = (double)((data2 >> 16) & 0xFFFF) / 0xFFFF;
ev.y = (double)(data2 & 0xFFFF) / 0xFFFF;
union{uint i;float f;} ifconv;
ifconv.i = data3;
ev.dx = ifconv.f;
ifconv.i = data4;
ev.dy = ifconv.f;
gTouch.ProcessEvent( &ev );
}
+52 -48
View File
@@ -27,7 +27,6 @@
#include <vgui/ILocalize.h>
#include "view.h"
#include "ixboxsystem.h"
#include "inputsystem/iinputsystem.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
@@ -83,24 +82,14 @@ int GetLocalPlayerIndex( void )
return 0; // game not started yet
}
// NOTE: cache these because this gets executed hundreds of times per frame
static int g_nLocalPlayerVisionFlagsWeaponsCheck = 0;
static int g_nLocalPlayerVisionFlags = 0;
int GetLocalPlayerVisionFilterFlags( bool bWeaponsCheck /*= false */ )
{
return bWeaponsCheck ? g_nLocalPlayerVisionFlagsWeaponsCheck : g_nLocalPlayerVisionFlags;
}
C_BasePlayer * player = C_BasePlayer::GetLocalPlayer();
void UpdateLocalPlayerVisionFlags()
{
g_nLocalPlayerVisionFlagsWeaponsCheck = 0;
g_nLocalPlayerVisionFlags = 0;
C_BasePlayer *pPlayer = C_BasePlayer::GetLocalPlayer();
if ( pPlayer )
{
g_nLocalPlayerVisionFlagsWeaponsCheck = pPlayer->GetVisionFilterFlags( true );
g_nLocalPlayerVisionFlags = pPlayer->GetVisionFilterFlags( false );
}
if ( player )
return player->GetVisionFilterFlags( bWeaponsCheck );
else
return 0;
}
bool IsLocalPlayerUsingVisionFilterFlags( int nFlags, bool bWeaponsCheck /* = false */ )
@@ -674,7 +663,7 @@ IterationRetval_t CFlaggedEntitiesEnum::EnumElement( IHandleEntity *pHandleEntit
int UTIL_EntitiesInBox( C_BaseEntity **pList, int listMax, const Vector &mins, const Vector &maxs, int flagMask, int partitionMask )
{
CFlaggedEntitiesEnum boxEnum( pList, listMax, flagMask );
::partition->EnumerateElementsInBox( partitionMask, mins, maxs, false, &boxEnum );
partition->EnumerateElementsInBox( partitionMask, mins, maxs, false, &boxEnum );
return boxEnum.GetCount();
@@ -692,7 +681,7 @@ int UTIL_EntitiesInBox( C_BaseEntity **pList, int listMax, const Vector &mins, c
int UTIL_EntitiesInSphere( C_BaseEntity **pList, int listMax, const Vector &center, float radius, int flagMask, int partitionMask )
{
CFlaggedEntitiesEnum sphereEnum( pList, listMax, flagMask );
::partition->EnumerateElementsInSphere( partitionMask, center, radius, false, &sphereEnum );
partition->EnumerateElementsInSphere( partitionMask, center, radius, false, &sphereEnum );
return sphereEnum.GetCount();
@@ -709,7 +698,7 @@ int UTIL_EntitiesInSphere( C_BaseEntity **pList, int listMax, const Vector &cent
int UTIL_EntitiesAlongRay( C_BaseEntity **pList, int listMax, const Ray_t &ray, int flagMask, int partitionMask )
{
CFlaggedEntitiesEnum rayEnum( pList, listMax, flagMask );
::partition->EnumerateElementsAlongRay( partitionMask, ray, false, &rayEnum );
partition->EnumerateElementsAlongRay( partitionMask, ray, false, &rayEnum );
return rayEnum.GetCount();
}
@@ -727,6 +716,48 @@ CBaseEntity *CEntitySphereQuery::GetCurrentEntity()
return NULL;
}
//-----------------------------------------------------------------------------
// Purpose: Slightly modified strtok. Does not modify the input string. Does
// not skip over more than one separator at a time. This allows parsing
// strings where tokens between separators may or may not be present:
//
// Door01,,,0 would be parsed as "Door01" "" "" "0"
// Door01,Open,,0 would be parsed as "Door01" "Open" "" "0"
//
// Input : token - Returns with a token, or zero length if the token was missing.
// str - String to parse.
// sep - Character to use as separator. UNDONE: allow multiple separator chars
// Output : Returns a pointer to the next token to be parsed.
//-----------------------------------------------------------------------------
const char *nexttoken(char *token, const char *str, char sep)
{
if ((str == NULL) || (*str == '\0'))
{
*token = '\0';
return(NULL);
}
//
// Copy everything up to the first separator into the return buffer.
// Do not include separators in the return buffer.
//
while ((*str != sep) && (*str != '\0'))
{
*token++ = *str++;
}
*token = '\0';
//
// Advance the pointer unless we hit the end of the input string.
//
if (*str == '\0')
{
return(str);
}
return(++str);
}
//-----------------------------------------------------------------------------
// Purpose:
// Input : font -
@@ -860,12 +891,8 @@ const char * UTIL_SafeName( const char *oldName )
// for consistency with other APIs. If inbufsizebytes is 0 a NULL-terminated
// input buffer is assumed, or you can pass the size of the input buffer if
// not NULL-terminated.
//
// If actionset is other than GAME_ACTION_SET_NONE (the default), then a lookup is first
// attempted for a Steam Controller binding in the given action set. If none if found, fallback
// is to the usual keyboard binding path.
//-----------------------------------------------------------------------------
void UTIL_ReplaceKeyBindings( const wchar_t *inbuf, int inbufsizebytes, OUT_Z_BYTECAP(outbufsizebytes) wchar_t *outbuf, int outbufsizebytes, GameActionSet_t actionset )
void UTIL_ReplaceKeyBindings( const wchar_t *inbuf, int inbufsizebytes, OUT_Z_BYTECAP(outbufsizebytes) wchar_t *outbuf, int outbufsizebytes )
{
Assert( outbufsizebytes >= sizeof(outbuf[0]) );
// copy to a new buf if there are vars
@@ -901,18 +928,6 @@ void UTIL_ReplaceKeyBindings( const wchar_t *inbuf, int inbufsizebytes, OUT_Z_BY
char binding[64];
g_pVGuiLocalize->ConvertUnicodeToANSI( token, binding, sizeof(binding) );
// Find a Steam Controller mapping, if an action set was specified.
const wchar_t* sc_origin = nullptr;
if ( actionset != GAME_ACTION_SET_NONE)
{
auto origin = g_pInputSystem->GetSteamControllerActionOrigin( *binding == '+' ? binding + 1 : binding, actionset );
if ( origin != k_EControllerActionOrigin_None )
{
sc_origin = g_pInputSystem->GetSteamControllerDescriptionForActionOrigin( origin );
}
}
// Find also the keyboard mapping
const char *key = engine->Key_LookupBinding( *binding == '+' ? binding + 1 : binding );
if ( !key )
{
@@ -940,18 +955,7 @@ void UTIL_ReplaceKeyBindings( const wchar_t *inbuf, int inbufsizebytes, OUT_Z_BY
}
Q_strupr( friendlyName );
const wchar_t* locName = nullptr;
// If we got a Steam Controller key description, use that, otherwise use the (possibly localized) key name
if ( sc_origin )
{
locName = sc_origin;
}
else
{
locName = g_pVGuiLocalize->Find( friendlyName );
}
wchar_t *locName = g_pVGuiLocalize->Find( friendlyName );
if ( !locName || wcslen(locName) <= 0)
{
g_pVGuiLocalize->ConvertANSIToUnicode( friendlyName, token, sizeof(token) );
+3 -3
View File
@@ -21,7 +21,6 @@
#include "bitmap/imageformat.h"
#include "ispatialpartition.h"
#include "materialsystem/MaterialSystemUtil.h"
#include "inputsystem/InputEnums.h"
class Vector;
class QAngle;
@@ -67,7 +66,7 @@ byte *UTIL_LoadFileForMe( const char *filename, int *pLength );
void UTIL_FreeFile( byte *buffer );
void UTIL_MakeSafeName( const char *oldName, OUT_Z_CAP(newNameBufSize) char *newName, int newNameBufSize ); ///< Cleans up player names for putting in vgui controls (cleaned names can be up to original*2+1 in length)
const char *UTIL_SafeName( const char *oldName ); ///< Wraps UTIL_MakeSafeName, and returns a static buffer
void UTIL_ReplaceKeyBindings( const wchar_t *inbuf, int inbufsizebytes, OUT_Z_BYTECAP(outbufsizebytes) wchar_t *outbuf, int outbufsizebytes, GameActionSet_t action_set = GAME_ACTION_SET_NONE );
void UTIL_ReplaceKeyBindings( const wchar_t *inbuf, int inbufsizebytes, OUT_Z_BYTECAP(outbufsizebytes) wchar_t *outbuf, int outbufsizebytes );
// Fade out an entity based on distance fades
unsigned char UTIL_ComputeEntityFade( C_BaseEntity *pEntity, float flMinDist, float flMaxDist, float flFadeScale );
@@ -81,7 +80,6 @@ char *VarArgs( PRINTF_FORMAT_STRING const char *format, ... );
int GetSpectatorTarget();
int GetSpectatorMode( void );
bool IsPlayerIndex( int index );
void UpdateLocalPlayerVisionFlags();
int GetLocalPlayerIndex( void );
int GetLocalPlayerVisionFilterFlags( bool bWeaponsCheck = false );
bool IsLocalPlayerUsingVisionFilterFlags( int nFlags, bool bWeaponsCheck = false );
@@ -91,6 +89,8 @@ void NormalizeAngles( QAngle& angles );
void InterpolateAngles( const QAngle& start, const QAngle& end, QAngle& output, float frac );
void InterpolateVector( float frac, const Vector& src, const Vector& dest, Vector& output );
const char *nexttoken(char *token, const char *str, char sep);
//-----------------------------------------------------------------------------
// Base light indices to avoid index collision
//-----------------------------------------------------------------------------
+18 -19
View File
@@ -22,8 +22,8 @@ $Configuration "Debug"
{
$General
{
$OutputDirectory ".\Debug_$GAMENAME" [$WINDOWS]
$IntermediateDirectory ".\Debug_$GAMENAME" [$WINDOWS]
$OutputDirectory ".\Debug_$GAMENAME" [$WIN32]
$IntermediateDirectory ".\Debug_$GAMENAME" [$WIN32]
$OutputDirectory ".\Debug_$GAMENAME_360" [$X360]
$IntermediateDirectory ".\Debug_$GAMENAME_360" [$X360]
@@ -34,9 +34,8 @@ $Configuration "Release"
{
$General
{
// Windows generator doesn't sandbox these directories per configuration but others do :-/
$OutputDirectory ".\Release_$GAMENAME" [$WINDOWS]
$IntermediateDirectory ".\Release_$GAMENAME" [$WINDOWS]
$OutputDirectory ".\Release_$GAMENAME" [$WIN32]
$IntermediateDirectory ".\Release_$GAMENAME" [$WIN32]
$OutputDirectory ".\Release_$GAMENAME_360" [$X360]
$IntermediateDirectory ".\Release_$GAMENAME_360" [$X360]
@@ -47,16 +46,17 @@ $Configuration
{
$General
{
$OutputDirectory ".\$GAMENAME"
$IntermediateDirectory ".\$GAMENAME"
$OutputDirectory ".\$GAMENAME" [$OSXALL]
}
$Compiler
{
$AdditionalIncludeDirectories ".\;$BASE;$SRCDIR\vgui2\include;$SRCDIR\vgui2\controls;$SRCDIR\game\shared;.\game_controls;$SRCDIR\thirdparty\sixensesdk\include"
$PreprocessorDefinitions "$BASE;NO_STRING_T;CLIENT_DLL;VECTOR;VERSION_SAFE_STEAM_API_INTERFACES;PROTECTED_THINGS_ENABLE;strncpy=use_Q_strncpy_instead;_snprintf=use_Q_snprintf_instead"
$PreprocessorDefinitions "$BASE;fopen=dont_use_fopen" [$WIN32]
$PreprocessorDefinitions "$BASE;USE_WEBM_FOR_REPLAY;" [$LINUXALL]
$PreprocessorDefinitions "$BASE;ENABLE_CHROMEHTMLWINDOW;fopen=dont_use_fopen" [$WIN32]
$PreprocessorDefinitions "$BASE;ENABLE_CHROMEHTMLWINDOW;" [$OSXALL]
$PreprocessorDefinitions "$BASE;ENABLE_CHROMEHTMLWINDOW;USE_WEBM_FOR_REPLAY;" [$LINUXALL]
$PreprocessorDefinitions "$BASE;CURL_STATICLIB" [$WIN32 && $BUILD_REPLAY]
$Create/UsePrecompiledHeader "Use Precompiled Header (/Yu)"
$Create/UsePCHThroughFile "cbase.h"
$PrecompiledHeaderFile "$(IntDir)/client.pch"
@@ -69,7 +69,7 @@ $Configuration
$SystemLibraries "rt" [$LINUXALL]
$IgnoreImportLibrary "TRUE"
$AdditionalDependencies "$BASE winmm.lib" [$WIN32]
$AdditionalDependencies "$BASE wsock32.lib Ws2_32.lib" [$BUILD_REPLAY&&$WIN32]
$AdditionalDependencies "$BASE wsock32.lib Ws2_32.lib" [$BUILD_REPLAY]
}
}
@@ -101,9 +101,6 @@ $Project
$File "$SRCDIR\game\shared\replay_gamestats_shared.cpp" [$BUILD_REPLAY]
$File "$SRCDIR\game\shared\replay_gamestats_shared.h" [$BUILD_REPLAY]
$File "$SRCDIR\game\client\youtubeapi.h" [$BUILD_REPLAY]
$File "$SRCDIR\game\client\youtubeapi.cpp" [$BUILD_REPLAY]
{
$Configuration
{
$Compiler
@@ -149,10 +146,6 @@ $Project
$File "replay\vgui\replayrenderoverlay.h"
$File "replay\vgui\replayreminderpanel.cpp"
$File "replay\vgui\replayreminderpanel.h"
$File "replay\replayyoutubeapi.cpp"
$File "replay\replayyoutubeapi.h"
$File "replay\replayyoutubeapi_key.cpp" [!$SOURCESDK]
$File "replay\replayyoutubeapi_key_sdk.cpp" [$SOURCESDK]
$File "game_controls\slideshowpanel.cpp"
$File "game_controls\slideshowpanel.h"
@@ -373,7 +366,6 @@ $Project
$File "in_camera.cpp"
$File "in_joystick.cpp"
$File "in_main.cpp"
$File "in_steamcontroller.cpp"
$File "initializer.cpp"
$File "interpolatedvar.cpp"
$File "IsNPCProxy.cpp"
@@ -533,7 +525,6 @@ $Project
"$SRCDIR\common\language.cpp" \
"$SRCDIR\public\networkvar.cpp" \
"$SRCDIR\common\randoverride.cpp" \
"$SRCDIR\common\steamid.cpp" \
"$SRCDIR\public\rope_physics.cpp" \
"$SRCDIR\public\scratchpad3d.cpp" \
"$SRCDIR\public\ScratchPadUtils.cpp" \
@@ -1255,9 +1246,17 @@ $Project
$Lib vtf
$ImpLib steam_api
$Lib $LIBCOMMON/libcrypto [$POSIX]
$ImpLib "$LIBCOMMON\curl" [$OSXALL]
$Lib "$LIBCOMMON\libcurl" [$WIN32]
$Lib "libz" [$WIN32]
$Libexternal libz [$LINUXALL]
$Libexternal "$LIBCOMMON/libcurl" [$LINUXALL]
$Libexternal "$LIBCOMMON/libcurlssl" [$LINUXALL]
$Libexternal "$LIBCOMMON/libssl" [$LINUXALL]
}
}
-275
View File
@@ -1,275 +0,0 @@
//-----------------------------------------------------------------------------
// CLIENT_CSTRIKE.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Macro SRCDIR "..\.."
$Macro GAMENAME "cstrike"
$Include "$SRCDIR\game\client\client_base.vpc"
$Configuration
{
$Compiler
{
$AdditionalIncludeDirectories "$BASE;$SRCDIR\game\shared\cstrike\control,.\cstrike,.\cstrike\control,.\cstrike\VGUI,$SRCDIR\game\shared\cstrike"
$PreprocessorDefinitions "$BASE;CSTRIKE_DLL;NEXT_BOT"
}
}
$Project "Client (CStrike)"
{
$Folder "Replay"
{
$File "cstrike\cs_replay.cpp"
$File "cstrike\cs_replay.h"
}
$Folder "Source Files"
{
-$File "$SRCDIR\game\shared\weapon_parse_default.cpp"
$File "c_team_objectiveresource.cpp"
$File "c_team_objectiveresource.h"
$File "c_team_train_watcher.cpp"
$File "c_team_train_watcher.h"
$File "hud_base_account.cpp"
$File "hud_base_account.h"
$File "hud_voicestatus.cpp"
$File "hud_baseachievement_tracker.cpp"
$File "hud_baseachievement_tracker.h"
$File "$SRCDIR\game\client\hud_vote.h"
$File "$SRCDIR\game\client\hud_vote.cpp"
$File "$SRCDIR\game\shared\predicted_viewmodel.cpp"
$File "$SRCDIR\game\shared\predicted_viewmodel.h"
$Folder "CounterStrike DLL"
{
$File "$SRCDIR\game\shared\cstrike\cs_achievement_constants.h"
$File "$SRCDIR\game\shared\cstrike\cs_achievementdefs.h"
$File "$SRCDIR\game\shared\cs_achievements_and_stats_interface.cpp"
$File "$SRCDIR\game\shared\cs_achievements_and_stats_interface.h"
$File "$SRCDIR\game\shared\cstrike\achievements_cs.cpp"
$File "$SRCDIR\game\shared\cstrike\achievements_cs.h"
$File "$SRCDIR\game\shared\cstrike\basecsgrenade_projectile.cpp"
$File "$SRCDIR\game\shared\cstrike\basecsgrenade_projectile.h"
$File "cstrike\buy_presets\buy_preset.cpp"
$File "cstrike\buy_presets\buy_preset_debug.cpp"
$File "cstrike\buy_presets\buy_preset_debug.h"
$File "cstrike\buy_presets\buy_preset_weapon_info.cpp"
$File "cstrike\buy_presets\buy_presets.cpp"
$File "cstrike\buy_presets\buy_presets.h"
$File "cstrike\c_cs_hostage.cpp"
$File "cstrike\c_cs_hostage.h"
$File "cstrike\c_cs_player.cpp"
$File "cstrike\c_cs_player.h"
$File "cstrike\c_cs_playerresource.cpp"
$File "cstrike\c_cs_playerresource.h"
$File "cstrike\c_cs_team.cpp"
$File "cstrike\c_cs_team.h"
$File "cstrike\c_csrootpanel.cpp"
$File "cstrike\c_csrootpanel.h"
$File "cstrike\c_plantedc4.cpp"
$File "cstrike\c_plantedc4.h"
$File "cstrike\c_te_radioicon.cpp"
$File "cstrike\c_te_shotgun_shot.cpp"
$File "cstrike\clientmode_csnormal.cpp"
$File "cstrike\clientmode_csnormal.h"
$File "$SRCDIR\game\shared\cstrike\cs_ammodef.cpp"
$File "$SRCDIR\game\shared\cstrike\cs_ammodef.h"
$File "$SRCDIR\game\shared\cstrike\cs_gamemovement.cpp"
$File "$SRCDIR\game\shared\cstrike\cs_gamerules.cpp"
$File "$SRCDIR\game\shared\cstrike\cs_gamerules.h"
$File "$SRCDIR\game\shared\cstrike\cs_gamestats_shared.cpp"
$File "$SRCDIR\game\shared\cstrike\cs_gamestats_shared.h"
$File "$SRCDIR\game\shared\steamworks_gamestats.cpp"
$File "$SRCDIR\game\shared\steamworks_gamestats.h"
$File "cstrike\cs_in_main.cpp"
$File "$SRCDIR\game\shared\cstrike\cs_player_shared.cpp"
$File "$SRCDIR\game\shared\cstrike\cs_playeranimstate.cpp"
$File "$SRCDIR\game\shared\cstrike\cs_playeranimstate.h"
$File "cstrike\cs_prediction.cpp"
$File "$SRCDIR\game\shared\cstrike\cs_shareddefs.cpp"
$File "cstrike\cs_client_gamestats.cpp"
$File "cstrike\cs_client_gamestats.h"
$File "$SRCDIR\game\shared\cstrike\cs_usermessages.cpp"
$File "cstrike\cs_view_scene.cpp"
$File "cstrike\cs_view_scene.h"
$File "$SRCDIR\game\shared\cstrike\cs_weapon_parse.cpp"
$File "$SRCDIR\game\shared\cstrike\cs_weapon_parse.h"
$File "cstrike\fx_cs_blood.cpp"
$File "cstrike\fx_cs_blood.h"
$File "cstrike\fx_cs_impacts.cpp"
$File "cstrike\fx_cs_knifeslash.cpp"
$File "cstrike\fx_cs_muzzleflash.cpp"
$File "$SRCDIR\game\shared\cstrike\fx_cs_shared.cpp"
$File "$SRCDIR\game\shared\cstrike\fx_cs_shared.h"
$File "cstrike\fx_cs_weaponfx.cpp"
$File "$SRCDIR\game\shared\cstrike\bot\shared_util.cpp"
$File "$SRCDIR\game\shared\cstrike\bot\shared_util.h"
$File "cstrike\vgui_rootpanel_cs.cpp"
$Folder "HUD Elements"
{
$File "cstrike\cs_hud_ammo.cpp"
$File "cstrike\cs_hud_chat.cpp"
$File "cstrike\cs_hud_chat.h"
$File "cstrike\cs_hud_damageindicator.cpp"
$File "cstrike\cs_hud_freezepanel.cpp"
$File "cstrike\cs_hud_freezepanel.h"
$File "cstrike\cs_hud_playerhealth.cpp"
$File "cstrike\cs_hud_playerhealth.h"
$File "cstrike\cs_hud_health.cpp"
$File "cstrike\cs_hud_scope.cpp"
$File "cstrike\cs_hud_target_id.cpp"
$File "cstrike\cs_hud_weaponselection.cpp"
$File "cstrike\hud_account.cpp"
$File "cstrike\hud_armor.cpp"
$File "cstrike\hud_c4.cpp"
$File "cstrike\hud_deathnotice.cpp"
$File "cstrike\hud_defuser.cpp"
$File "cstrike\hud_flashbang.cpp"
$File "cstrike\hud_hostagerescue.cpp"
$File "cstrike\hud_progressbar.cpp"
$File "cstrike\hud_radar.cpp"
$File "cstrike\hud_radar.h"
$File "cstrike\hud_roundtimer.cpp"
$File "cstrike\hud_scenarioicon.cpp"
$File "cstrike\hud_shopping_cart.cpp"
$File "cstrike\cs_hud_achievement_announce.cpp"
$File "cstrike\cs_hud_achievement_announce.h"
$File "cstrike\cs_hud_achievement_tracker.cpp"
$File "cstrike\radio_status.cpp"
$File "cstrike\radio_status.h"
}
$Folder "Weapon"
{
$File "$SRCDIR\game\shared\cstrike\weapon_ak47.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_aug.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_awp.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_basecsgrenade.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_basecsgrenade.h"
$File "$SRCDIR\game\shared\cstrike\weapon_c4.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_c4.h"
$File "$SRCDIR\game\shared\cstrike\weapon_csbase.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_csbase.h"
$File "$SRCDIR\game\shared\cstrike\weapon_csbasegun.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_csbasegun.h"
$File "$SRCDIR\game\shared\cstrike\weapon_deagle.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_elite.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_famas.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_fiveseven.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_flashbang.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_flashbang.h"
$File "$SRCDIR\game\shared\cstrike\weapon_g3sg1.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_galil.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_glock.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_hegrenade.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_hegrenade.h"
$File "$SRCDIR\game\shared\cstrike\weapon_knife.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_knife.h"
$File "$SRCDIR\game\shared\cstrike\weapon_m249.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_m3.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_m4a1.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_mac10.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_mp5navy.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_p228.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_p90.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_scout.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_sg550.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_sg552.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_smokegrenade.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_smokegrenade.h"
$File "$SRCDIR\game\shared\cstrike\weapon_tmp.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_ump45.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_usp.cpp"
$File "$SRCDIR\game\shared\cstrike\weapon_xm1014.cpp"
}
$Folder "vgui"
{
$File "cstrike\VGUI\achievement_stats_summary.cpp"
$File "cstrike\VGUI\achievement_stats_summary.h"
$File "cstrike\VGUI\achievements_page.cpp"
$File "cstrike\VGUI\achievements_page.h"
$File "cstrike\VGUI\stats_summary.cpp"
$File "cstrike\VGUI\stats_summary.h"
$File "cstrike\VGUI\stat_card.cpp"
$File "cstrike\VGUI\stat_card.h"
$File "cstrike\VGUI\base_stats_page.cpp"
$File "cstrike\VGUI\base_stats_page.h"
$File "cstrike\VGUI\match_stats_page.cpp"
$File "cstrike\VGUI\match_stats_page.h"
$File "cstrike\VGUI\lifetime_stats_page.cpp"
$File "cstrike\VGUI\lifetime_stats_page.h"
$File "cstrike\VGUI\bordered_panel.cpp"
$File "cstrike\VGUI\bordered_panel.h"
$File "cstrike\VGUI\backgroundpanel.cpp"
$File "cstrike\VGUI\backgroundpanel.h"
$File "cstrike\VGUI\buymouseoverpanelbutton.h"
$File "cstrike\VGUI\buypreset_imageinfo.cpp"
$File "cstrike\VGUI\buypreset_listbox.cpp"
$File "cstrike\VGUI\buypreset_listbox.h"
$File "cstrike\VGUI\buypreset_panel.cpp"
$File "cstrike\VGUI\buypreset_weaponsetlabel.h"
$File "cstrike\VGUI\career_box.cpp"
$File "cstrike\VGUI\career_box.h"
$File "cstrike\VGUI\career_button.cpp"
$File "cstrike\VGUI\career_button.h"
$File "cstrike\VGUI\counterstrikeviewport.cpp"
$File "cstrike\VGUI\counterstrikeviewport.h"
$File "cstrike\VGUI\cstrikebuyequipmenu.cpp"
$File "cstrike\VGUI\cstrikebuyequipmenu.h"
$File "cstrike\VGUI\cstrikebuymenu.cpp"
$File "cstrike\VGUI\cstrikebuymenu.h"
$File "cstrike\VGUI\cstrikebuysubmenu.h"
$File "cstrike\VGUI\cstrikeclassmenu.cpp"
$File "cstrike\VGUI\cstrikeclassmenu.h"
$File "cstrike\VGUI\cstrikeclientscoreboard.cpp"
$File "cstrike\VGUI\cstrikeclientscoreboard.h"
$File "cstrike\VGUI\cstrikespectatorgui.cpp"
$File "cstrike\VGUI\cstrikespectatorgui.h"
$File "cstrike\VGUI\cstriketeammenu.cpp"
$File "cstrike\VGUI\cstriketeammenu.h"
$File "cstrike\VGUI\cstriketextwindow.cpp"
$File "cstrike\VGUI\cstriketextwindow.h"
$File "cstrike\vgui_c4panel.cpp"
$File "cstrike\vgui_viewc4panel.cpp"
$File "cstrike\VGUI\win_panel_round.cpp"
$File "cstrike\VGUI\win_panel_round.h"
}
$Folder "NextBot"
{
$File "NextBot\C_NextBot.cpp"
$File "NextBot\C_NextBot.h"
}
}
$Folder "game_controls"
{
$File "game_controls\buymenu.cpp"
$File "game_controls\buysubmenu.cpp"
$File "game_controls\classmenu.cpp"
}
}
$Folder "Header Files"
{
$Folder "game_controls header files"
{
$File "game_controls\buymenu.h"
$File "game_controls\buysubmenu.h"
$File "game_controls\classmenu.h"
}
}
$Folder "Link Libraries"
{
$Lib vtf
}
}
-246
View File
@@ -1,246 +0,0 @@
//-----------------------------------------------------------------------------
// CLIENT_DOD.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Macro SRCDIR "..\.."
$Macro GAMENAME "dod"
$Include "$SRCDIR\game\client\client_base.vpc"
$Configuration
{
$Compiler
{
$AdditionalIncludeDirectories "$BASE;dod,.\dod\VGUI,$SRCDIR\game\shared\dod"
$PreprocessorDefinitions "$BASE;DOD_DLL;ENABLE_HTML_WINDOW"
}
}
$Project "Client (DOD)"
{
$Folder "Source Files"
{
-$File "$SRCDIR\game\shared\weapon_parse_default.cpp"
-$File "history_resource.cpp"
-$File "hud_hintdisplay.cpp"
$File "hud_voicestatus.cpp"
$File "$SRCDIR\game\shared\playerclass_info_parse.cpp"
$File "$SRCDIR\game\shared\playerclass_info_parse.h"
$Folder "Day of Defeat DLL"
{
$File "$SRCDIR\game\shared\dod\achievements_dod.cpp"
$File "dod\c_dod_basegrenade.cpp"
$File "dod\c_dod_basegrenade.h"
$File "dod\c_dod_baserocket.cpp"
$File "dod\c_dod_bombdispenser.cpp"
$File "dod\c_dod_bombtarget.cpp"
$File "dod\c_dod_objective_resource.cpp"
$File "dod\c_dod_objective_resource.h"
$File "dod\c_dod_player.cpp"
$File "dod\c_dod_player.h"
$File "dod\c_dod_playerresource.cpp"
$File "dod\c_dod_playerresource.h"
$File "dod\c_dod_smokegrenade.cpp"
$File "dod\c_dod_smokegrenade.h"
$File "dod\c_dod_team.cpp"
$File "dod\c_dod_team.h"
$File "dod\c_grenadetrail.cpp"
$File "dod\c_grenadetrail.h"
$File "dod\c_te_firebullets.cpp"
$File "dod\clientmode_dod.cpp"
$File "dod\clientmode_dod.h"
$File "dod\dod_fx_explosions.cpp"
$File "$SRCDIR\game\shared\dod\dod_gamemovement.cpp"
$File "$SRCDIR\game\shared\dod\dod_gamerules.cpp"
$File "$SRCDIR\game\shared\dod\dod_gamerules.h"
$File "dod\dod_headiconmanager.cpp"
$File "dod\dod_headiconmanager.h"
$File "dod\dod_hud_ammo.cpp"
$File "dod\dod_hud_areacapicon.cpp"
$File "dod\dod_hud_capturepanel.cpp"
$File "dod\dod_hud_capturepanel.h"
$File "dod\dod_hud_chat.cpp"
$File "dod\dod_hud_chat.h"
$File "dod\dod_hud_crosshair.cpp"
$File "dod\dod_hud_crosshair.h"
$File "dod\dod_hud_damageindicator.cpp"
$File "dod\dod_hud_deathnotice.cpp"
$File "dod\dod_hud_freezepanel.cpp"
$File "dod\dod_hud_freezepanel.h"
$File "dod\dod_hud_health.cpp"
$File "dod\dod_hud_hintdisplay.cpp"
$File "dod\dod_hud_history_resource.cpp"
$File "dod\dod_hud_objectiveicons.cpp"
$File "dod\dod_hud_playerstatus_ammo.cpp"
$File "dod\dod_hud_playerstatus_ammo.h"
$File "dod\dod_hud_playerstatus_fireselect.cpp"
$File "dod\dod_hud_playerstatus_fireselect.h"
$File "dod\dod_hud_playerstatus_health.cpp"
$File "dod\dod_hud_playerstatus_health.h"
$File "dod\dod_hud_playerstatus_mgheat.cpp"
$File "dod\dod_hud_playerstatus_mgheat.h"
$File "dod\dod_hud_playerstatus_stamina.cpp"
$File "dod\dod_hud_playerstatus_stamina.h"
$File "dod\dod_hud_playerstatus_tnt.cpp"
$File "dod\dod_hud_playerstatus_weapon.cpp"
$File "dod\dod_hud_playerstatus_weapon.h"
$File "dod\dod_hud_playerstatuspanel.cpp"
$File "dod\dod_hud_readyrestart.cpp"
$File "dod\dod_hud_restartround.cpp"
$File "dod\dod_hud_scope.cpp"
$File "dod\dod_hud_spec_crosshair.cpp"
$File "dod\dod_hud_spec_crosshair.h"
$File "dod\dod_hud_target_id.cpp"
$File "dod\dod_hud_tnt_pickup.cpp"
$File "dod\dod_hud_warmuplabel.cpp"
$File "dod\dod_hud_weaponselection.cpp"
$File "dod\dod_hud_winpanel.cpp"
$File "dod\dod_hud_winpanel.h"
$File "dod\dod_in_main.cpp"
$File "$SRCDIR\game\shared\dod\dod_player_shared.cpp"
$File "$SRCDIR\game\shared\dod\dod_player_shared.h"
$File "$SRCDIR\game\shared\dod\dod_playeranimstate.cpp"
$File "$SRCDIR\game\shared\dod\dod_playeranimstate.h"
$File "$SRCDIR\game\shared\dod\dod_playerclass_info_parse.cpp"
$File "$SRCDIR\game\shared\dod\dod_playerclass_info_parse.h"
$File "dod\dod_playerstats.cpp"
$File "dod\dod_playerstats.h"
$File "dod\dod_prediction.cpp"
$File "$SRCDIR\game\shared\dod\dod_round_timer.cpp"
$File "$SRCDIR\game\shared\dod\dod_shareddefs.cpp"
$File "$SRCDIR\game\shared\dod\dod_shareddefs.h"
$File "$SRCDIR\game\shared\dod\dod_usermessages.cpp"
$File "dod\dod_view_scene.cpp"
$File "dod\dod_view_scene.h"
$File "$SRCDIR\game\shared\dod\dod_viewmodel.cpp"
$File "$SRCDIR\game\shared\dod\dod_viewmodel.h"
$File "$SRCDIR\game\shared\dod\dod_weapon_parse.cpp"
$File "$SRCDIR\game\shared\dod\dod_weapon_parse.h"
$File "dod\VGUI\backgroundpanel.cpp"
$File "dod\VGUI\backgroundpanel.h"
$File "dod\VGUI\dodbutton.cpp"
$File "dod\VGUI\dodbutton.h"
$File "dod\VGUI\dodclassmenu.cpp"
$File "dod\VGUI\dodclassmenu.h"
$File "dod\VGUI\dodclientscoreboard.cpp"
$File "dod\VGUI\dodclientscoreboard.h"
$File "dod\VGUI\dodcornercutpanel.cpp"
$File "dod\VGUI\dodcornercutpanel.h"
$File "dod\VGUI\dodmenubackground.cpp"
$File "dod\VGUI\dodmenubackground.h"
$File "dod\VGUI\dodmouseoverpanelbutton.h"
$File "dod\VGUI\dodoverview.cpp"
$File "dod\VGUI\dodoverview.h"
$File "dod\VGUI\dodrandombutton.h"
$File "dod\VGUI\dodspectatorgui.cpp"
$File "dod\VGUI\dodspectatorgui.h"
$File "dod\VGUI\dodteammenu.cpp"
$File "dod\VGUI\dodteammenu.h"
$File "dod\VGUI\dodtextwindow.cpp"
$File "dod\VGUI\dodtextwindow.h"
$File "dod\VGUI\dodviewport.cpp"
$File "dod\VGUI\dodviewport.h"
$File "dod\fx_dod_blood.cpp"
$File "dod\fx_dod_blood.h"
$File "dod\fx_dod_ejectbrass.cpp"
$File "dod\fx_dod_filmgrain.cpp"
$File "dod\fx_dod_impact.cpp"
$File "dod\fx_dod_knifeslash.cpp"
$File "dod\fx_dod_muzzleflash.cpp"
$File "dod\fx_dod_muzzleflash.h"
$File "$SRCDIR\game\shared\dod\fx_dod_shared.cpp"
$File "$SRCDIR\game\shared\dod\fx_dod_shared.h"
$File "dod\fx_dod_tracers.cpp"
$File "dod\VGUI\idodviewportmsgs.h"
$File "dod\VGUI\vgui_rootpanel_dod.cpp"
$File "dod\VGUI\vgui_rootpanel_dod.h"
$File "$SRCDIR\game\shared\dod\weapon_30cal.cpp"
$File "$SRCDIR\game\shared\dod\weapon_amerknife.cpp"
$File "$SRCDIR\game\shared\dod\weapon_bar.cpp"
$File "$SRCDIR\game\shared\dod\weapon_bazooka.cpp"
$File "$SRCDIR\game\shared\dod\weapon_c96.cpp"
$File "$SRCDIR\game\shared\dod\weapon_colt.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodbase.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodbase.h"
$File "$SRCDIR\game\shared\dod\weapon_dodbasebomb.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodbasebomb.h"
$File "$SRCDIR\game\shared\dod\weapon_dodbasegrenade.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodbasegrenade.h"
$File "$SRCDIR\game\shared\dod\weapon_dodbasegun.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodbasegun.h"
$File "$SRCDIR\game\shared\dod\weapon_dodbasemelee.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodbasemelee.h"
$File "$SRCDIR\game\shared\dod\weapon_dodbaserpg.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodbaserpg.h"
$File "$SRCDIR\game\shared\dod\weapon_dodbipodgun.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodbipodgun.h"
$File "$SRCDIR\game\shared\dod\weapon_dodfireselect.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodfireselect.h"
$File "$SRCDIR\game\shared\dod\weapon_dodfullauto.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodfullauto.h"
$File "$SRCDIR\game\shared\dod\weapon_dodfullauto_punch.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodfullauto_punch.h"
$File "$SRCDIR\game\shared\dod\weapon_dodsemiauto.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodsemiauto.h"
$File "$SRCDIR\game\shared\dod\weapon_dodsniper.cpp"
$File "$SRCDIR\game\shared\dod\weapon_dodsniper.h"
$File "$SRCDIR\game\shared\dod\weapon_explodinghandgrenade.cpp"
$File "$SRCDIR\game\shared\dod\weapon_explodingstickgrenade.cpp"
$File "$SRCDIR\game\shared\dod\weapon_garand.cpp"
$File "$SRCDIR\game\shared\dod\weapon_handgrenade.cpp"
$File "$SRCDIR\game\shared\dod\weapon_k98.cpp"
$File "$SRCDIR\game\shared\dod\weapon_k98_scoped.cpp"
$File "$SRCDIR\game\shared\dod\weapon_m1carbine.cpp"
$File "$SRCDIR\game\shared\dod\weapon_mg42.cpp"
$File "$SRCDIR\game\shared\dod\weapon_mg42.h"
$File "$SRCDIR\game\shared\dod\weapon_mp40.cpp"
$File "$SRCDIR\game\shared\dod\weapon_mp44.cpp"
$File "$SRCDIR\game\shared\dod\weapon_p38.cpp"
$File "$SRCDIR\game\shared\dod\weapon_pschreck.cpp"
$File "$SRCDIR\game\shared\dod\weapon_riflegrenade.cpp"
$File "$SRCDIR\game\shared\dod\weapon_riflegrenade.h"
$File "$SRCDIR\game\shared\dod\weapon_riflegrenade_ger.cpp"
$File "$SRCDIR\game\shared\dod\weapon_riflegrenade_ger_live.cpp"
$File "$SRCDIR\game\shared\dod\weapon_riflegrenade_us.cpp"
$File "$SRCDIR\game\shared\dod\weapon_riflegrenade_us_live.cpp"
$File "$SRCDIR\game\shared\dod\weapon_smokegrenade_ger.cpp"
$File "$SRCDIR\game\shared\dod\weapon_smokegrenade_us.cpp"
$File "$SRCDIR\game\shared\dod\weapon_spade.cpp"
$File "$SRCDIR\game\shared\dod\weapon_spring.cpp"
$File "$SRCDIR\game\shared\dod\weapon_stickgrenade.cpp"
$File "$SRCDIR\game\shared\dod\weapon_thompson.cpp"
}
$Folder "game_controls"
{
$File "game_controls\buymenu.cpp"
$File "game_controls\buysubmenu.cpp"
$File "game_controls\classmenu.cpp"
}
$Folder "IFM"
{
$File "$SRCDIR\game\shared\weapon_ifmbase.cpp"
$File "$SRCDIR\game\shared\weapon_ifmbase.h"
$File "$SRCDIR\game\shared\weapon_ifmbasecamera.cpp"
$File "$SRCDIR\game\shared\weapon_ifmbasecamera.h"
$File "$SRCDIR\game\shared\weapon_ifmsteadycam.cpp"
}
}
$Folder "Header Files"
{
$Folder "game_controls header files"
{
$File "game_controls\buymenu.h"
$File "game_controls\buysubmenu.h"
$File "game_controls\classmenu.h"
}
}
}
-186
View File
@@ -1,186 +0,0 @@
//-----------------------------------------------------------------------------
// CLIENT_ECON_BASE.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Include "$SRCDIR\gcsdk\gcsdk_game_include.vpc"
$Include "$SRCDIR\game\shared\base_gcmessages_include.vpc"
$Include "$SRCDIR\game\shared\econ_gcmessages_include.vpc"
$include "$SRCDIR\vpc_scripts\source_cryptlib_include.vpc"
$Configuration
{
$Compiler
{
$AdditionalIncludeDirectories "$BASE;$SRCDIR\game\shared\econ;$SRCDIR\gcsdk\steamextra;.\econ"
$PreprocessorDefinitions "$BASE;USES_ECON_ITEMS"
}
$Linker
{
$SystemLibraries "$BASE;z" [$OSXALL]
}
}
$Project
{
$Folder "Source Files"
{
$Folder "Economy"
{
$File "$SRCDIR\game\shared\econ\econ_item_view.cpp"
$File "$SRCDIR\game\shared\econ\econ_item_view.h"
$File "$SRCDIR\game\shared\econ\econ_item_interface.cpp"
$File "$SRCDIR\game\shared\econ\econ_item_interface.h"
$File "$SRCDIR\game\shared\econ\econ_item_description.cpp"
$File "$SRCDIR\game\shared\econ\econ_item_description.h"
$File "$SRCDIR\game\shared\econ\econ_item_system.cpp"
$File "$SRCDIR\game\shared\econ\econ_item_system.h"
$File "$SRCDIR\game\shared\econ\attribute_manager.cpp"
$File "$SRCDIR\game\shared\econ\attribute_manager.h"
$File "$SRCDIR\game\shared\econ\ihasattributes.h"
$File "$SRCDIR\game\shared\econ\econ_entity.cpp"
$File "$SRCDIR\game\shared\econ\econ_entity.h"
$File "$SRCDIR\game\shared\econ\econ_entity_creation.cpp"
$File "$SRCDIR\game\shared\econ\econ_entity_creation.h"
$File "$SRCDIR\game\shared\econ\econ_item_inventory.cpp"
$File "$SRCDIR\game\shared\econ\econ_item_inventory.h"
$File "$SRCDIR\game\shared\econ\econ_gcmessages.h"
$File "$SRCDIR\game\shared\econ\econ_wearable.cpp"
$File "$SRCDIR\game\shared\econ\econ_wearable.h"
$File "$SRCDIR\game\shared\econ\econ_holidays.cpp"
$File "$SRCDIR\game\shared\econ\econ_holidays.h"
$File "$SRCDIR\game\shared\econ\econ_item.cpp"
$File "$SRCDIR\game\shared\econ\econ_item.h"
$File "$SRCDIR\game\shared\econ\econ_item_preset.cpp"
$File "$SRCDIR\game\shared\econ\econ_item_preset.h"
$File "$SRCDIR\game\shared\econ\econ_item_constants.cpp"
$File "$SRCDIR\game\shared\econ\econ_item_constants.h"
$File "$SRCDIR\game\shared\econ\econ_item_schema.cpp"
$File "$SRCDIR\game\shared\econ\econ_item_schema.h"
$File "$SRCDIR\game\shared\econ\econ_item_tools.cpp"
$File "$SRCDIR\game\shared\econ\econ_item_tools.h"
$File "$SRCDIR\game\shared\econ\econ_store.cpp"
$File "$SRCDIR\game\shared\econ\econ_store.h"
$File "$SRCDIR\game\shared\econ\econ_storecategory.cpp"
$File "$SRCDIR\game\shared\econ\econ_storecategory.h"
$File "$SRCDIR\game\shared\econ\item_selection_criteria.cpp"
$File "$SRCDIR\game\shared\econ\item_selection_criteria.h"
$File "$SRCDIR\game\shared\econ\econ_dynamic_recipe.cpp"
$File "$SRCDIR\game\shared\econ\econ_dynamic_recipe.h"
$File "$SRCDIR\game\shared\econ\econ_quests.cpp"
$File "$SRCDIR\game\shared\econ\econ_quests.h"
$File "$SRCDIR\game\client\econ\econ_consumables.cpp"
$File "$SRCDIR\game\shared\gc_clientsystem.h"
$File "$SRCDIR\game\shared\gc_clientsystem.cpp"
$File "$SRCDIR\game\shared\gc_replicated_convars.cpp"
$File "$SRCDIR\game\shared\econ\localization_provider.cpp"
$File "$SRCDIR\game\shared\econ\localization_provider.h"
}
$Folder "Economy Client"
{
$File "econ\econ_ui.h"
$File "econ\backpack_panel.cpp"
$File "econ\backpack_panel.h"
$File "econ\base_loadout_panel.cpp"
$File "econ\base_loadout_panel.h"
$File "econ\trading_start_dialog.cpp"
$File "econ\trading_start_dialog.h"
$File "econ\iconrenderreceiver.h"
$File "econ\item_model_panel.cpp"
$File "econ\item_model_panel.h"
$File "econ\item_pickup_panel.cpp"
$File "econ\item_pickup_panel.h"
$File "econ\confirm_dialog.cpp"
$File "econ\confirm_dialog.h"
$File "econ\confirm_delete_dialog.cpp"
$File "econ\confirm_delete_dialog.h"
$File "econ\item_confirm_delete_dialog.cpp"
$File "econ\item_confirm_delete_dialog.h"
$File "econ\item_style_select_dialog.cpp"
$File "econ\item_style_select_dialog.h"
$File "econ\econ_controls.cpp"
$File "econ\econ_controls.h"
$File "econ\econ_notifications.cpp"
$File "econ\econ_notifications.h"
$File "econ\item_rental_ui.cpp"
$File "econ\item_rental_ui.h"
$File "econ\client_community_market.cpp"
$File "econ\client_community_market.h"
$File "econ\local_steam_shared_object_listener.cpp"
$File "econ\local_steam_shared_object_listener.h"
// Temp UI to allow you to test
$File "econ\econ_sample_rootui.cpp"
$File "econ\econ_sample_rootui.h"
$Folder "Trading"
{
$File "econ\econ_trading.cpp"
$File "econ\econ_trading.h"
}
$Folder "VGUI dependencies"
{
$File "game_controls\navigationpanel.cpp"
$File "game_controls\navigationpanel.h"
}
$Folder "Store"
{
$File "econ\store\store_page.cpp"
$File "econ\store\store_page.h"
$File "econ\store\store_page_new.cpp"
$File "econ\store\store_page_new.h"
$File "econ\store\store_panel.cpp"
$File "econ\store\store_panel.h"
$File "econ\store\store_preview_item.cpp"
$File "econ\store\store_preview_item.h"
$File "econ\store\store_viewcart.cpp"
$File "econ\store\store_viewcart.h"
}
$Folder "tool_items"
{
$File "econ\tool_items\tool_items.cpp"
$File "econ\tool_items\tool_items.h"
$File "econ\tool_items\rename_tool_ui.cpp"
$File "econ\tool_items\rename_tool_ui.h"
$File "econ\tool_items\decoder_ring_tool.cpp"
$File "econ\tool_items\decoder_ring_tool.h"
$File "econ\tool_items\paint_can_tool.cpp"
$File "econ\tool_items\paint_can_tool.h"
$File "econ\tool_items\custom_texture_cache.cpp"
$File "econ\tool_items\custom_texture_cache.h"
$File "econ\tool_items\custom_texture_tool.cpp"
$File "econ\tool_items\gift_wrap_tool.cpp"
$File "econ\tool_items\gift_wrap_tool.h"
}
}
// For item image stamping
$File "$SRCDIR\common\imageutils.h"
$File "$SRCDIR\common\imageutils.cpp"
{
$Configuration
{
$Compiler
{
$Create/UsePrecompiledHeader "Not Using Precompiled Headers"
}
}
}
}
$Folder "Link Libraries"
{
$Lib "$LIBCOMMON/libjpeg"
$Lib libpng [!$VS2015]
$Lib $LIBCOMMON/libpng [$VS2015]
$Lib libz
}
}
-103
View File
@@ -1,103 +0,0 @@
//-----------------------------------------------------------------------------
// CLIENT_HL1.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Macro SRCDIR "..\.."
$Macro GAMENAME "hl1"
$Include "$SRCDIR\game\client\client_base.vpc"
$Configuration
{
$Compiler
{
$AdditionalIncludeDirectories "$BASE;.\hl1,.\hl2,.\hl2\elements,$SRCDIR\game\shared\hl1,$SRCDIR\game\shared\hl2"
$PreprocessorDefinitions "$BASE;HL1_CLIENT_DLL"
}
}
$Project "Client (HL1)"
{
$Folder "Source Files"
{
-$File "geiger.cpp"
-$File "history_resource.cpp"
-$File "train.cpp"
$File "c_team_objectiveresource.cpp"
$File "c_team_objectiveresource.h"
$File "hud_chat.cpp"
$File "$SRCDIR\game\shared\predicted_viewmodel.cpp"
$File "$SRCDIR\game\shared\predicted_viewmodel.h"
$Folder "HL2 DLL"
{
$File "hl2\c_antlion_dust.cpp"
$File "hl2\c_basehelicopter.cpp"
$File "hl2\c_basehelicopter.h"
$File "hl2\c_basehlcombatweapon.h"
$File "hl2\c_corpse.cpp"
$File "hl2\c_corpse.h"
$File "hl2\c_hl2_playerlocaldata.h"
$File "hl2\c_rotorwash.cpp"
$File "$SRCDIR\game\shared\hl2\citadel_effects_shared.h"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.h"
$File "hl2\fx_bugbait.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_shareddefs.h"
$File "hl2\hl_in_main.cpp"
$File "hl2\hl_prediction.cpp"
$File "hl2\vgui_rootpanel_hl2.cpp"
}
$Folder "HL1 DLL"
{
$File "hl1\c_hl1mp_player.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_basecombatweapon_shared.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_basecombatweapon_shared.h"
$File "hl1\hl1_c_legacytempents.cpp"
$File "hl1\hl1_c_player.cpp"
$File "hl1\hl1_c_player.h"
$File "hl1\hl1_c_rpg_rocket.cpp"
$File "hl1\hl1_c_weapon__stubs.cpp"
$File "hl1\hl1_clientmode.cpp"
$File "hl1\hl1_clientmode.h"
$File "hl1\hl1_fx_gauss.cpp"
$File "hl1\hl1_fx_gibs.cpp"
$File "hl1\hl1_fx_impacts.cpp"
$File "hl1\hl1_fx_shelleject.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_gamemovement.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_gamemovement.h"
$File "$SRCDIR\game\shared\hl1\hl1_gamerules.cpp"
$File "hl1\hl1_hud_ammo.cpp"
$File "hl1\hl1_hud_battery.cpp"
$File "hl1\hl1_hud_damageindicator.cpp"
$File "hl1\hl1_hud_damagetiles.cpp"
$File "hl1\hl1_hud_flashlight.cpp"
$File "hl1\hl1_hud_geiger.cpp"
$File "hl1\hl1_hud_health.cpp"
$File "hl1\hl1_hud_history_resource.cpp"
$File "hl1\hl1_hud_numbers.cpp"
$File "hl1\hl1_hud_numbers.h"
$File "hl1\hl1_hud_train.cpp"
$File "hl1\hl1_hud_weaponselection.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_player_shared.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_player_shared.h"
$File "$SRCDIR\game\shared\hl1\hl1_usermessages.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_basecombatweapon_shared.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_357.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_crossbow.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_egon.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_gauss.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_glock.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_handgrenade.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_hornetgun.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_mp5.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_rpg.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_sachel.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_shotgun.cpp"
$File "$SRCDIR\game\server\hl1\hl1_weapon_crowbar.cpp"
}
}
}
-109
View File
@@ -1,109 +0,0 @@
//-----------------------------------------------------------------------------
// CLIENT_HL1MP.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Macro SRCDIR "..\.."
$Macro GAMENAME "hl1mp"
$Include "$SRCDIR\game\client\client_base.vpc"
$Configuration
{
$Compiler
{
$AdditionalIncludeDirectories "$BASE;.\hl1,.\hl2,.\hl2\elements,$SRCDIR\game\shared\hl1,$SRCDIR\game\shared\hl2"
$PreprocessorDefinitions "$BASE;HL1_CLIENT_DLL;HL1MP_CLIENT_DLL"
}
}
$Project "Client (HL1MP)"
{
$Folder "Source Files"
{
-$File "geiger.cpp"
-$File "history_resource.cpp"
-$File "train.cpp"
$File "c_team_objectiveresource.cpp"
$File "c_team_objectiveresource.h"
$File "hud_chat.cpp"
$File "$SRCDIR\game\shared\predicted_viewmodel.cpp"
$File "$SRCDIR\game\shared\predicted_viewmodel.h"
$Folder "HL2 DLL"
{
$File "hl2\c_antlion_dust.cpp"
$File "hl2\c_basehelicopter.cpp"
$File "hl2\c_basehelicopter.h"
$File "hl2\c_basehlcombatweapon.h"
$File "hl2\c_corpse.cpp"
$File "hl2\c_corpse.h"
$File "hl2\c_hl2_playerlocaldata.h"
$File "hl2\c_rotorwash.cpp"
$File "$SRCDIR\game\shared\hl2\citadel_effects_shared.h"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.h"
$File "hl2\fx_bugbait.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_shareddefs.h"
$File "hl2\hl_in_main.cpp"
$File "hl2\hl_prediction.cpp"
$File "hl2\vgui_rootpanel_hl2.cpp"
}
$Folder "HL1 DLL"
{
$File "hl1\hl1_c_legacytempents.cpp"
$File "hl1\hl1_c_player.cpp"
$File "hl1\hl1_c_player.h"
$File "hl1\hl1_c_rpg_rocket.cpp"
$File "hl1\hl1_c_weapon__stubs.cpp"
$File "hl1\hl1_clientmode.cpp"
$File "hl1\hl1_clientmode.h"
$File "hl1\hl1_clientscoreboard.cpp"
$File "hl1\hl1_hud_deathnotice.cpp"
$File "hl1\hl1_fx_gauss.cpp"
$File "hl1\hl1_fx_gibs.cpp"
$File "hl1\hl1_fx_impacts.cpp"
$File "hl1\hl1_fx_shelleject.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_gamemovement.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_gamemovement.h"
$File "hl1\hl1_hud_ammo.cpp"
$File "hl1\hl1_hud_battery.cpp"
$File "hl1\hl1_hud_damageindicator.cpp"
$File "hl1\hl1_hud_damagetiles.cpp"
$File "hl1\hl1_hud_flashlight.cpp"
$File "hl1\hl1_hud_geiger.cpp"
$File "hl1\hl1_hud_health.cpp"
$File "hl1\hl1_hud_history_resource.cpp"
$File "hl1\hl1_hud_numbers.cpp"
$File "hl1\hl1_hud_numbers.h"
$File "hl1\hl1_hud_train.cpp"
$File "hl1\hl1_hud_weaponselection.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_basecombatweapon_shared.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_gamerules.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_player_shared.cpp"
$File "$SRCDIR\game\shared\hl1\hl1_player_shared.h"
$File "$SRCDIR\game\shared\hl1\hl1_usermessages.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_357.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_crossbow.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_egon.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_gauss.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_glock.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_handgrenade.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_hornetgun.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_mp5.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_rpg.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_sachel.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_weapon_shotgun.cpp"
$File "$SRCDIR\game\server\hl1\hl1_weapon_crowbar.cpp"
}
$Folder "HL1MP DLL"
{
$File "hl1\c_hl1mp_player.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_basecombatweapon_shared.cpp"
$File "$SRCDIR\game\shared\hl1\hl1mp_gamerules.cpp"
}
}
}
-115
View File
@@ -1,115 +0,0 @@
//-----------------------------------------------------------------------------
// CLIENT_LOSTCOAST.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Macro SRCDIR "..\.."
$Macro GAMENAME "lostcoast"
$Include "$SRCDIR\game\client\client_base.vpc"
$Configuration
{
$Compiler
{
$AdditionalIncludeDirectories "$BASE;hl2,.\hl2\elements,$SRCDIR\game\shared\hl2"
$PreprocessorDefinitions "$BASE;HL2_CLIENT_DLL;HL2_LOSTCOAST"
}
}
$Project "Client (LostCoast)"
{
$Folder "Source Files"
{
$File "hud_chat.cpp"
$File "c_team_objectiveresource.cpp"
$File "c_team_objectiveresource.h"
$Folder "HL2 DLL"
{
$File "$SRCDIR\game\shared\hl2\basehlcombatweapon_shared.cpp"
$File "$SRCDIR\game\shared\hl2\achievements_hl2.cpp"
$File "hl2\c_antlion_dust.cpp"
$File "hl2\c_ar2_explosion.cpp"
$File "hl2\c_barnacle.cpp"
$File "hl2\c_barney.cpp"
$File "hl2\c_basehelicopter.cpp"
$File "hl2\c_basehelicopter.h"
$File "hl2\c_basehlcombatweapon.cpp"
$File "hl2\c_basehlcombatweapon.h"
$File "hl2\c_basehlplayer.cpp"
$File "hl2\c_basehlplayer.h"
$File "hl2\c_citadel_effects.cpp"
$File "hl2\c_corpse.cpp"
$File "hl2\c_corpse.h"
$File "hl2\c_env_alyxtemp.cpp"
$File "hl2\c_env_headcrabcanister.cpp"
$File "hl2\c_env_starfield.cpp"
$File "hl2\c_func_tankmortar.cpp"
$File "hl2\c_hl2_playerlocaldata.cpp"
$File "hl2\c_hl2_playerlocaldata.h"
$File "hl2\c_info_teleporter_countdown.cpp"
$File "hl2\c_npc_antlionguard.cpp"
$File "hl2\c_npc_combinegunship.cpp"
$File "hl2\c_npc_manhack.cpp"
$File "hl2\c_npc_rollermine.cpp"
$File "hl2\c_plasma_beam_node.cpp"
$File "hl2\c_prop_combine_ball.cpp"
$File "hl2\c_prop_combine_ball.h"
$File "hl2\c_rotorwash.cpp"
$File "hl2\c_script_intro.cpp"
$File "$SRCDIR\game\shared\script_intro_shared.cpp"
$File "hl2\c_strider.cpp"
$File "hl2\c_te_concussiveexplosion.cpp"
$File "hl2\c_te_flare.cpp"
$File "hl2\c_thumper_dust.cpp"
$File "hl2\c_vehicle_airboat.cpp"
$File "hl2\c_vehicle_cannon.cpp"
$File "hl2\c_vehicle_crane.cpp"
$File "hl2\c_vehicle_crane.h"
$File "hl2\c_vehicle_prisoner_pod.cpp"
$File "hl2\c_weapon__stubs_hl2.cpp"
$File "hl2\c_weapon_crossbow.cpp"
$File "hl2\c_weapon_physcannon.cpp"
$File "hl2\c_weapon_stunstick.cpp"
$File "$SRCDIR\game\shared\hl2\citadel_effects_shared.h"
$File "hl2\clientmode_hlnormal.cpp"
$File "hl2\clientmode_hlnormal.h"
$File "death.cpp"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.cpp"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.h"
$File "hl2\fx_antlion.cpp"
$File "hl2\fx_bugbait.cpp"
$File "hl2\fx_hl2_impacts.cpp"
$File "hl2\fx_hl2_tracers.cpp"
$File "hl2\hl2_clientmode.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_gamerules.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_gamerules.h"
$File "$SRCDIR\game\shared\hl2\hl2_shareddefs.h"
$File "$SRCDIR\game\shared\hl2\hl2_usermessages.cpp"
$File "$SRCDIR\game\shared\hl2\hl_gamemovement.cpp"
$File "$SRCDIR\game\shared\hl2\hl_gamemovement.h"
$File "hl2\hl_in_main.cpp"
$File "hl2\hl_prediction.cpp"
$File "hl2\hud_ammo.cpp"
$File "hl2\hud_battery.cpp"
$File "hl2\hud_blood.cpp"
$File "hl2\hud_credits.cpp"
$File "hl2\hud_damageindicator.cpp"
$File "hl2\hud_flashlight.cpp"
$File "hl2\hud_health.cpp"
$File "hl2\hud_poisondamageindicator.cpp"
$File "hud_posture.cpp"
$File "hl2\hud_quickinfo.cpp"
$File "hud_squadstatus.cpp"
$File "hl2\hud_suitpower.cpp"
$File "hl2\hud_suitpower.h"
$File "hl2\hud_weaponselection.cpp"
$File "hl2\hud_zoom.cpp"
$File "hl2\shieldproxy.cpp"
$File "hl2\vgui_rootpanel_hl2.cpp"
$File "episodic\c_vort_charge_token.cpp"
}
}
}
-196
View File
@@ -1,196 +0,0 @@
//-----------------------------------------------------------------------------
// CLIENT_PORTAL.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Macro SRCDIR "..\.."
$Macro GAMENAME "portal"
$Include "$SRCDIR\game\client\client_base.vpc"
$Configuration
{
$Compiler
{
$AdditionalIncludeDirectories ".\hl2;.\hl2\elements;.\portal;.\portal\vgui;$SRCDIR\game\shared\hl2;$SRCDIR\game\shared\Multiplayer;$SRCDIR\gcsdk\steamextra;$SRCDIR\game\shared\portal;$BASE"
$PreprocessorDefinitions "$BASE;PORTAL;HL2_EPISODIC;HL2_CLIENT_DLL"
}
}
$Project "Client (Portal)"
{
$Folder "Source Files"
{
-$File "$SRCDIR\game\shared\weapon_parse_default.cpp"
$File "hud_chat.cpp"
$File "c_team_objectiveresource.cpp"
$File "c_team_objectiveresource.h"
$Folder "HL2 DLL"
{
$File "episodic\flesh_internal_material_proxy.cpp"
$File "$SRCDIR\game\shared\hl2\basehlcombatweapon_shared.cpp"
$File "hl2\c_antlion_dust.cpp"
$File "hl2\c_ar2_explosion.cpp"
$File "hl2\c_barnacle.cpp"
$File "hl2\c_barney.cpp"
$File "hl2\c_basehelicopter.cpp"
$File "hl2\c_basehelicopter.h"
$File "hl2\c_basehlcombatweapon.cpp"
$File "hl2\c_basehlcombatweapon.h"
$File "hl2\c_basehlplayer.cpp"
$File "hl2\c_basehlplayer.h"
$File "hl2\c_citadel_effects.cpp"
$File "hl2\c_corpse.cpp"
$File "hl2\c_corpse.h"
$File "hl2\c_env_alyxtemp.cpp"
$File "hl2\c_env_headcrabcanister.cpp"
$File "hl2\c_env_starfield.cpp"
$File "hl2\c_func_tankmortar.cpp"
$File "hl2\c_hl2_playerlocaldata.cpp"
$File "hl2\c_hl2_playerlocaldata.h"
$File "hl2\c_info_teleporter_countdown.cpp"
$File "hl2\c_npc_antlionguard.cpp"
$File "hl2\c_npc_combinegunship.cpp"
$File "hl2\c_npc_manhack.cpp"
$File "hl2\c_npc_rollermine.cpp"
$File "hl2\c_plasma_beam_node.cpp"
$File "hl2\c_prop_combine_ball.cpp"
$File "hl2\c_prop_combine_ball.h"
$File "hl2\c_rotorwash.cpp"
$File "hl2\c_script_intro.cpp"
$File "$SRCDIR\game\shared\script_intro_shared.cpp"
$File "hl2\c_strider.cpp"
$File "hl2\c_te_concussiveexplosion.cpp"
$File "hl2\c_te_flare.cpp"
$File "hl2\c_thumper_dust.cpp"
$File "hl2\c_vehicle_airboat.cpp"
$File "hl2\c_vehicle_cannon.cpp"
$File "hl2\c_vehicle_crane.cpp"
$File "hl2\c_vehicle_crane.h"
$File "hl2\c_vehicle_prisoner_pod.cpp"
$File "episodic\c_vort_charge_token.cpp"
$File "hl2\c_weapon_crossbow.cpp"
$File "episodic\c_weapon_hopwire.cpp"
$File "episodic\c_vehicle_jeep_episodic.cpp"
$File "hl2\hud_radar.cpp"
$File "hl2\c_weapon_stunstick.cpp"
$File "$SRCDIR\game\shared\hl2\citadel_effects_shared.h"
$File "hl2\clientmode_hlnormal.h"
$File "death.cpp"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.cpp"
$File "$SRCDIR\game\shared\hl2\env_headcrabcanister_shared.h"
$File "hl2\fx_antlion.cpp"
$File "hl2\fx_bugbait.cpp"
$File "hl2\fx_hl2_impacts.cpp"
$File "hl2\fx_hl2_tracers.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_gamerules.cpp"
$File "$SRCDIR\game\shared\hl2\hl2_gamerules.h"
$File "$SRCDIR\game\shared\hl2\hl2_shareddefs.h"
$File "$SRCDIR\game\shared\hl2\hl_gamemovement.cpp"
$File "$SRCDIR\game\shared\hl2\hl_gamemovement.h"
$File "hl2\hl_in_main.cpp"
$File "hl2\hl_prediction.cpp"
$File "hl2\hud_ammo.cpp"
$File "hl2\hud_battery.cpp"
$File "hl2\hud_blood.cpp"
$File "hl2\hud_bonusprogress.cpp"
$File "hl2\hud_credits.cpp"
$File "hl2\hud_damageindicator.cpp"
$File "hl2\hud_flashlight.cpp"
$File "hl2\hud_health.cpp"
$File "hl2\hud_poisondamageindicator.cpp"
$File "hud_squadstatus.cpp"
$File "hl2\hud_suitpower.cpp"
$File "hl2\hud_suitpower.h"
$File "hl2\hud_weaponselection.cpp"
$File "hl2\hud_zoom.cpp"
$File "hl2\shieldproxy.cpp"
$File "$SRCDIR\game\shared\hl2\survival_gamerules.cpp"
$File "hl2\vgui_rootpanel_hl2.cpp"
}
$Folder "Portal"
{
$File "$SRCDIR\game\shared\portal\achievements_portal.cpp"
$File "portal\c_env_lightraill_endpoint.cpp"
$File "portal\c_env_portal_path_track.cpp"
$File "portal\c_func_liquidportal.cpp"
$File "portal\c_func_liquidportal.h"
$File "portal\c_neurotoxin_countdown.cpp"
$File "portal\c_neurotoxin_countdown.h"
$File "portal\c_npc_portal_turret_floor.cpp"
$File "portal\c_npc_rocket_turret.cpp"
$File "portal\c_portal_player.cpp"
$File "portal\c_portal_player.h"
$File "portal\C_PortalGhostRenderable.cpp"
$File "portal\C_PortalGhostRenderable.h"
$File "portal\c_prop_energy_ball.cpp"
$File "portal\c_prop_portal.cpp"
$File "portal\c_prop_portal.h"
$File "portal\c_prop_portal_stats_display.cpp"
$File "portal\c_prop_portal_stats_display.h"
$File "portal\clientmode_portal.cpp"
$File "portal\clientmode_portal.h"
$File "$SRCDIR\game\shared\portal\env_lightrail_endpoint_shared.h"
$File "$SRCDIR\game\shared\portal\env_portal_path_track_shared.h"
$File "portal\fx_portal.cpp"
$File "portal\hud_quickinfo.cpp"
$File "portal\MaterialProxy_Portal_PickAlphaMask.cpp"
$File "portal\materialproxy_portalstatic.cpp"
$File "$SRCDIR\game\shared\Multiplayer\multiplayer_animstate.cpp"
$File "$SRCDIR\game\shared\Multiplayer\multiplayer_animstate.h"
$File "$SRCDIR\game\shared\portal\portal_collideable_enumerator.cpp"
$File "$SRCDIR\game\shared\portal\portal_collideable_enumerator.h"
$File "portal\portal_credits.cpp"
$File "portal\Portal_DynamicMeshRenderingUtils.cpp"
$File "portal\Portal_DynamicMeshRenderingUtils.h"
$File "$SRCDIR\game\shared\portal\portal_gamemovement.cpp"
$File "$SRCDIR\game\shared\portal\portal_gamerules.cpp"
$File "$SRCDIR\game\shared\portal\portal_gamerules.h"
$File "portal\portal_hud_crosshair.cpp"
$File "portal\portal_hud_crosshair.h"
$File "$SRCDIR\game\shared\portal\portal_player_shared.cpp"
$File "$SRCDIR\game\shared\portal\portal_player_shared.h"
$File "$SRCDIR\game\shared\portal\portal_playeranimstate.cpp"
$File "$SRCDIR\game\shared\portal\portal_playeranimstate.h"
$File "portal\portal_render_targets.cpp"
$File "portal\portal_render_targets.h"
$File "$SRCDIR\game\shared\portal\portal_shareddefs.cpp"
$File "$SRCDIR\game\shared\portal\portal_shareddefs.h"
$File "$SRCDIR\game\shared\portal\portal_usermessages.cpp"
$File "$SRCDIR\game\shared\portal\portal_util_shared.cpp"
$File "$SRCDIR\game\shared\portal\portal_util_shared.h"
$File "$SRCDIR\game\shared\portal\prop_portal_shared.cpp"
$File "$SRCDIR\game\shared\portal\prop_portal_shared.h"
$File "$SRCDIR\game\shared\portal\PortalSimulation.cpp"
$File "$SRCDIR\game\shared\portal\PortalSimulation.h"
$File "$SRCDIR\game\shared\portal\StaticCollisionPolyhedronCache.cpp"
$File "$SRCDIR\game\shared\portal\StaticCollisionPolyhedronCache.h"
$File "portal\PortalRender.cpp"
$File "portal\PortalRender.h"
$File "portal\c_portal_radio.cpp"
$File "portal\portalrenderable_flatbasic.cpp"
$File "portal\portalrenderable_flatbasic.h"
$File "portal\vgui_portal_stats_display_screen.cpp"
$File "portal\vgui_neurotoxin_countdown_screen.cpp"
$File "$SRCDIR\game\shared\portal\portal_weapon_parse.cpp"
$Folder "Weapons"
{
$File "portal\c_weapon_physcannon.cpp"
$File "portal\c_weapon_portalgun.cpp"
$File "portal\c_weapon_portalgun.h"
$File "portal\c_weapon_stubs_portal.cpp"
$File "$SRCDIR\game\shared\portal\weapon_portalbase.cpp"
$File "$SRCDIR\game\shared\portal\weapon_portalbase.h"
$File "$SRCDIR\game\shared\portal\weapon_portalbasecombatweapon.cpp"
$File "$SRCDIR\game\shared\portal\weapon_portalbasecombatweapon.h"
$File "$SRCDIR\game\shared\portal\weapon_portalgun_shared.cpp"
$File "$SRCDIR\game\shared\portal\weapon_portalgun_shared.h"
}
}
}
}
-908
View File
@@ -1,908 +0,0 @@
//-----------------------------------------------------------------------------
// CLIENT_TF.VPC
//
// Project Script
//-----------------------------------------------------------------------------
$Macro SRCDIR "..\.."
$Macro GAMENAME "tf"
// This code currently only builds on Windows (itemtest_lib and dependencies)
$Macro WORKSHOP_IMPORT_ENABLE $WINDOWS
$Include "$SRCDIR\game\client\client_base.vpc"
$include "$SRCDIR\game\shared\tf\tf_gcmessages_include.vpc"
$Include "$SRCDIR\game\client\client_econ_base.vpc"
$Include "$SRCDIR\vpc_scripts\source_saxxyawards.vpc"
$Include "$SRCDIR\utils\itemtest_lib\itemtest_lib_support.vpc" [$WORKSHOP_IMPORT_ENABLE]
$Configuration
{
$Compiler
{
$AdditionalIncludeDirectories ".\hl2;.\hl2\elements;.\tf;.\tf\vgui;..\statemachine;$SRCDIR\game\shared\multiplayer;$SRCDIR\game\shared\tf;$SRCDIR\gcsdk\steamextra;$BASE;.\econ"
$PreprocessorDefinitions "$BASE;TF_CLIENT_DLL;USES_ECON_ITEMS;ENABLE_GC_MATCHMAKING;GLOWS_ENABLE;USE_DYNAMIC_ASSET_LOADING;SIXENSE;VOTING_ENABLED;NEXT_BOT"
$PreprocessorDefinitions "$BASE;SAXXYMAINMENU_ENABLED" [$SAXXYAWARDS_ENABLE]
$PreprocessorDefinitions "$BASE;WORKSHOP_IMPORT_ENABLED" [$WORKSHOP_IMPORT_ENABLE]
}
}
$Project "Client (TF)"
{
$Folder "Source Files"
{
-$File "$SRCDIR\game\shared\weapon_parse_default.cpp"
}
$Folder "Source Files"
{
$File "$SRCDIR\game\shared\basecombatweapon_shared.h"
$File "$SRCDIR\game\client\abuse_report.cpp"
$File "$SRCDIR\game\client\abuse_report.h"
$File "$SRCDIR\game\client\abuse_report_ui.cpp"
$File "$SRCDIR\game\client\abuse_report_ui.h"
$File "tf\tf_abuse_report.cpp"
$File "tf\tf_abuse_report.h"
$File "c_team_objectiveresource.cpp"
$File "c_team_objectiveresource.h"
$File "c_team_train_watcher.cpp"
$File "c_team_train_watcher.h"
$File "hud_base_account.cpp"
$File "hud_base_account.h"
$File "tf\hud_basedeathnotice.cpp"
$File "tf\hud_basedeathnotice.h"
$File "hud_controlpointicons.cpp"
$File "hud_voicestatus.cpp"
$File "hud_vguiscreencursor.cpp"
$File "hud_baseachievement_tracker.cpp"
$File "hud_baseachievement_tracker.h"
$File "$SRCDIR\game\client\hud_vote.h"
$File "$SRCDIR\game\client\hud_vote.cpp"
$File "$SRCDIR\game\shared\motd.cpp"
$File "$SRCDIR\game\shared\motd.h"
$File "$SRCDIR\game\shared\playerclass_info_parse.cpp"
$File "$SRCDIR\game\shared\playerclass_info_parse.h"
$File "$SRCDIR\game\shared\teamplay_round_timer.cpp"
$File "$SRCDIR\game\shared\teamplay_round_timer.h"
$File "$SRCDIR\common\ServerBrowser\blacklisted_server_manager.h"
$File "$SRCDIR\common\ServerBrowser\blacklisted_server_manager.cpp"
{
$Configuration
{
$Compiler
{
$Create/UsePrecompiledHeader "Not Using Precompiled Headers"
}
}
}
$File "TeamBitmapImage.cpp"
$File "voice_menu.cpp"
$File "$SRCDIR\common\GameUI\scriptobject.cpp"
{
$Configuration
{
$Compiler
{
$Create/UsePrecompiledHeader "Not Using Precompiled Headers"
}
}
}
$File "$SRCDIR\common\GameUI\scriptobject.h"
$File "$SRCDIR\common\GameUI\cvarslider.cpp"
{
$Configuration
{
$Compiler
{
$Create/UsePrecompiledHeader "Not Using Precompiled Headers"
}
}
}
$File "$SRCDIR\common\GameUI\cvarslider.h"
$Folder "Economy"
{
$File "$SRCDIR\game\shared\tf\tf_item_inventory.cpp"
$File "$SRCDIR\game\shared\tf\tf_item_inventory.h"
$File "$SRCDIR\game\shared\tf\tf_item_wearable.cpp"
$File "$SRCDIR\game\shared\tf\tf_item_wearable.h"
$File "$SRCDIR\game\shared\tf\tf_item_system.cpp"
$File "$SRCDIR\game\shared\tf\tf_item_system.h"
$File "$SRCDIR\game\shared\tf\tf_item_schema.cpp"
$File "$SRCDIR\game\shared\tf\tf_item_schema.h"
$File "$SRCDIR\game\shared\tf\tf_quest_editor_panel.h"
$File "$SRCDIR\game\shared\tf\tf_quest_editor_panel.cpp"
$File "$SRCDIR\game\shared\tf\tf_quest_restriction.h"
$File "$SRCDIR\game\shared\tf\tf_quest_restriction.cpp"
$File "$SRCDIR\game\shared\tf\tf_wardata.h"
$File "$SRCDIR\game\shared\tf\tf_wardata.cpp"
$File "$SRCDIR\game\shared\tf\tf_rating_data.h"
$File "$SRCDIR\game\shared\tf\tf_rating_data.cpp"
$File "$SRCDIR\game\shared\tf\tf_ladder_data.h"
$File "$SRCDIR\game\shared\tf\tf_ladder_data.cpp"
$File "$SRCDIR\game\shared\tf\tf_survey_questions.h"
$File "$SRCDIR\game\shared\tf\tf_survey_questions.cpp"
$File "$SRCDIR\game\shared\tf\tf_xp_source.h"
$File "$SRCDIR\game\shared\tf\tf_xp_source.cpp"
$File "$SRCDIR\game\shared\tf\tf_notification.h"
$File "$SRCDIR\game\shared\tf\tf_notification.cpp"
}
$Folder "Economy Client"
{
$File "econ\item_selection_panel.cpp"
$File "econ\item_selection_panel.h"
$Folder "Store"
{
$File "econ\store\store_page_halloween.cpp"
$File "econ\store\store_page_halloween.h"
}
}
$Folder "TF Economy Client Overrides"
{
$File "tf\vgui\tf_item_pickup_panel.cpp"
$File "tf\vgui\tf_item_pickup_panel.h"
$File "tf\vgui\store\tf_store.cpp"
$File "tf\vgui\store\tf_store.h"
$File "tf\vgui\store\tf_store_panel_base.h"
$File "tf\vgui\store\tf_store_panel_base.cpp"
$File "tf\vgui\store\tf_store_page_base.cpp"
$File "tf\vgui\store\tf_store_page_base.h"
$File "tf\vgui\store\tf_store_preview_item_base.cpp"
$File "tf\vgui\store\tf_store_preview_item_base.h"
$Folder "v1"
{
$File "tf\vgui\store\v1\tf_store_page.cpp"
$File "tf\vgui\store\v1\tf_store_page.h"
$File "tf\vgui\store\v1\tf_store_panel.cpp"
$File "tf\vgui\store\v1\tf_store_panel.h"
$File "tf\vgui\store\v1\tf_store_preview_item.cpp"
$File "tf\vgui\store\v1\tf_store_preview_item.h"
$File "tf\vgui\store\v1\tf_store_page_maps.cpp"
$File "tf\vgui\store\v1\tf_store_page_maps.h"
}
$Folder "v2"
{
$File "tf\vgui\store\v2\tf_store_page2.cpp"
$File "tf\vgui\store\v2\tf_store_page2.h"
$File "tf\vgui\store\v2\tf_store_panel2.cpp"
$File "tf\vgui\store\v2\tf_store_panel2.h"
$File "tf\vgui\store\v2\tf_store_preview_item2.cpp"
$File "tf\vgui\store\v2\tf_store_preview_item2.h"
$File "tf\vgui\store\v2\tf_store_page_maps2.cpp"
$File "tf\vgui\store\v2\tf_store_page_maps2.h"
$File "tf\vgui\store\v2\tf_store_mapstamps_info_dialog.cpp"
$File "tf\vgui\store\v2\tf_store_mapstamps_info_dialog.h"
}
}
$Folder "TF"
{
$File "$SRCDIR\game\shared\tf\tf_weapon_passtime_gun.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_passtime_gun.h"
$File "$SRCDIR\game\shared\tf\passtime_game_events.cpp"
$File "$SRCDIR\game\shared\tf\passtime_game_events.h"
$File "$SRCDIR\game\shared\tf\passtime_convars.cpp"
$File "$SRCDIR\game\shared\tf\passtime_convars.h"
$File "tf\c_func_passtime_goal.cpp"
$File "tf\c_func_passtime_goal.h"
$File "tf\c_tf_passtime_ball.cpp"
$File "tf\c_tf_passtime_ball.h"
$File "tf\c_tf_passtime_logic.cpp"
$File "tf\c_tf_passtime_logic.h"
$File "tf\tf_hud_passtime.cpp"
$File "tf\tf_hud_passtime.h"
$File "tf\tf_hud_passtime_ball_offscreen_arrow.cpp"
$File "tf\tf_hud_passtime_ball_offscreen_arrow.h"
$File "tf\tf_hud_passtime_reticle.cpp"
$File "tf\tf_hud_passtime_reticle.h"
$File "tf\c_tf_glow.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf.h"
$File "$SRCDIR\game\shared\tf\achievements_tf_demoman.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_engineer.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_heavy.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_medic.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_pyro.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_scout.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_sniper.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_soldier.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_spy.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_replay.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_maps.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_mvm.cpp"
$File "$SRCDIR\game\shared\tf\achievements_tf_halloween.cpp"
$File "$SRCDIR\game\shared\tf\baseobject_shared.cpp"
$File "$SRCDIR\game\shared\tf\baseobject_shared.h"
$File "tf\tf_autorp.cpp"
$File "tf\tf_autorp.h"
$File "tf\c_baseobject.cpp"
$File "tf\c_baseobject.h"
$File "tf\c_entity_bird.cpp"
$File "tf\c_entity_currencypack.cpp"
$File "tf\c_entity_currencypack.h"
$File "tf\c_func_forcefield.cpp"
$File "tf\c_func_respawnroom.cpp"
$File "tf\c_func_capture_zone.cpp"
$File "tf\c_func_capture_zone.h"
$File "tf\c_obj_dispenser.cpp"
$File "tf\c_obj_dispenser.h"
$File "tf\c_obj_sapper.cpp"
$File "tf\c_obj_sapper.h"
$File "tf\c_obj_sentrygun.cpp"
$File "tf\c_obj_sentrygun.h"
$File "tf\c_obj_teleporter.cpp"
$File "tf\c_obj_teleporter.h"
$File "tf\c_tf_stickybolt.cpp"
$File "tf\c_tf_death_callingcard.cpp"
$File "tf\c_playerattachedmodel.cpp"
$File "tf\c_playerattachedmodel.h"
$File "tf\c_playerrelativemodel.cpp"
$File "tf\c_playerrelativemodel.h"
$File "tf\c_tf_ammo_pack.cpp"
$File "tf\c_tf_ammo_pack.h"
$File "tf\c_tf_buff_banner.cpp"
$File "tf\c_tf_buff_banner.h"
$File "tf\c_tf_fx.cpp"
$File "tf\c_tf_fx.h"
$File "tf\c_tf_haptics.cpp"
$File "tf\c_tf_haptics.h"
$File "tf\c_tf_objective_resource.cpp"
$File "tf\c_tf_objective_resource.h"
$File "tf\c_tf_player.cpp"
$File "tf\c_tf_player.h"
$File "tf\c_tf_playerclass.h"
$File "tf\c_tf_playerresource.cpp"
$File "tf\c_tf_playerresource.h"
$File "tf\c_tf_team.cpp"
$File "tf\c_tf_team.h"
$File "tf\clientmode_tf.cpp"
$File "tf\clientmode_tf.h"
$File "$SRCDIR\game\shared\tf\entity_capture_flag.cpp"
$File "$SRCDIR\game\shared\tf\entity_capture_flag.h"
$File "$SRCDIR\game\shared\Multiplayer\multiplayer_animstate.cpp"
$File "$SRCDIR\game\shared\Multiplayer\multiplayer_animstate.h"
$File "tf\teammaterialproxy.cpp"
$File "tf\tf_demo_support.cpp"
$File "tf\tf_demo_support.h"
$File "tf\tf_fx_blood.cpp"
$File "tf\tf_fx_christmaslights.cpp"
$File "tf\tf_fx_ejectbrass.cpp"
$File "tf\tf_fx_impacts.cpp"
$File "tf\tf_fx_explosions.cpp"
$File "tf\tf_fx_muzzleflash.cpp"
$File "tf\tf_fx_muzzleflash.h"
$File "tf\tf_fx_particleeffect.cpp"
$File "tf\tf_fx_taunteffects.cpp"
$File "$SRCDIR\game\shared\tf\tf_fx_shared.cpp"
$File "$SRCDIR\game\shared\tf\tf_fx_shared.h"
$File "tf\tf_fx_tracers.cpp"
$File "$SRCDIR\game\shared\tf\tf_gamemovement.cpp"
$File "$SRCDIR\game\shared\tf\tf_gamerules.cpp"
$File "$SRCDIR\game\shared\tf\tf_gamerules.h"
$File "$SRCDIR\game\shared\tf\tf_classdata.cpp"
$File "$SRCDIR\game\shared\tf\tf_classdata.h"
$File "tf\tf_hud_account.cpp"
$File "tf\tf_hud_achievement_tracker.cpp"
$File "tf\tf_hud_alert.cpp"
$File "tf\tf_hud_ammostatus.cpp"
$File "tf\tf_hud_ammostatus.h"
$File "tf\tf_hud_annotationspanel.cpp"
$File "tf\tf_hud_annotationspanel.h"
$File "tf\tf_hud_arena_capturepoint.cpp"
$File "tf\tf_hud_arena_class_layout.cpp"
$File "tf\tf_hud_arena_class_layout.h"
$File "tf\tf_hud_item_progress_tracker.h"
$File "tf\tf_hud_item_progress_tracker.cpp"
$File "tf\tf_hud_arena_notification.cpp"
$File "tf\tf_hud_arena_player_count.cpp"
$File "tf\tf_hud_arena_player_count.h"
$File "tf\tf_hud_arena_vs_panel.cpp"
$File "tf\tf_hud_arena_vs_panel.h"
$File "tf\tf_hud_arena_winpanel.cpp"
$File "tf\tf_hud_arena_winpanel.h"
$File "tf\tf_hud_bowcharge.cpp"
$File "$SRCDIR\game\shared\tf\entity_bonuspack.cpp"
$File "$SRCDIR\game\shared\tf\entity_bonuspack.h"
$File "$SRCDIR\game\shared\tf\entity_halloween_pickup.cpp"
$File "$SRCDIR\game\shared\tf\entity_halloween_pickup.h"
$File "tf\tf_hud_boss_health.cpp"
$File "tf\tf_hud_boss_health.h"
$File "tf\tf_hud_building_status.cpp"
$File "tf\tf_hud_building_status.h"
$File "tf\tf_hud_chat.cpp"
$File "tf\tf_hud_chat.h"
$File "tf\tf_hud_match_status.cpp"
$File "tf\tf_hud_match_status.h"
$File "tf\tf_hud_crosshair.cpp"
$File "tf\tf_hud_crosshair.h"
$File "tf\tf_hud_damageindicator.cpp"
$File "tf\tf_hud_demomancharge.cpp"
$File "tf\tf_hud_demomanpipes.cpp"
$File "tf\tf_hud_deathnotice.cpp"
$File "tf\tf_hud_disguise_status.cpp"
$File "tf\tf_hud_escort.cpp"
$File "tf\tf_hud_escort.h"
$File "tf\tf_hud_flagstatus.cpp"
$File "tf\tf_hud_flagstatus.h"
$File "tf\tf_hud_robot_destruction_status.cpp"
$File "tf\tf_hud_robot_destruction_status.h"
$File "tf\tf_hud_freezepanel.cpp"
$File "tf\tf_hud_freezepanel.h"
$File "tf\tf_hud_inspectpanel.cpp"
$File "tf\tf_hud_inspectpanel.h"
$File "tf\tf_hud_itemeffectmeter.cpp"
$File "tf\tf_hud_itemeffectmeter.h"
$File "tf\tf_hud_mediccallers.cpp"
$File "tf\tf_hud_mediccallers.h"
$File "tf\tf_hud_mediccharge.cpp"
$File "tf\tf_hud_base_build_menu.h"
$File "tf\tf_hud_menu_engy_build.cpp"
$File "tf\tf_hud_menu_engy_build.h"
$File "tf\tf_hud_menu_eureka_teleport.cpp"
$File "tf\tf_hud_menu_eureka_teleport.h"
$File "tf\tf_hud_menu_engy_destroy.cpp"
$File "tf\tf_hud_menu_engy_destroy.h"
$File "tf\tf_hud_menu_spy_build.cpp"
$File "tf\tf_hud_menu_spy_build.h"
$File "tf\tf_hud_menu_spy_disguise.cpp"
$File "tf\tf_hud_menu_spy_disguise.h"
$File "tf\tf_hud_menu_taunt_selection.cpp"
$File "tf\tf_hud_menu_taunt_selection.h"
$File "tf\tf_hud_notification_panel.cpp"
$File "tf\tf_hud_notification_panel.h"
$File "tf\tf_hud_objectivestatus.cpp"
$File "tf\tf_hud_objectivestatus.h"
$File "tf\tf_hud_playerstatus.cpp"
$File "tf\tf_hud_playerstatus.h"
$File "tf\tf_hud_pve_winpanel.cpp"
$File "tf\tf_hud_pve_winpanel.h"
$File "tf\tf_hud_sapper_charge.cpp"
$File "tf\tf_hud_scope.cpp"
$File "tf\tf_hud_stalemate.cpp"
$File "tf\tf_hud_tournament.cpp"
$File "tf\tf_hud_tournament.h"
$File "tf\tf_hud_statpanel.cpp"
$File "tf\tf_hud_statpanel.h"
$File "tf\tf_hud_mann_vs_machine_loss.cpp"
$File "tf\tf_hud_mann_vs_machine_loss.h"
$File "tf\tf_hud_mann_vs_machine_stats.cpp"
$File "tf\tf_hud_mann_vs_machine_stats.h"
$File "tf\tf_hud_mann_vs_machine_status.cpp"
$File "tf\tf_hud_mann_vs_machine_status.h"
$File "tf\tf_hud_mann_vs_machine_scoreboard.cpp"
$File "tf\tf_hud_mann_vs_machine_scoreboard.h"
$File "tf\tf_hud_mann_vs_machine_victory.cpp"
$File "tf\tf_hud_mann_vs_machine_victory.h"
$File "tf\tf_hud_disconnect_prompt.h"
$File "tf\tf_hud_disconnect_prompt.cpp"
$File "tf\tf_hud_training.cpp"
$File "tf\tf_hud_training.h"
$File "tf\c_tf_gamestats.cpp"
$File "tf\c_tf_gamestats.h"
$File "$SRCDIR\game\shared\tf\tf_gamestats_shared.h"
$File "tf\tf_hud_mainmenuoverride.cpp"
$File "tf\tf_hud_mainmenuoverride.h"
$File "tf\tf_hud_minigame.cpp"
$File "tf\tf_hud_minigame.h"
$File "tf\tf_hud_saxxycontest.cpp"
$File "tf\tf_hud_saxxycontest.h"
$File "tf\tf_hud_spectator_extras.cpp"
$File "tf\tf_hud_spectator_extras.h"
$File "tf\tf_hud_target_id.cpp"
$File "tf\tf_hud_target_id.h"
$File "tf\tf_hud_teamgoal.cpp"
$File "tf\tf_hud_teamgoal_tournament.cpp"
$File "tf\tf_hud_teamgoal_tournament.h"
$File "tf\tf_hud_teamswitch.cpp"
$File "tf\tf_hud_teamswitch.h"
$File "tf\tf_hud_trainingmessage.cpp"
$File "tf\tf_hud_training_complete.cpp"
$File "tf\tf_hud_waitingforplayers_panel.cpp"
$File "tf\tf_hud_weaponselection.cpp"
$File "tf\tf_hud_winpanel.cpp"
$File "tf\tf_hud_winpanel.h"
$File "tf\vgui\tf_imagepanel.cpp"
$File "tf\vgui\tf_imagepanel.h"
$File "tf\vgui\tf_item_card_panel.cpp"
$File "tf\vgui\tf_item_card_panel.h"
$File "tf\vgui\tf_item_inspection_panel.cpp"
$File "tf\vgui\tf_item_inspection_panel.h"
$File "tf\vgui\tf_particlepanel.cpp"
$File "tf\vgui\tf_particlepanel.h"
$File "tf\vgui\tf_ping_panel.cpp"
$File "tf\vgui\tf_ping_panel.h"
$File "tf\tf_input_main.cpp"
$File "tf\tf_presence.cpp"
$File "tf\tf_presence.h"
$File "tf\tf_proxyentity.cpp"
$File "tf\tf_proxyentity.h"
$File "tf\tf_proxyplayer.cpp"
$File "tf\tf_rendertargets.cpp"
$File "tf\tf_rendertargets.h"
$File "$SRCDIR\game\shared\tf\tf_revive.cpp"
$File "$SRCDIR\game\shared\tf\tf_revive.h"
$File "tf\tf_shared_content_manager.cpp"
$File "tf\tf_shared_content_manager.h"
$File "tf\tf_steamstats.cpp"
$File "tf\tf_steamstats.h"
$File "tf\tf_teamstatus.cpp"
$File "tf\tf_teamstatus.h"
$File "tf\tf_time_panel.cpp"
$File "tf\tf_time_panel.h"
$File "tf\tf_tips.cpp"
$File "tf\tf_tips.h"
$File "tf\tf_viewrender.cpp"
$File "tf\tf_viewrender.h"
$File "tf\tf_coaching.cpp"
$File "tf\tf_gameserver_management.cpp"
$File "tf\tf_consumables.cpp"
$File "$SRCDIR\game\shared\tf\tf_mapinfo.h"
$File "$SRCDIR\game\shared\tf\tf_mapinfo.cpp"
$File "tf\c_tf_halloween.cpp"
$File "tf\c_monster_resource.cpp"
$File "tf\c_monster_resource.h"
$File "tf\c_tf_freeaccount.h"
$File "tf\c_tf_freeaccount.cpp"
$File "tf\c_tf_mvm_boss_progress_user.h"
$File "tf\c_tf_mvm_boss_progress_user.cpp"
$File "tf\c_tf_notification.h"
$File "tf\c_tf_notification.cpp"
$File "tf\c_tf_taunt_prop.h"
$File "tf\c_tf_taunt_prop.cpp"
$File "$SRCDIR\game\shared\tf\quest_objective_trackers.cpp"
$File "$SRCDIR\game\shared\tf\quest_objective_manager.cpp"
$File "$SRCDIR\game\shared\tf\quest_objective_manager.h"
$File "$SRCDIR\game\shared\tf\shared_object_tracker.cpp"
$File "$SRCDIR\game\shared\tf\shared_object_tracker.h"
$File "$SRCDIR\game\shared\tf\tf_halloween_souls_pickup.cpp"
$File "$SRCDIR\game\shared\tf\tf_halloween_souls_pickup.h"
$File "$SRCDIR\game\shared\tf\tf_item.cpp"
$File "$SRCDIR\game\shared\tf\tf_item.h"
$File "$SRCDIR\game\shared\tf\tf_obj_baseupgrade_shared.cpp"
$File "$SRCDIR\game\shared\tf\tf_obj_baseupgrade_shared.h"
$File "$SRCDIR\game\shared\tf\tf_item_powerup_bottle.cpp"
$File "$SRCDIR\game\shared\tf\tf_item_powerup_bottle.h"
$File "$SRCDIR\game\shared\tf\tf_condition.cpp"
$File "$SRCDIR\game\shared\tf\tf_condition.h"
$File "$SRCDIR\game\shared\tf\tf_player_shared.cpp"
$File "$SRCDIR\game\shared\tf\tf_player_shared.h"
$File "$SRCDIR\game\shared\tf\tf_playeranimstate.cpp"
$File "$SRCDIR\game\shared\tf\tf_playeranimstate.h"
$File "$SRCDIR\game\shared\tf\tf_playerclass_info_parse.cpp"
$File "$SRCDIR\game\shared\tf\tf_playerclass_shared.cpp"
$File "$SRCDIR\game\shared\tf\tf_playerclass_shared.h"
$File "tf\tf_prediction.cpp"
$File "$SRCDIR\game\shared\tf\tf_projectile_base.cpp"
$File "$SRCDIR\game\shared\tf\tf_projectile_base.h"
$File "$SRCDIR\game\shared\tf\tf_projectile_nail.cpp"
$File "$SRCDIR\game\shared\tf\tf_projectile_nail.h"
$File "$SRCDIR\game\shared\tf\tf_shareddefs.cpp"
$File "$SRCDIR\game\shared\tf\tf_shareddefs.h"
$File "$SRCDIR\game\shared\tf\tf_duckleaderboard.cpp"
$File "$SRCDIR\game\shared\tf\tf_duckleaderboard.h"
$File "$SRCDIR\game\shared\tf\tf_usermessages.cpp"
$File "$SRCDIR\game\shared\tf\tf_viewmodel.cpp"
$File "$SRCDIR\game\shared\tf\tf_viewmodel.h"
$File "$SRCDIR\game\shared\tf\tf_generic_bomb.cpp"
$File "$SRCDIR\game\shared\tf\tf_generic_bomb.h"
$File "$SRCDIR\game\shared\tf\tf_pumpkin_bomb.cpp"
$File "$SRCDIR\game\shared\tf\tf_pumpkin_bomb.h"
//$File "$SRCDIR\game\shared\tf\tf_target_dummy.cpp"
//$File "$SRCDIR\game\shared\tf\tf_target_dummy.h"
$File "$SRCDIR\game\shared\tf\tf_item_constants.h"
$File "$SRCDIR\game\shared\steamworks_gamestats.cpp"
$File "$SRCDIR\game\shared\steamworks_gamestats.h"
$File "$SRCDIR\game\shared\tf\tf_logic_halloween_2014.h"
$File "$SRCDIR\game\shared\tf\tf_logic_halloween_2014.cpp"
$File "$SRCDIR\game\shared\tf\tf_logic_robot_destruction.cpp"
$File "$SRCDIR\game\shared\tf\tf_logic_robot_destruction.h"
$File "$SRCDIR\game\shared\tf\tf_robot_destruction_robot.cpp"
$File "$SRCDIR\game\shared\tf\tf_robot_destruction_robot.h"
$File "$SRCDIR\game\shared\tf\tf_logic_player_destruction.cpp"
$File "$SRCDIR\game\shared\tf\tf_logic_player_destruction.h"
$File "$SRCDIR\game\shared\tf\tf_gamestats_shared.cpp"
{
$Configuration
{
$Compiler
{
$Create/UsePrecompiledHeader "Not Using Precompiled Headers"
}
}
}
$Folder "Weapon"
{
$File "tf\c_tf_projectile_arrow.cpp"
$File "tf\c_tf_projectile_arrow.h"
$File "tf\c_tf_projectile_energy_ball.cpp"
$File "tf\c_tf_projectile_energy_ball.h"
$File "$SRCDIR\game\shared\tf\tf_projectile_energy_ring.cpp"
$File "$SRCDIR\game\shared\tf\tf_projectile_energy_ring.h"
$File "tf\c_tf_projectile_flare.cpp"
$File "tf\c_tf_projectile_flare.h"
$File "tf\c_tf_projectile_rocket.cpp"
$File "tf\c_tf_projectile_rocket.h"
$File "tf\c_tf_weapon_builder.cpp"
$File "tf\c_tf_weapon_builder.h"
$File "$SRCDIR\game\shared\tf\tf_dropped_weapon.cpp"
$File "$SRCDIR\game\shared\tf\tf_dropped_weapon.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_bat.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_bat.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_bonesaw.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_bonesaw.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_bottle.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_bottle.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_buff_item.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_buff_item.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_club.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_club.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_compound_bow.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_compound_bow.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_fireaxe.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_fireaxe.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_fists.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_fists.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_flamethrower.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_flamethrower.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_grapplinghook.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_grapplinghook.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_grenade_pipebomb.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_grenade_pipebomb.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_grenadelauncher.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_grenadelauncher.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_invis.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_invis.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_jar.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_jar.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_knife.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_knife.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_laser_pointer.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_laser_pointer.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_lunchbox.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_lunchbox.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_medigun.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_medigun.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_minigun.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_minigun.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_parse.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_parse.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_parachute.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_parachute.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_particle_cannon.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_particle_cannon.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_pda.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_pda.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_pipebomblauncher.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_pipebomblauncher.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_pistol.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_pistol.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_raygun.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_raygun.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_revolver.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_revolver.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_rocketlauncher.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_rocketlauncher.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_shotgun.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_shotgun.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_shovel.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_shovel.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_smg.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_smg.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_sniperrifle.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_sniperrifle.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_sword.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_sword.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_syringegun.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_syringegun.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_throwable.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_throwable.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_wrench.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_wrench.h"
$File "$SRCDIR\game\shared\tf\tf_weaponbase.cpp"
$File "$SRCDIR\game\shared\tf\tf_weaponbase.h"
$File "$SRCDIR\game\shared\tf\tf_weaponbase_grenadeproj.cpp"
$File "$SRCDIR\game\shared\tf\tf_weaponbase_grenadeproj.h"
$File "$SRCDIR\game\shared\tf\tf_weaponbase_merasmus_grenade.cpp"
$File "$SRCDIR\game\shared\tf\tf_weaponbase_merasmus_grenade.h"
$File "$SRCDIR\game\shared\tf\tf_weaponbase_gun.cpp"
$File "$SRCDIR\game\shared\tf\tf_weaponbase_gun.h"
$File "$SRCDIR\game\shared\tf\tf_weaponbase_melee.cpp"
$File "$SRCDIR\game\shared\tf\tf_weaponbase_melee.h"
$File "$SRCDIR\game\shared\tf\tf_weaponbase_rocket.cpp"
$File "$SRCDIR\game\shared\tf\tf_weaponbase_rocket.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_flaregun.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_flaregun.h"
$File "$SRCDIR\game\shared\tf\tf_wearable_item_demoshield.cpp"
$File "$SRCDIR\game\shared\tf\tf_wearable_item_demoshield.h"
$File "$SRCDIR\game\shared\tf\tf_wearable_levelable_item.cpp"
$File "$SRCDIR\game\shared\tf\tf_wearable_levelable_item.h"
$File "$SRCDIR\game\shared\tf\tf_weapon_mechanical_arm.cpp"
$File "$SRCDIR\game\shared\tf\tf_weapon_mechanical_arm.h"
}
$Folder "Economy"
{
$File "$SRCDIR\game\shared\econ\econ_claimcode.cpp"
$File "$SRCDIR\game\shared\econ\econ_claimcode.h"
}
$Folder "Steam Workshop"
{
$File "$SRCDIR\game\shared\workshop\ugc_utils.h"
$File "$SRCDIR\game\shared\workshop\ugc_utils.cpp"
$File "$SRCDIR\game\client\steampublishedfiles\publish_file_dialog.h"
$File "$SRCDIR\game\client\steampublishedfiles\publish_file_dialog.cpp"
$File "$SRCDIR\game\client\tf\workshop\published_files.cpp"
$File "$SRCDIR\game\client\tf\workshop\item_import.h" [$WORKSHOP_IMPORT_ENABLE]
$File "$SRCDIR\game\client\tf\workshop\item_import.cpp" [$WORKSHOP_IMPORT_ENABLE]
$File "$SRCDIR\game\client\bsp_utils.cpp"
$File "$SRCDIR\game\client\bsp_utils.h"
}
$Folder "vgui"
{
$File "tf\vgui\backgroundpanel.cpp"
$File "tf\vgui\backgroundpanel.h"
$File "tf\vgui\blueprint_panel.cpp"
$File "tf\vgui\blueprint_panel.h"
$File "tf\vgui\crafting_panel.cpp"
$File "tf\vgui\crafting_panel.h"
$File "tf\vgui\character_info_panel.cpp"
$File "tf\vgui\character_info_panel.h"
$File "tf\vgui\charinfo_armory_subpanel.cpp"
$File "tf\vgui\charinfo_armory_subpanel.h"
$File "tf\vgui\charinfo_loadout_subpanel.cpp"
$File "tf\vgui\charinfo_loadout_subpanel.h"
$File "tf\vgui\class_loadout_panel.cpp"
$File "tf\vgui\class_loadout_panel.h"
$File "tf\vgui\dynamic_recipe_subpanel.cpp"
$File "tf\vgui\dynamic_recipe_subpanel.h"
$File "tf\vgui\drawing_panel.cpp"
$File "tf\vgui\drawing_panel.h"
$File "tf\vgui\crate_detail_panels.cpp"
$File "tf\vgui\crate_detail_panels.h"
$File "tf\vgui\quest_log_panel.cpp"
$File "tf\vgui\quest_log_panel.h"
$File "tf\vgui\quest_item_panel.cpp"
$File "tf\vgui\quest_item_panel.h"
$File "tf\vgui\quest_notification_panel.cpp"
$File "tf\vgui\quest_notification_panel.h"
$File "tf\vgui\item_ad_panel.cpp"
$File "tf\vgui\item_ad_panel.h"
$File "tf\vgui\item_quickswitch.cpp"
$File "tf\vgui\item_quickswitch.h"
$File "tf\vgui\item_slot_panel.cpp"
$File "tf\vgui\item_slot_panel.h"
$File "tf\vgui\loadout_preset_panel.cpp"
$File "tf\vgui\loadout_preset_panel.h"
$File "tf\vgui\tf_match_join_handlers.cpp"
$File "tf\vgui\tf_match_join_handlers.h"
$File "tf\vgui\tf_matchmaking_dashboard_new_match_found.cpp"
$File "tf\vgui\tf_matchmaking_dashboard_next_map_voting.cpp"
$File "tf\vgui\tf_matchmaking_dashboard_next_map_winner.cpp"
$File "tf\vgui\tf_matchmaking_dashboard.cpp"
$File "tf\vgui\tf_matchmaking_dashboard.h"
$File "tf\vgui\modelimagepanel.cpp"
$File "tf\vgui\modelimagepanel.h"
$File "tf\vgui\ObjectControlPanel.cpp"
$File "tf\vgui\ObjectControlPanel.h"
$File "tf\vgui\softline.cpp"
$File "tf\vgui\softline.h"
$File "tf\vgui\testitem_root.cpp"
$File "tf\vgui\testitem_root.h"
$File "tf\vgui\testitem_dialog.cpp"
$File "tf\vgui\testitem_dialog.h"
$File "tf\vgui\tf_badge_panel.cpp"
$File "tf\vgui\tf_badge_panel.h"
$File "tf\vgui\tf_classmenu.cpp"
$File "tf\vgui\tf_classmenu.h"
$File "tf\vgui\tf_clientscoreboard.cpp"
$File "tf\vgui\tf_clientscoreboard.h"
$File "tf\vgui\tf_controls.cpp"
$File "tf\vgui\tf_controls.h"
$File "tf\vgui\tf_giveawayitempanel.cpp"
$File "tf\vgui\tf_giveawayitempanel.h"
$File "tf\vgui\tf_mapinfomenu.cpp"
$File "tf\vgui\tf_mapinfomenu.h"
$File "tf\vgui\tf_playermodelpanel.cpp"
$File "tf\vgui\tf_playermodelpanel.h"
$File "tf\vgui\tf_intromenu.cpp"
$File "tf\vgui\tf_intromenu.h"
$File "tf\vgui\tf_match_summary.cpp"
$File "tf\vgui\tf_match_summary.h"
$File "tf\vgui\tf_roundinfo.cpp"
$File "tf\vgui\tf_roundinfo.h"
$File "tf\vgui\tf_spectatorgui.cpp"
$File "tf\vgui\tf_spectatorgui.h"
$File "tf\vgui\tf_playerpanel.cpp"
$File "tf\vgui\tf_playerpanel.h"
$File "tf\vgui\tf_teammenu.cpp"
$File "tf\vgui\tf_teammenu.h"
$File "tf\vgui\tf_arenateammenu.cpp"
$File "tf\vgui\tf_arenateammenu.h"
$File "tf\vgui\tf_statsummary.cpp"
$File "tf\vgui\tf_statsummary.h"
$File "tf\vgui\tf_textwindow.cpp"
$File "tf\vgui\tf_textwindow.h"
$File "tf\vgui\tf_viewport.cpp"
$File "tf\vgui\tf_viewport.h"
$File "tf\vgui\tf_vgui_video.cpp"
$File "tf\vgui\tf_vgui_video.h"
$File "tf\vgui\select_player_dialog.cpp"
$File "tf\vgui\select_player_dialog.h"
$File "tf\vgui\vgui_critpanel.cpp"
$File "tf\vgui\vgui_pda_panel.cpp"
$File "tf\vgui\vgui_rootpanel_tf.cpp"
$File "tf\vgui\vgui_rootpanel_tf.h"
$File "tf\vgui\vgui_rotation_slider.cpp"
$File "tf\vgui\vgui_rotation_slider.h"
$File "tf\vgui\tf_training_ui.cpp"
$File "tf\vgui\tf_mouseforwardingpanel.cpp"
$File "tf\vgui\tf_mouseforwardingpanel.h"
$File "tf\vgui\tf_lobbypanel.h"
$File "tf\vgui\tf_lobbypanel.cpp"
$File "tf\vgui\tf_lobbypanel_mvm.h"
$File "tf\vgui\tf_lobbypanel_mvm.cpp"
$File "tf\vgui\tf_lobbypanel_comp.h"
$File "tf\vgui\tf_lobbypanel_comp.cpp"
$File "tf\vgui\tf_lobbypanel_casual.h"
$File "tf\vgui\tf_lobbypanel_casual.cpp"
$File "tf\vgui\tf_lobby_container_frame.h"
$File "tf\vgui\tf_lobby_container_frame.cpp"
$File "tf\vgui\tf_lobby_container_frame_comp.h"
$File "tf\vgui\tf_lobby_container_frame_comp.cpp"
$File "tf\vgui\tf_lobby_container_frame_casual.h"
$File "tf\vgui\tf_lobby_container_frame_casual.cpp"
$File "tf\vgui\tf_lobby_container_frame_mvm.h"
$File "tf\vgui\tf_lobby_container_frame_mvm.cpp"
$File "tf\vgui\tf_layeredmappanel.cpp"
$File "tf\vgui\tf_layeredmappanel.h"
$File "tf\vgui\tf_pvp_rank_panel.h"
$File "tf\vgui\tf_pvp_rank_panel.cpp"
$File "tf\vgui\tf_warinfopanel.cpp"
$File "tf\vgui\tf_warinfopanel.h"
$File "tf\vgui\tf_asyncpanel.cpp"
$File "tf\vgui\tf_asyncpanel.h"
$File "tf\vgui\tf_leaderboardpanel.cpp"
$File "tf\vgui\tf_leaderboardpanel.h"
$File "tf\vgui\strange_count_transfer_panel.cpp"
$File "tf\vgui\strange_count_transfer_panel.h"
$File "tf\vgui\collection_crafting_panel.cpp"
$File "tf\vgui\collection_crafting_panel.h"
$File "tf\vgui\halloween_offering_panel.cpp"
$File "tf\vgui\halloween_offering_panel.h"
$File "tf\vgui\sc_hinticon.cpp"
$File "tf\vgui\sc_hinticon.h"
$File "tf\vgui\report_player_dialog.cpp"
$File "tf\vgui\report_player_dialog.h"
$File "tf\tf_streams.h"
$File "tf\tf_streams.cpp"
}
$Folder "halloween"
{
$File "tf\halloween\c_headless_hatman.cpp"
$File "tf\halloween\c_headless_hatman.h"
$File "tf\halloween\c_eyeball_boss.cpp"
$File "tf\halloween\c_eyeball_boss.h"
$File "tf\halloween\c_merasmus.cpp"
$File "tf\halloween\c_merasmus.h"
$File "tf\halloween\c_merasmus_dancer.cpp"
$File "tf\halloween\c_merasmus_dancer.h"
$File "tf\halloween\c_zombie.cpp"
$File "tf\halloween\c_zombie.h"
$File "$SRCDIR\game\shared\tf\halloween\eyeball_boss\teleport_vortex.cpp"
$File "$SRCDIR\game\shared\tf\halloween\eyeball_boss\teleport_vortex.h"
$File "$SRCDIR\game\shared\tf\halloween\tf_weapon_spellbook.cpp"
$File "$SRCDIR\game\shared\tf\halloween\tf_weapon_spellbook.h"
}
$Folder "Bot NPC"
{
$File "tf\bot_npc\c_bot_npc.cpp"
$File "tf\bot_npc\c_bot_npc.h"
$File "tf\bot_npc\c_bot_npc_minion.cpp"
$File "tf\bot_npc\c_bot_npc_minion.h"
$Folder "MapEntities"
{
$File "tf\bot_npc\map_entities\c_tf_bot_hint_engineer_nest.cpp"
$File "tf\bot_npc\map_entities\c_tf_bot_hint_engineer_nest.h"
}
}
$Folder "NextBot"
{
$File "NextBot\C_NextBot.cpp"
$File "NextBot\C_NextBot.h"
}
$Folder "PvE"
{
$File "tf\player_vs_environment\c_boss_alpha.cpp"
$File "tf\player_vs_environment\c_boss_alpha.h"
$File "tf\player_vs_environment\c_tf_base_boss.cpp"
$File "tf\player_vs_environment\c_tf_base_boss.h"
$File "tf\player_vs_environment\c_tf_tank_boss.cpp"
$File "tf\player_vs_environment\c_tf_tank_boss.h"
$File "tf\player_vs_environment\c_tf_upgrades.cpp"
$File "tf\player_vs_environment\c_tf_upgrades.h"
$File "$SRCDIR\game\shared\tf\tf_mann_vs_machine_stats.cpp"
$File "$SRCDIR\game\shared\tf\tf_mann_vs_machine_stats.h"
$File "$SRCDIR\game\shared\tf\tf_upgrades_shared.cpp"
$File "$SRCDIR\game\shared\tf\tf_upgrades_shared.h"
}
$Folder "Matchmaking"
{
$File "$SRCDIR\game\client\tf\tf_gc_client.cpp"
$File "$SRCDIR\game\client\tf\tf_gc_client.h"
$File "$SRCDIR\game\shared\party.cpp"
$File "$SRCDIR\game\shared\party.h"
$File "$SRCDIR\game\shared\playergroup.cpp"
$File "$SRCDIR\game\shared\playergroup.h"
$File "$SRCDIR\game\shared\lobby.cpp"
$File "$SRCDIR\game\shared\lobby.h"
$File "$SRCDIR\game\shared\tf\tf_party.cpp"
$File "$SRCDIR\game\shared\tf\tf_party.h"
// For now, clients are subscribed to the server lobby object. In the future we want to give clients a
// smaller subset, at which point we don't need this file (and the file should be moved shared->server)
$File "$SRCDIR\game\shared\tf\tf_lobby_server.cpp"
$File "$SRCDIR\game\shared\tf\tf_lobby_server.h"
$File "$SRCDIR\game\shared\tf\tf_matchmaking_shared.h"
$File "$SRCDIR\game\shared\tf\tf_matchmaking_shared.cpp"
$File "$SRCDIR\game\shared\tf\tf_match_description.cpp"
$File "$SRCDIR\game\shared\tf\tf_match_description.h"
$File "$SRCDIR\game\shared\tf\tf_gc_shared.h"
}
}
$Folder "game_controls"
{
$File "game_controls\buymenu.cpp"
$File "game_controls\buysubmenu.cpp"
$File "game_controls\classmenu.cpp"
}
$Folder "IFM"
{
$File "$SRCDIR\game\shared\weapon_ifmbase.cpp"
$File "$SRCDIR\game\shared\weapon_ifmbase.h"
$File "$SRCDIR\game\shared\weapon_ifmbasecamera.cpp"
$File "$SRCDIR\game\shared\weapon_ifmbasecamera.h"
$File "$SRCDIR\game\shared\weapon_ifmsteadycam.cpp"
}
$Folder "Replay"
{
$File "tf/tf_replay.cpp"
$File "tf/tf_replay.h"
}
}
$Folder "Useful non-source files" [!$ANALYZE && !$BUILDBOT]
{
$File "$SRCDIR\..\game\tf\scripts\HudAnimations_tf.txt"
$File "$SRCDIR\..\game\tf\resource\tf_english.txt"
$File "$SRCDIR\..\game\tf\resource\ModEvents.res"
$File "$SRCDIR\..\game\tf\resource\ClientScheme.res"
}
$Folder "Link libraries"
{
$ImplibExternal "steamnetworkingsockets"
}
}
+2 -4
View File
@@ -213,7 +213,6 @@ void CalcFovFromProjection ( float *pFov, const VMatrix &proj )
Assert ( proj.m[3][2] == -1.0f );
Assert ( proj.m[3][3] == 0.0f );
/*
// The math here:
// A view-space vector (x,y,z,1) is transformed by the projection matrix
// / xscale 0 xoffset 0 \
@@ -228,7 +227,6 @@ void CalcFovFromProjection ( float *pFov, const VMatrix &proj )
// = xscale*(x/z) + xoffset (I flipped the signs of both sides)
// => (+-1 - xoffset)/xscale = x/z
// ...and x/z is tan(theta), and theta is the half-FOV.
*/
float fov_px = 2.0f * RAD2DEG ( atanf ( fabsf ( ( 1.0f - xoffset ) / xscale ) ) );
float fov_nx = 2.0f * RAD2DEG ( atanf ( fabsf ( ( -1.0f - xoffset ) / xscale ) ) );
@@ -414,8 +412,8 @@ void CClientVirtualReality::DrawMainMenu()
// render both eyes
for( int nView = STEREO_EYE_LEFT; nView <= STEREO_EYE_RIGHT; nView++ )
{
CMatRenderContextPtr pRenderContextMat( materials );
PIXEvent pixEvent( pRenderContextMat, nView == STEREO_EYE_LEFT ? "left eye" : "right eye" );
CMatRenderContextPtr pRenderContext( materials );
PIXEvent pixEvent( pRenderContext, nView == STEREO_EYE_LEFT ? "left eye" : "right eye" );
ITexture *pColor = g_pSourceVR->GetRenderTarget( (ISourceVirtualReality::VREye)(nView-1), ISourceVirtualReality::RT_Color );
ITexture *pDepth = g_pSourceVR->GetRenderTarget( (ISourceVirtualReality::VREye)(nView-1), ISourceVirtualReality::RT_Depth );
-68
View File
@@ -354,67 +354,6 @@ void CClientEntityList::OnAddEntity( IHandleEntity *pEnt, CBaseHandle handle )
}
#if defined( STAGING_ONLY )
// Defined in tier1 / interface.cpp for Windows and native for POSIX platforms.
extern "C" int backtrace( void **buffer, int size );
static struct
{
int entnum;
float time;
C_BaseEntity *pBaseEntity;
void *backtrace_addrs[ 16 ];
} g_RemoveEntityBacktraces[ 1024 ];
static uint32 g_RemoveEntityBacktracesIndex = 0;
static void OnRemoveEntityBacktraceHook( int entnum, C_BaseEntity *pBaseEntity )
{
int index = g_RemoveEntityBacktracesIndex++;
if ( g_RemoveEntityBacktracesIndex >= ARRAYSIZE( g_RemoveEntityBacktraces ) )
g_RemoveEntityBacktracesIndex = 0;
g_RemoveEntityBacktraces[ index ].entnum = entnum;
g_RemoveEntityBacktraces[ index ].time = gpGlobals->curtime;
g_RemoveEntityBacktraces[ index ].pBaseEntity = pBaseEntity;
memset( g_RemoveEntityBacktraces[ index ].backtrace_addrs, 0, sizeof( g_RemoveEntityBacktraces[ index ].backtrace_addrs ) );
backtrace( g_RemoveEntityBacktraces[ index ].backtrace_addrs, ARRAYSIZE( g_RemoveEntityBacktraces[ index ].backtrace_addrs ) );
}
// Should help us track down CL_PreserveExistingEntity Host_Error() issues:
// 1. Set cl_removeentity_backtrace_capture to 1.
// 2. When error hits, run "cl_removeentity_backtrace_dump [entnum]".
// 3. In debugger, track down what functions the spewed addresses refer to.
static ConVar cl_removeentity_backtrace_capture( "cl_removeentity_backtrace_capture", "0", 0,
"For debugging. Capture backtraces for CClientEntityList::OnRemoveEntity calls." );
CON_COMMAND( cl_removeentity_backtrace_dump, "Dump backtraces for client OnRemoveEntity calls." )
{
if ( !cl_removeentity_backtrace_capture.GetBool() )
{
Msg( "cl_removeentity_backtrace_dump error: cl_removeentity_backtrace_capture not enabled. Backtraces not captured.\n" );
return;
}
int entnum = ( args.ArgC() >= 2 ) ? atoi( args[ 1 ] ) : -1;
for ( int i = 0; i < ARRAYSIZE( g_RemoveEntityBacktraces ); i++ )
{
if ( g_RemoveEntityBacktraces[ i ].time &&
( entnum == -1 || g_RemoveEntityBacktraces[ i ].entnum == entnum ) )
{
Msg( "%d: time:%.2f pBaseEntity:%p\n", g_RemoveEntityBacktraces[i].entnum,
g_RemoveEntityBacktraces[ i ].time, g_RemoveEntityBacktraces[ i ].pBaseEntity );
for ( int j = 0; j < ARRAYSIZE( g_RemoveEntityBacktraces[ i ].backtrace_addrs ); j++ )
{
Msg( " %p\n", g_RemoveEntityBacktraces[ i ].backtrace_addrs[ j ] );
}
}
}
}
#endif // STAGING_ONLY
void CClientEntityList::OnRemoveEntity( IHandleEntity *pEnt, CBaseHandle handle )
{
@@ -441,13 +380,6 @@ void CClientEntityList::OnRemoveEntity( IHandleEntity *pEnt, CBaseHandle handle
C_BaseEntity *pBaseEntity = pUnknown->GetBaseEntity();
#if defined( STAGING_ONLY )
if ( cl_removeentity_backtrace_capture.GetBool() )
{
OnRemoveEntityBacktraceHook( entnum, pBaseEntity );
}
#endif // STAGING_ONLY
if ( pBaseEntity )
{
if ( pBaseEntity->ObjectCaps() & FCAP_SAVE_NON_NETWORKABLE )
+11 -59
View File
@@ -189,12 +189,12 @@ private:
void RemoveShadowFromLeaves( ClientLeafShadowHandle_t handle );
// Methods associated with the various bi-directional sets
static unsigned int& FirstRenderableInLeaf( int leaf )
static unsigned short& FirstRenderableInLeaf( int leaf )
{
return s_ClientLeafSystem.m_Leaf[leaf].m_FirstElement;
}
static unsigned int& FirstLeafInRenderable( unsigned short renderable )
static unsigned short& FirstLeafInRenderable( unsigned short renderable )
{
return s_ClientLeafSystem.m_Renderables[renderable].m_LeafList;
}
@@ -248,8 +248,8 @@ private:
int m_RenderFrame2;
int m_EnumCount; // Have I been added to a particular shadow yet?
int m_TranslucencyCalculated;
unsigned int m_LeafList; // What leafs is it in?
unsigned int m_RenderLeaf; // What leaf do I render in?
unsigned short m_LeafList; // What leafs is it in?
unsigned short m_RenderLeaf; // What leaf do I render in?
unsigned char m_Flags; // rendering flags
unsigned char m_RenderGroup; // RenderGroup_t type
unsigned short m_FirstShadow; // The first shadow caster that cast on it
@@ -260,7 +260,7 @@ private:
// The leaf contains an index into a list of renderables
struct ClientLeaf_t
{
unsigned int m_FirstElement;
unsigned short m_FirstElement;
unsigned short m_FirstShadow;
unsigned short m_FirstDetailProp;
@@ -302,7 +302,7 @@ private:
CUtlLinkedList< ShadowInfo_t, ClientLeafShadowHandle_t, false, unsigned int > m_Shadows;
// Maintains the list of all renderables in a particular leaf
CBidirectionalSet< int, ClientRenderHandle_t, unsigned int, unsigned int > m_RenderablesInLeaf;
CBidirectionalSet< int, ClientRenderHandle_t, unsigned short, unsigned int > m_RenderablesInLeaf;
// Maintains a list of all shadows in a particular leaf
CBidirectionalSet< int, ClientLeafShadowHandle_t, unsigned short, unsigned int > m_ShadowsInLeaf;
@@ -343,8 +343,7 @@ void DefaultRenderBoundsWorldspace( IClientRenderable *pRenderable, Vector &absM
{
// Tracker 37433: This fixes a bug where if the stunstick is being wielded by a combine soldier, the fact that the stick was
// attached to the soldier's hand would move it such that it would get frustum culled near the edge of the screen.
IClientUnknown *pUnk = pRenderable->GetIClientUnknown();
C_BaseEntity *pEnt = pUnk->GetBaseEntity();
C_BaseEntity *pEnt = pRenderable->GetIClientUnknown()->GetBaseEntity();
if ( pEnt && pEnt->IsFollowingEntity() )
{
C_BaseEntity *pParent = pEnt->GetFollowedEntity();
@@ -630,7 +629,7 @@ void CClientLeafSystem::NewRenderable( IClientRenderable* pRenderable, RenderGro
info.m_Flags = flags;
info.m_RenderGroup = (unsigned char)type;
info.m_EnumCount = 0;
info.m_RenderLeaf = m_RenderablesInLeaf.InvalidIndex();
info.m_RenderLeaf = 0xFFFF;
if ( IsViewModelRenderGroup( (RenderGroup_t)info.m_RenderGroup ) )
{
AddToViewModelList( handle );
@@ -987,7 +986,7 @@ void CClientLeafSystem::AddShadowToLeaf( int leaf, ClientLeafShadowHandle_t shad
m_ShadowsInLeaf.AddElementToBucket( leaf, shadow );
// Add the shadow exactly once to all renderables in the leaf
unsigned int i = m_RenderablesInLeaf.FirstElement( leaf );
unsigned short i = m_RenderablesInLeaf.FirstElement( leaf );
while ( i != m_RenderablesInLeaf.InvalidIndex() )
{
ClientRenderHandle_t renderable = m_RenderablesInLeaf.Element(i);
@@ -1093,53 +1092,6 @@ void CClientLeafSystem::AddRenderableToLeaf( int leaf, ClientRenderHandle_t rend
#ifdef VALIDATE_CLIENT_LEAF_SYSTEM
m_RenderablesInLeaf.ValidateAddElementToBucket( leaf, renderable );
#endif
#ifdef DUMP_RENDERABLE_LEAFS
static uint32 count = 0;
if (count < m_RenderablesInLeaf.NumAllocated())
{
count = m_RenderablesInLeaf.NumAllocated();
Msg("********** frame: %d count:%u ***************\n", gpGlobals->framecount, count );
if (count >= 20000)
{
for (int j = 0; j < m_RenderablesInLeaf.NumAllocated(); j++)
{
const ClientRenderHandle_t& renderable = m_RenderablesInLeaf.Element(j);
RenderableInfo_t& info = m_Renderables[renderable];
char pTemp[256];
const char *pClassName = "<unknown renderable>";
C_BaseEntity *pEnt = info.m_pRenderable->GetIClientUnknown()->GetBaseEntity();
if ( pEnt )
{
pClassName = pEnt->GetClassname();
}
else
{
CNewParticleEffect *pEffect = dynamic_cast< CNewParticleEffect*>( info.m_pRenderable );
if ( pEffect )
{
Vector mins, maxs;
pEffect->GetRenderBounds(mins, maxs);
Q_snprintf( pTemp, sizeof(pTemp), "ps: %s %.2f,%.2f", pEffect->GetEffectName(), maxs.x - mins.x, maxs.y - mins.y );
pClassName = pTemp;
}
else if ( dynamic_cast< CParticleEffectBinding* >( info.m_pRenderable ) )
{
pClassName = "<old particle system>";
}
}
Msg(" %d: %p group:%d %s %d %d TransCalc:%d renderframe:%d\n", j, info.m_pRenderable, info.m_RenderGroup, pClassName,
info.m_LeafList, info.m_RenderLeaf, info.m_TranslucencyCalculated, info.m_RenderFrame);
}
DebuggerBreak();
}
}
#endif // DUMP_RENDERABLE_LEAFS
m_RenderablesInLeaf.AddElementToBucket( leaf, renderable );
if ( !ShouldRenderableReceiveShadow( renderable, SHADOW_FLAGS_PROJECTED_TEXTURE_TYPE_MASK ) )
@@ -1392,7 +1344,7 @@ void CClientLeafSystem::ComputeTranslucentRenderLeaf( int count, const LeafIndex
orderedList.AddToTail( LeafToMarker( leaf ) );
// iterate over all elements in this leaf
unsigned int idx = m_RenderablesInLeaf.FirstElement(leaf);
unsigned short idx = m_RenderablesInLeaf.FirstElement(leaf);
while (idx != m_RenderablesInLeaf.InvalidIndex())
{
RenderableInfo_t& info = m_Renderables[m_RenderablesInLeaf.Element(idx)];
@@ -1560,7 +1512,7 @@ void CClientLeafSystem::CollateRenderablesInLeaf( int leaf, int worldListLeafInd
AddRenderableToRenderList( *info.m_pRenderList, NULL, worldListLeafIndex, RENDER_GROUP_OPAQUE_ENTITY, NULL );
// Collate everything.
unsigned int idx = m_RenderablesInLeaf.FirstElement(leaf);
unsigned short idx = m_RenderablesInLeaf.FirstElement(leaf);
for ( ;idx != m_RenderablesInLeaf.InvalidIndex(); idx = m_RenderablesInLeaf.NextElement(idx) )
{
ClientRenderHandle_t handle = m_RenderablesInLeaf.Element(idx);
+25 -132
View File
@@ -63,7 +63,6 @@ extern ConVar replay_rendersetting_renderglow;
#if defined( TF_CLIENT_DLL )
#include "c_tf_player.h"
#include "econ_item_description.h"
#include "c_tf_team.h"
#endif
// memdbgon must be the last include file in a .cpp file!!!
@@ -86,12 +85,6 @@ extern ConVar v_viewmodel_fov;
extern ConVar voice_modenable;
extern bool IsInCommentaryMode( void );
extern const char* GetWearLocalizationString( float flWear );
CON_COMMAND( cl_reload_localization_files, "Reloads all localization files" )
{
g_pVGuiLocalize->ReloadLocalizationFiles();
}
#ifdef VOICE_VOX_ENABLE
void VoxCallback( IConVar *var, const char *oldString, float oldFloat )
@@ -148,7 +141,7 @@ CON_COMMAND( hud_reloadscheme, "Reloads hud layout and animation scripts." )
if ( !mode )
return;
mode->ReloadScheme(true);
mode->ReloadScheme();
}
#ifdef _DEBUG
@@ -255,13 +248,6 @@ static void __MsgFunc_VGUIMenu( bf_read &msg )
{
gHUD.SetScreenShotTime( gpGlobals->curtime + 1.0 ); // take a screenshot in 1 second
}
IGameEvent *event = gameeventmanager->CreateEvent( "ds_screenshot" );
if ( event )
{
event->SetFloat( "delay", 0.5f );
gameeventmanager->FireEventClientSide( event );
}
}
// is the server trying to show an MOTD panel? Check that it's allowed right now.
@@ -306,17 +292,10 @@ ClientModeShared::~ClientModeShared()
delete m_pViewport;
}
void ClientModeShared::ReloadScheme( bool flushLowLevel )
void ClientModeShared::ReloadScheme( void )
{
// Invalidate the global cache first.
if (flushLowLevel)
{
KeyValuesSystem()->InvalidateCache();
}
BuildGroup::ClearResFileCache();
m_pViewport->ReloadScheme( "resource/ClientScheme.res" );
ClearKeyValuesCache();
}
@@ -356,7 +335,7 @@ void ClientModeShared::Init()
Assert( m_pReplayReminderPanel );
#endif
ListenForGameEvent( "player_connect_client" );
ListenForGameEvent( "player_connect" );
ListenForGameEvent( "player_disconnect" );
ListenForGameEvent( "player_team" );
ListenForGameEvent( "server_cvar" );
@@ -442,7 +421,7 @@ void ClientModeShared::OverrideView( CViewSetup *pSetup )
if( ::input->CAM_IsThirdPerson() )
{
const Vector& cam_ofs = g_ThirdPersonManager.GetCameraOffsetAngles();
Vector cam_ofs = g_ThirdPersonManager.GetCameraOffsetAngles();
Vector cam_ofs_distance = g_ThirdPersonManager.GetFinalCameraOffset();
cam_ofs_distance *= g_ThirdPersonManager.GetDistanceFraction();
@@ -491,17 +470,8 @@ bool ClientModeShared::ShouldDrawEntity(C_BaseEntity *pEnt)
return true;
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
bool ClientModeShared::ShouldDrawParticles( )
{
#ifdef TF_CLIENT_DLL
C_TFPlayer *pTFPlayer = C_TFPlayer::GetLocalTFPlayer();
if ( pTFPlayer && !pTFPlayer->ShouldPlayerDrawParticles() )
return false;
#endif // TF_CLIENT_DLL
return true;
}
@@ -888,7 +858,7 @@ void ClientModeShared::LevelShutdown( void )
void ClientModeShared::Enable()
{
vgui::VPANEL pRoot = VGui_GetClientDLLRootPanel();
vgui::VPANEL pRoot = VGui_GetClientDLLRootPanel();;
// Add our viewport to the root panel.
if( pRoot != 0 )
@@ -915,7 +885,7 @@ void ClientModeShared::Enable()
void ClientModeShared::Disable()
{
vgui::VPANEL pRoot = VGui_GetClientDLLRootPanel();
vgui::VPANEL pRoot = VGui_GetClientDLLRootPanel();;
// Remove our viewport from the root panel.
if( pRoot != 0 )
@@ -944,7 +914,7 @@ void ClientModeShared::Layout()
m_pViewport->SetBounds(0, 0, wide, tall);
if ( changed )
{
ReloadScheme(false);
ReloadScheme();
}
}
}
@@ -976,7 +946,7 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
const char *eventname = event->GetName();
if ( Q_strcmp( "player_connect_client", eventname ) == 0 )
if ( Q_strcmp( "player_connect", eventname ) == 0 )
{
if ( !hudChat )
return;
@@ -988,7 +958,7 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
wchar_t wszLocalized[100];
wchar_t wszPlayerName[MAX_PLAYER_NAME_LENGTH];
g_pVGuiLocalize->ConvertANSIToUnicode( event->GetString("name"), wszPlayerName, sizeof(wszPlayerName) );
g_pVGuiLocalize->ConstructString_safe( wszLocalized, g_pVGuiLocalize->Find( "#game_player_joined_game" ), 1, wszPlayerName );
g_pVGuiLocalize->ConstructString( wszLocalized, sizeof( wszLocalized ), g_pVGuiLocalize->Find( "#game_player_joined_game" ), 1, wszPlayerName );
char szLocalized[100];
g_pVGuiLocalize->ConvertUnicodeToANSI( wszLocalized, szLocalized, sizeof(szLocalized) );
@@ -1024,11 +994,11 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
wchar_t wszLocalized[100];
if (IsPC())
{
g_pVGuiLocalize->ConstructString_safe( wszLocalized, g_pVGuiLocalize->Find( "#game_player_left_game" ), 2, wszPlayerName, wszReason );
g_pVGuiLocalize->ConstructString( wszLocalized, sizeof( wszLocalized ), g_pVGuiLocalize->Find( "#game_player_left_game" ), 2, wszPlayerName, wszReason );
}
else
{
g_pVGuiLocalize->ConstructString_safe( wszLocalized, g_pVGuiLocalize->Find( "#game_player_left_game" ), 1, wszPlayerName );
g_pVGuiLocalize->ConstructString( wszLocalized, sizeof( wszLocalized ), g_pVGuiLocalize->Find( "#game_player_left_game" ), 1, wszPlayerName );
}
char szLocalized[100];
@@ -1061,12 +1031,6 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
wchar_t wszPlayerName[MAX_PLAYER_NAME_LENGTH];
g_pVGuiLocalize->ConvertANSIToUnicode( pszName, wszPlayerName, sizeof(wszPlayerName) );
bool bUsingCustomTeamName = false;
#ifdef TF_CLIENT_DLL
C_TFTeam *pTeam = GetGlobalTFTeam( team );
const wchar_t *wszTeam = pTeam ? pTeam->Get_Localized_Name() : L"";
bUsingCustomTeamName = pTeam ? pTeam->IsUsingCustomTeamName() : false;
#else
wchar_t wszTeam[64];
C_Team *pTeam = GetGlobalTeam( team );
if ( pTeam )
@@ -1077,18 +1041,17 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
{
_snwprintf ( wszTeam, sizeof( wszTeam ) / sizeof( wchar_t ), L"%d", team );
}
#endif
if ( !IsInCommentaryMode() )
{
wchar_t wszLocalized[100];
if ( bAutoTeamed )
{
g_pVGuiLocalize->ConstructString_safe( wszLocalized, bUsingCustomTeamName ? g_pVGuiLocalize->Find( "#game_player_joined_autoteam_party_leader" ) : g_pVGuiLocalize->Find( "#game_player_joined_autoteam" ), 2, wszPlayerName, wszTeam );
g_pVGuiLocalize->ConstructString( wszLocalized, sizeof( wszLocalized ), g_pVGuiLocalize->Find( "#game_player_joined_autoteam" ), 2, wszPlayerName, wszTeam );
}
else
{
g_pVGuiLocalize->ConstructString_safe( wszLocalized, bUsingCustomTeamName ? g_pVGuiLocalize->Find( "#game_player_joined_team_party_leader" ) : g_pVGuiLocalize->Find( "#game_player_joined_team" ), 2, wszPlayerName, wszTeam );
g_pVGuiLocalize->ConstructString( wszLocalized, sizeof( wszLocalized ), g_pVGuiLocalize->Find( "#game_player_joined_team" ), 2, wszPlayerName, wszTeam );
}
char szLocalized[100];
@@ -1120,7 +1083,7 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
g_pVGuiLocalize->ConvertANSIToUnicode( event->GetString( "newname" ), wszNewName, sizeof(wszNewName) );
wchar_t wszLocalized[100];
g_pVGuiLocalize->ConstructString_safe( wszLocalized, g_pVGuiLocalize->Find( "#game_player_changed_name" ), 2, wszOldName, wszNewName );
g_pVGuiLocalize->ConstructString( wszLocalized, sizeof( wszLocalized ), g_pVGuiLocalize->Find( "#game_player_changed_name" ), 2, wszOldName, wszNewName );
char szLocalized[100];
g_pVGuiLocalize->ConvertUnicodeToANSI( wszLocalized, szLocalized, sizeof(szLocalized) );
@@ -1134,14 +1097,16 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
bool bValidTeam = false;
if ( (GetLocalTeam() && GetLocalTeam()->GetTeamNumber() == team) )
{
bValidTeam = true;
}
//If we're in the spectator team then we should be getting whatever messages the person I'm spectating gets.
if ( bValidTeam == false )
{
CBasePlayer *pSpectatorTarget = UTIL_PlayerByIndex( GetSpectatorTarget() );
if ( pSpectatorTarget && (GetSpectatorMode() == OBS_MODE_IN_EYE || GetSpectatorMode() == OBS_MODE_CHASE || GetSpectatorMode() == OBS_MODE_POI) )
if ( pSpectatorTarget && (GetSpectatorMode() == OBS_MODE_IN_EYE || GetSpectatorMode() == OBS_MODE_CHASE) )
{
if ( pSpectatorTarget->GetTeamNumber() == team )
{
@@ -1177,7 +1142,7 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
g_pVGuiLocalize->ConvertANSIToUnicode( event->GetString("cvarvalue"), wszCvarValue, sizeof(wszCvarValue) );
wchar_t wszLocalized[256];
g_pVGuiLocalize->ConstructString_safe( wszLocalized, g_pVGuiLocalize->Find( "#game_server_cvar_changed" ), 2, wszCvarName, wszCvarValue );
g_pVGuiLocalize->ConstructString( wszLocalized, sizeof( wszLocalized ), g_pVGuiLocalize->Find( "#game_server_cvar_changed" ), 2, wszCvarName, wszCvarValue );
char szLocalized[256];
g_pVGuiLocalize->ConvertUnicodeToANSI( wszLocalized, szLocalized, sizeof(szLocalized) );
@@ -1226,7 +1191,7 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
if ( pchLocalizedAchievement )
{
wchar_t wszLocalizedString[128];
g_pVGuiLocalize->ConstructString_safe( wszLocalizedString, g_pVGuiLocalize->Find( "#Achievement_Earned" ), 2, wszPlayerName, pchLocalizedAchievement );
g_pVGuiLocalize->ConstructString( wszLocalizedString, sizeof( wszLocalizedString ), g_pVGuiLocalize->Find( "#Achievement_Earned" ), 2, wszPlayerName, pchLocalizedAchievement );
char szLocalized[128];
g_pVGuiLocalize->ConvertUnicodeToANSI( wszLocalizedString, szLocalized, sizeof( szLocalized ) );
@@ -1244,14 +1209,10 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
entityquality_t iItemQuality = event->GetInt( "quality" );
int iMethod = event->GetInt( "method" );
int iItemDef = event->GetInt( "itemdef" );
bool bIsStrange = event->GetInt( "isstrange" );
bool bIsUnusual = event->GetInt( "isunusual" );
float flWear = event->GetFloat( "wear" );
C_BasePlayer *pPlayer = UTIL_PlayerByIndex( iPlayerIndex );
const GameItemDefinition_t *pItemDefinition = dynamic_cast<GameItemDefinition_t *>( GetItemSchema()->GetItemDefinition( iItemDef ) );
if ( !pPlayer || !pItemDefinition || pItemDefinition->IsHidden() )
if ( !pPlayer || !pItemDefinition )
return;
if ( g_PR )
@@ -1271,85 +1232,19 @@ void ClientModeShared::FireGameEvent( IGameEvent *event )
_snwprintf( wszItemFound, ARRAYSIZE( wszItemFound ), L"%ls", g_pVGuiLocalize->Find( pszLocString ) );
wchar_t *colorMarker = wcsstr( wszItemFound, L"::" );
const CEconItemRarityDefinition* pItemRarity = GetItemSchema()->GetRarityDefinition( pItemDefinition->GetRarity() );
if ( colorMarker )
{
if ( pItemRarity )
{
attrib_colors_t colorRarity = pItemRarity->GetAttribColor();
vgui::HScheme scheme = vgui::scheme()->GetScheme( "ClientScheme" );
vgui::IScheme *pScheme = vgui::scheme()->GetIScheme( scheme );
Color color = pScheme->GetColor( GetColorNameForAttribColor( colorRarity ), Color( 255, 255, 255, 255 ) );
hudChat->SetCustomColor( color );
}
else
{
const char *pszQualityColorString = EconQuality_GetColorString( (EEconItemQuality)iItemQuality );
if ( pszQualityColorString )
{
hudChat->SetCustomColor( pszQualityColorString );
}
}
*(colorMarker+1) = COLOR_CUSTOM;
}
}
// TODO: Update the localization strings to only have two format parameters since that's all we need.
locchar_t wszLocalizedString[256];
locchar_t szItemname[64] = LOCCHAR( "" );
locchar_t szRarity[64] = LOCCHAR( "" );
locchar_t szWear[64] = LOCCHAR( "" );
locchar_t szStrange[64] = LOCCHAR( "" );
locchar_t szUnusual[64] = LOCCHAR( "" );
loc_scpy_safe(
szItemname,
CConstructLocalizedString(g_pVGuiLocalize->Find("TFUI_InvTooltip_ItemFound_Itemname"),
CEconItemLocalizedFullNameGenerator(GLocalizationProvider(), pItemDefinition, iItemQuality).GetFullName() )
);
/*g_pVGuiLocalize->ConstructString_safe(
szItemname,
LOCCHAR( "%s1 " ),
1,
CEconItemLocalizedFullNameGenerator( GLocalizationProvider(), pItemDefinition, iItemQuality ).GetFullName()
);*/
locchar_t tempName[MAX_ITEM_NAME_LENGTH];
// If items have rarity
if ( pItemRarity )
{
// Weapon Wear
if ( !IsWearableSlot( pItemDefinition->GetDefaultLoadoutSlot() ) )
{
loc_scpy_safe(szWear, CConstructLocalizedString( g_pVGuiLocalize->Find("TFUI_InvTooltip_ItemFound_Wear"), g_pVGuiLocalize->Find(GetWearLocalizationString(flWear) ) ) );
}
// Rarity / grade
loc_scpy_safe(szRarity, CConstructLocalizedString(g_pVGuiLocalize->Find("TFUI_InvTooltip_ItemFound_Rarity"), g_pVGuiLocalize->Find(pItemRarity->GetLocKey() ) ) );
}
if ( bIsUnusual )
{
loc_scpy_safe(szUnusual, CConstructLocalizedString(g_pVGuiLocalize->Find("TFUI_InvTooltip_ItemFound_Unusual"), g_pVGuiLocalize->Find("rarity4")));
}
if ( bIsStrange )
{
loc_scpy_safe(szStrange, CConstructLocalizedString(g_pVGuiLocalize->Find("TFUI_InvTooltip_ItemFound_Strange"), g_pVGuiLocalize->Find("strange")));
}
// // Strange Unusual Item Grade
loc_scpy_safe( wszLocalizedString, CConstructLocalizedString( g_pVGuiLocalize->Find( "TFUI_InvTooltip_ItemFound" ), szStrange, szUnusual, szItemname, szRarity, szWear ) );
loc_scpy_safe( tempName, wszLocalizedString );
g_pVGuiLocalize->ConstructString_safe(
wszLocalizedString,
wszItemFound,
3,
wszPlayerName, tempName, L"" );
wchar_t wszLocalizedString[256];
g_pVGuiLocalize->ConstructString( wszLocalizedString, sizeof( wszLocalizedString ), wszItemFound, 3, wszPlayerName, CEconItemLocalizedFullNameGenerator( GLocalizationProvider(), pItemDefinition, iItemQuality ).GetFullName(), L"" );
char szLocalized[256];
g_pVGuiLocalize->ConvertUnicodeToANSI( wszLocalizedString, szLocalized, sizeof( szLocalized ) );
@@ -1482,7 +1377,7 @@ void ClientModeShared::DisplayReplayMessage( const char *pLocalizeName, float fl
void ClientModeShared::DisplayReplayReminder()
{
#if defined( REPLAY_ENABLED )
if ( m_pReplayReminderPanel && g_pReplay->IsRecording() && !::input->IsSteamControllerActive() )
if ( m_pReplayReminderPanel && g_pReplay->IsRecording() )
{
// Only display the panel if we haven't already requested a replay for the given life
CReplay *pCurLifeReplay = static_cast< CReplay * >( g_pClientReplayContext->GetReplayManager()->GetReplayForCurrentLife() );
@@ -1509,5 +1404,3 @@ void ClientModeShared::DeactivateInGameVGuiContext()
vgui::ivgui()->ActivateContext( DEFAULT_VGUI_CONTEXT );
}
+3 -9
View File
@@ -66,7 +66,7 @@ public:
virtual void Disable();
virtual void Layout();
virtual void ReloadScheme( bool flushLowLevel );
virtual void ReloadScheme( void );
virtual void OverrideView( CViewSetup *pSetup );
virtual bool ShouldDrawDetailObjects( );
virtual bool ShouldDrawEntity(C_BaseEntity *pEnt);
@@ -117,9 +117,9 @@ public:
//=============================================================================
virtual wchar_t* GetServerName() { return NULL; }
virtual void SetServerName(wchar_t* name) {}
virtual void SetServerName(wchar_t* name) {};
virtual wchar_t* GetMapName() { return NULL; }
virtual void SetMapName(wchar_t* name) {}
virtual void SetMapName(wchar_t* name) {};
//=============================================================================
// HPE_END
@@ -134,12 +134,6 @@ public:
virtual void InfoPanelDisplayed() OVERRIDE { }
virtual bool IsHTMLInfoPanelAllowed() OVERRIDE { return true; }
bool IsAnyPanelVisibleExceptScores() { return m_pViewport->IsAnyPanelVisibleExceptScores(); }
bool IsPanelVisible( const char* panel ) { return m_pViewport->IsPanelVisible( panel ); }
virtual void OnDemoRecordStart( char const* pDemoBaseName ) OVERRIDE {}
virtual void OnDemoRecordStop() OVERRIDE {}
protected:
CBaseViewport *m_pViewport;
+12 -20
View File
@@ -91,7 +91,7 @@ static ConVar r_flashlightmodels( "r_flashlightmodels", "1" );
static ConVar r_shadowrendertotexture( "r_shadowrendertotexture", "0" );
static ConVar r_flashlight_version2( "r_flashlight_version2", "0", FCVAR_CHEAT | FCVAR_DEVELOPMENTONLY );
ConVar r_flashlightdepthtexture( "r_flashlightdepthtexture", "1", FCVAR_ALLOWED_IN_COMPETITIVE );
ConVar r_flashlightdepthtexture( "r_flashlightdepthtexture", "1" );
#if defined( _X360 )
ConVar r_flashlightdepthres( "r_flashlightdepthres", "512" );
@@ -1180,6 +1180,7 @@ CClientShadowMgr::CClientShadowMgr() :
//-----------------------------------------------------------------------------
CON_COMMAND_F( r_shadowdir, "Set shadow direction", FCVAR_CHEAT )
{
Vector dir;
if ( args.ArgC() == 1 )
{
Vector dir = s_ClientShadowMgr.GetShadowDirection();
@@ -1189,7 +1190,6 @@ CON_COMMAND_F( r_shadowdir, "Set shadow direction", FCVAR_CHEAT )
if ( args.ArgC() == 4 )
{
Vector dir;
dir.x = atof( args[1] );
dir.y = atof( args[2] );
dir.z = atof( args[3] );
@@ -1199,6 +1199,8 @@ CON_COMMAND_F( r_shadowdir, "Set shadow direction", FCVAR_CHEAT )
CON_COMMAND_F( r_shadowangles, "Set shadow angles", FCVAR_CHEAT )
{
Vector dir;
QAngle angles;
if (args.ArgC() == 1)
{
Vector dir = s_ClientShadowMgr.GetShadowDirection();
@@ -1210,8 +1212,6 @@ CON_COMMAND_F( r_shadowangles, "Set shadow angles", FCVAR_CHEAT )
if (args.ArgC() == 4)
{
Vector dir;
QAngle angles;
angles.x = atof( args[1] );
angles.y = atof( args[2] );
angles.z = atof( args[3] );
@@ -1802,9 +1802,6 @@ ClientShadowHandle_t CClientShadowMgr::CreateProjectedTexture( ClientEntityHandl
if( !( flags & SHADOW_FLAGS_FLASHLIGHT ) )
{
IClientRenderable *pRenderable = ClientEntityList().GetClientRenderableFromHandle( entity );
if ( !pRenderable )
return m_Shadows.InvalidIndex();
int modelType = modelinfo->GetModelType( pRenderable->GetModel() );
if (modelType == mod_brush)
{
@@ -2388,9 +2385,6 @@ void CClientShadowMgr::BuildOrthoShadow( IClientRenderable* pRenderable,
//-----------------------------------------------------------------------------
void CClientShadowMgr::DrawRenderToTextureDebugInfo( IClientRenderable* pRenderable, const Vector& mins, const Vector& maxs )
{
if ( !debugoverlay )
return;
// Get the object's basis
Vector vec[3];
AngleVectors( pRenderable->GetRenderAngles(), &vec[0], &vec[1], &vec[2] );
@@ -2572,12 +2566,9 @@ static void LineDrawHelper( const Vector &startShadowSpace, const Vector &endSha
Vector3DMultiplyPositionProjective( shadowToWorld, startShadowSpace, startWorldSpace );
Vector3DMultiplyPositionProjective( shadowToWorld, endShadowSpace, endWorldSpace );
if ( debugoverlay )
{
debugoverlay->AddLineOverlay( startWorldSpace + Vector( 0.0f, 0.0f, 1.0f ),
endWorldSpace + Vector( 0.0f, 0.0f, 1.0f ), r, g, b, false, -1 );
}
}
static void DebugDrawFrustum( const Vector &vOrigin, const VMatrix &matWorldToFlashlight )
{
@@ -2940,6 +2931,7 @@ void CClientShadowMgr::PreRender()
unsigned short i = m_DirtyShadows.FirstInorder();
while ( i != m_DirtyShadows.InvalidIndex() )
{
MDLCACHE_CRITICAL_SECTION();
ClientShadowHandle_t& handle = m_DirtyShadows[ i ];
Assert( m_Shadows.IsValidIndex( handle ) );
UpdateProjectedTextureInternal( handle, false );
@@ -2949,7 +2941,7 @@ void CClientShadowMgr::PreRender()
// Transparent shadows must remain dirty, since they were not re-projected
int nCount = m_TransparentShadows.Count();
for ( i = 0; i < nCount; ++i )
for ( int i = 0; i < nCount; ++i )
{
m_DirtyShadows.Insert( m_TransparentShadows[i] );
}
@@ -3179,9 +3171,9 @@ void CClientShadowMgr::UpdateProjectedTextureInternal( ClientShadowHandle_t hand
VPROF_BUDGET( "CClientShadowMgr::UpdateProjectedTextureInternal", VPROF_BUDGETGROUP_SHADOW_DEPTH_TEXTURING );
Assert( ( shadow.m_Flags & SHADOW_FLAGS_SHADOW ) == 0 );
ClientShadow_t& shadowClient = m_Shadows[handle];
ClientShadow_t& shadow = m_Shadows[handle];
shadowmgr->EnableShadow( shadowClient.m_ShadowHandle, true );
shadowmgr->EnableShadow( shadow.m_ShadowHandle, true );
// FIXME: What's the difference between brush and model shadows for light projectors? Answer: nothing.
UpdateBrushShadow( NULL, handle );
@@ -3975,8 +3967,8 @@ void CClientShadowMgr::ComputeShadowDepthTextures( const CViewSetup &viewSetup )
}
// Set depth bias factors specific to this flashlight
CMatRenderContextPtr pRenderContextMat( materials );
pRenderContextMat->SetShadowDepthBiasFactors( flashlightState.m_flShadowSlopeScaleDepthBias, flashlightState.m_flShadowDepthBias );
CMatRenderContextPtr pRenderContext( materials );
pRenderContext->SetShadowDepthBiasFactors( flashlightState.m_flShadowSlopeScaleDepthBias, flashlightState.m_flShadowDepthBias );
// Render to the shadow depth texture with appropriate view
view->UpdateShadowDepthTexture( m_DummyColorTexture, shadowDepthTexture, shadowView );
@@ -3998,7 +3990,7 @@ static void SetupBonesOnBaseAnimating( C_BaseAnimating *&pBaseAnimating )
}
void CClientShadowMgr::ComputeShadowTextures( const CViewSetup &viewShadow, int leafCount, LeafIndex_t* pLeafList )
void CClientShadowMgr::ComputeShadowTextures( const CViewSetup &view, int leafCount, LeafIndex_t* pLeafList )
{
VPROF_BUDGET( "CClientShadowMgr::ComputeShadowTextures", VPROF_BUDGETGROUP_SHADOW_RENDERING );
@@ -4009,7 +4001,7 @@ void CClientShadowMgr::ComputeShadowTextures( const CViewSetup &viewShadow, int
MDLCACHE_CRITICAL_SECTION();
// First grab all shadow textures we may want to render
int nCount = s_VisibleShadowList.FindShadows( &viewShadow, leafCount, pLeafList );
int nCount = s_VisibleShadowList.FindShadows( &view, leafCount, pLeafList );
if ( nCount == 0 )
return;
-27
View File
@@ -68,15 +68,6 @@ const char *CClientSideEffect::GetName( void )
return m_pszName;
}
//-----------------------------------------------------------------------------
// Purpose: Set the name of effect
// Input : const char
//-----------------------------------------------------------------------------
void CClientSideEffect::SetEffectName( const char *pszName )
{
m_pszName = pszName;
}
//-----------------------------------------------------------------------------
// Purpose: Is effect still active?
// Output : Returns true on success, false on failure.
@@ -108,7 +99,6 @@ public:
// Add an effect to the effects list
void AddEffect( CClientSideEffect *effect );
// Remove the specified effect
void RemoveEffect( CClientSideEffect *effect );
// Draw/update all effects in the current list
void DrawEffects( double frametime );
// Flush out all effects from the list
@@ -170,23 +160,6 @@ void CEffectsList::AddEffect( CClientSideEffect *effect )
m_rgEffects[ m_nEffects++ ] = effect;
}
//-----------------------------------------------------------------------------
void CEffectsList::RemoveEffect( CClientSideEffect *effect )
{
Assert( effect );
CClientSideEffect **end = &m_rgEffects[m_nEffects];
for( CClientSideEffect **p = &m_rgEffects[0]; p < end; ++p)
{
if ( *p == effect )
{
RemoveEffect( p - &m_rgEffects[0] ); // todo remove this crutch
return;
}
}
Assert( false ); // don't know this effect
}
//-----------------------------------------------------------------------------
// Purpose: Remove specified effect by index
// Input : effectIndex -
-5
View File
@@ -33,9 +33,6 @@ public:
// Sets the effect to inactive so it can be destroed
virtual void Destroy( void );
// Sets the effect name (useful for debugging).
virtual void SetEffectName( const char *pszName );
private:
// Name of effect ( static data )
const char *m_pszName;
@@ -53,8 +50,6 @@ public:
// Add an effect to the list of effects
virtual void AddEffect( CClientSideEffect *effect ) = 0;
// Remove the specified effect
virtual void RemoveEffect( CClientSideEffect *effect ) = 0;
// Simulate/Update/Draw effects on list
virtual void DrawEffects( double frametime ) = 0;
// Flush out all effects fbrom the list
-52
View File
@@ -20,9 +20,6 @@ CClientSteamContext::CClientSteamContext()
m_CallbackSteamServersDisconnected( this, &CClientSteamContext::OnSteamServersDisconnected ),
m_CallbackSteamServerConnectFailure( this, &CClientSteamContext::OnSteamServerConnectFailure ),
m_CallbackSteamServersConnected( this, &CClientSteamContext::OnSteamServersConnected )
#ifdef TF_CLIENT_DLL
, m_GameJoinRequested( this, &CClientSteamContext::OnGameJoinRequested )
#endif // TF_CLIENT_DLL
#endif
{
m_bActive = false;
@@ -113,55 +110,6 @@ void CClientSteamContext::OnSteamServersConnected( SteamServersConnected_t *pCon
UpdateLoggedOnState();
Msg( "CClientSteamContext OnSteamServersConnected logged on = %d\n", m_bLoggedOn );
}
#ifdef TF_CLIENT_DLL
void CClientSteamContext::OnGameJoinRequested( GameRichPresenceJoinRequested_t *pCallback )
{
if ( pCallback && pCallback->m_rgchConnect && ( pCallback->m_rgchConnect[0] == '+' ) )
{
char const *szConCommand = pCallback->m_rgchConnect + 1;
//
// Work around Steam Overlay bug that it doesn't replace %20 characters
//
CFmtStr fmtCommand;
if ( StringHasPrefix( szConCommand, "tf_econ_item_preview%20" ) )
{
fmtCommand.AppendFormat( "%s", szConCommand );
while ( char *pszReplace = strstr( fmtCommand.Access(), "%20" ) )
{
*pszReplace = ' ';
Q_memmove( pszReplace + 1, pszReplace + 3, Q_strlen( pszReplace + 3 ) + 1 );
}
szConCommand = fmtCommand.Access();
}
//
// End of Steam Overlay bug workaround
//
if ( char const *szItemId = StringAfterPrefix( szConCommand, "tf_econ_item_preview " ) )
{
Msg( "CClientSteamContext OnGameJoinRequested tf_econ_item_preview" );
bool bItemIdValid = ( pCallback->m_steamIDFriend.GetAccountID() == ~0u );
while ( *szItemId )
{
if ( ( ( *szItemId >= '0' ) && ( *szItemId <= '9' ) ) ||
( ( *szItemId >= 'A' ) && ( *szItemId <= 'S' ) ) )
++szItemId; // support new encoding for owner steamid and assetid
else
{
bItemIdValid = false;
break;
}
}
if ( bItemIdValid )
{
engine->ClientCmd( szConCommand );
}
}
}
}
#endif // TF_CLIENT_DLL
#endif // !defined(NO_STEAM)
void CClientSteamContext::InstallCallback( CUtlDelegate< void ( const SteamLoggedOnChange_t & ) > delegate )
-3
View File
@@ -27,9 +27,6 @@ public:
STEAM_CALLBACK( CClientSteamContext, OnSteamServersDisconnected, SteamServersDisconnected_t, m_CallbackSteamServersDisconnected );
STEAM_CALLBACK( CClientSteamContext, OnSteamServerConnectFailure, SteamServerConnectFailure_t, m_CallbackSteamServerConnectFailure );
STEAM_CALLBACK( CClientSteamContext, OnSteamServersConnected, SteamServersConnected_t, m_CallbackSteamServersConnected );
#ifdef TF_CLIENT_DLL
STEAM_CALLBACK( CClientSteamContext, OnGameJoinRequested, GameRichPresenceJoinRequested_t, m_GameJoinRequested );
#endif // TF_CLIENT_DLL
#endif
bool BLoggedOn() { return m_bLoggedOn; }
@@ -1,120 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "achievement_stats_summary.h"
#include "achievements_page.h"
#include "lifetime_stats_page.h"
#include "match_stats_page.h"
#include "stats_summary.h"
#include <stdio.h>
using namespace vgui;
#include <vgui/ILocalize.h>
#include "vgui/ISurface.h"
#include "filesystem.h"
#include <KeyValues.h>
// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>
const int cDialogWidth = 900;
//-----------------------------------------------------------------------------
// Purpose: Constructor
//-----------------------------------------------------------------------------
CAchievementAndStatsSummary::CAchievementAndStatsSummary(vgui::Panel *parent) : BaseClass(parent, "AchievementAndStatsSummary")
{
SetDeleteSelfOnClose(false);
//SetBounds(0, 0, 640, 384);
SetBounds(0, 0, 900, 780);
SetMinimumSize( 640, 780 );
SetSizeable( false );
SetTitle("#GameUI_CreateAchievementsAndStats", true);
SetOKButtonText("#GameUI_Close");
SetCancelButtonVisible(false);
m_pStatsSummary = new CStatsSummary( this, "StatsSummary" );
m_pAchievementsPage = new CAchievementsPage(this, "AchievementsPage");
m_pLifetimeStatsPage = new CLifetimeStatsPage(this, "StatsPage");
m_pMatchStatsPage = new CMatchStatsPage(this, "MatchStatsPage");
AddPage(m_pStatsSummary, "#GameUI_Stats_Summary");
AddPage(m_pAchievementsPage, "#GameUI_Achievements_Tab");
AddPage(m_pMatchStatsPage, "#GameUI_MatchStats");
AddPage(m_pLifetimeStatsPage, "#GameUI_LifetimeStats");
}
//-----------------------------------------------------------------------------
// Purpose: Destructor
//-----------------------------------------------------------------------------
CAchievementAndStatsSummary::~CAchievementAndStatsSummary()
{
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CAchievementAndStatsSummary::ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
int screenWide, screenTall;
surface()->GetScreenSize( screenWide, screenTall );
// [smessick] Close the achievements dialog for a low resolution screen.
if ( screenWide < cAchievementsDialogMinWidth )
{
OnOK( true );
Close();
}
}
//-----------------------------------------------------------------------------
// Purpose: runs the server when the OK button is pressed
//-----------------------------------------------------------------------------
bool CAchievementAndStatsSummary::OnOK(bool applyOnly)
{
BaseClass::OnOK(applyOnly);
return true;
}
//----------------------------------------------------------
// Purpose: Preserve our width to the one in the .res file
//----------------------------------------------------------
void CAchievementAndStatsSummary::OnSizeChanged(int newWide, int newTall)
{
// Lock the width, but allow height scaling
if ( newWide != cDialogWidth )
{
SetSize( cDialogWidth, newTall );
return;
}
BaseClass::OnSizeChanged(newWide, newTall);
}
//----------------------------------------------------------
// Purpose: Processes when summary dialog is activated.
//----------------------------------------------------------
void CAchievementAndStatsSummary::Activate()
{
m_pStatsSummary->MakeReadyForUse();
m_pStatsSummary->UpdateStatsData();
m_pAchievementsPage->UpdateAchievementDialogInfo();
m_pLifetimeStatsPage->UpdateStatsData();
m_pMatchStatsPage->UpdateStatsData();
BaseClass::Activate();
}
@@ -1,62 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef ACHIEVEMENTANDSTATSSUMMARY_H
#define ACHIEVEMENTANDSTATSSUMMARY_H
#ifdef _WIN32
#pragma once
#endif
#include <vgui_controls/PropertyDialog.h>
class CAchievementsPage;
class CLifetimeStatsPage;
class CMatchStatsPage;
class StatCard;
class CStatsSummary;
const int cAchievementsDialogMinWidth = 1024; // don't show this screen for lower resolutions
//-----------------------------------------------------------------------------
// Purpose: dialog for displaying the achievements/stats summary
//-----------------------------------------------------------------------------
class CAchievementAndStatsSummary : public vgui::PropertyDialog
{
DECLARE_CLASS_SIMPLE( CAchievementAndStatsSummary, vgui::PropertyDialog );
public:
CAchievementAndStatsSummary(vgui::Panel *parent);
~CAchievementAndStatsSummary();
virtual void Activate();
void OnKeyCodePressed( vgui::KeyCode code )
{
if ( code == KEY_XBUTTON_B )
{
Close();
}
else
{
BaseClass::OnKeyCodePressed(code);
}
}
protected:
virtual bool OnOK(bool applyOnly);
virtual void OnSizeChanged( int newWide, int newTall );
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
private:
CAchievementsPage* m_pAchievementsPage;
CLifetimeStatsPage* m_pLifetimeStatsPage;
CMatchStatsPage* m_pMatchStatsPage;
CStatsSummary* m_pStatsSummary;
};
#endif // ACHIEVEMENTANDSTATSSUMMARY_H
File diff suppressed because it is too large Load Diff
@@ -1,218 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef CSACHIEVEMENTSPAGE_H
#define CSACHIEVEMENTSPAGE_H
#ifdef _WIN32
#pragma once
#endif
#include "vgui_controls/PanelListPanel.h"
#include "vgui_controls/Label.h"
#include "tier1/KeyValues.h"
#include "vgui_controls/PropertyPage.h"
#include "vgui_controls/Button.h"
#include "c_cs_player.h"
#include "vgui_avatarimage.h"
#include "GameEventListener.h"
class CCSBaseAchievement;
class IScheme;
class CAchievementsPageGroupPanel;
class StatCard;
#define ACHIEVED_ICON_PATH "hud/icon_check.vtf"
#define LOCK_ICON_PATH "hud/icon_locked.vtf"
// Loads an achievement's icon into a specified image panel, or turns the panel off if no achievement icon was found.
bool CSLoadAchievementIconForPage( vgui::ImagePanel* pIconPanel, CCSBaseAchievement *pAchievement, const char *pszExt = NULL );
// Loads an achievement's icon into a specified image panel, or turns the panel off if no achievement icon was found.
bool CSLoadIconForPage( vgui::ImagePanel* pIconPanel, const char* pFilename, const char *pszExt = NULL );
// Updates a listed achievement item's progress bar.
void CSUpdateProgressBarForPage( vgui::EditablePanel* pPanel, CCSBaseAchievement *pAchievement, Color clrProgressBar );
////////////////////////////////////////////////////////////////////////////
// PC version
//////////////////////////////////////////////////////////////////////////
class CAchievementsPage : public vgui::PropertyPage, public CGameEventListener
{
DECLARE_CLASS_SIMPLE ( CAchievementsPage, vgui::PropertyPage );
public:
CAchievementsPage( vgui::Panel *parent, const char *name );
~CAchievementsPage();
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
void UpdateTotalProgressDisplay();
virtual void UpdateAchievementDialogInfo( void );
virtual void OnPageShow();
virtual void OnThink();
virtual void ApplySettings( KeyValues *pResourceData );
virtual void OnSizeChanged( int newWide, int newTall );
virtual void FireGameEvent( IGameEvent *event );
void CreateNewAchievementGroup( int iMinRange, int iMaxRange );
void CreateOrUpdateComboItems( bool bCreate );
void UpdateAchievementList(CAchievementsPageGroupPanel* groupPanel);
void UpdateAchievementList(int minID, int maxID);
vgui::PanelListPanel *m_pAchievementsList;
vgui::ImagePanel *m_pListBG;
vgui::PanelListPanel *m_pGroupsList;
vgui::ImagePanel *m_pGroupListBG;
vgui::ImagePanel *m_pPercentageBarBackground;
vgui::ImagePanel *m_pPercentageBar;
StatCard* m_pStatCard;
int m_iFixedWidth;
bool m_bStatsDirty;
bool m_bAchievementsDirty;
typedef struct
{
int m_iMinRange;
int m_iMaxRange;
} achievement_group_t;
int m_iNumAchievementGroups;
achievement_group_t m_AchievementGroups[15];
};
class CHiddenHUDToggleButton : public vgui::Button
{
DECLARE_CLASS_SIMPLE( CHiddenHUDToggleButton, vgui::Button );
public:
CHiddenHUDToggleButton( vgui::Panel *pParent, const char *pName, const char *pText );
virtual void DoClick( void );
};
//////////////////////////////////////////////////////////////////////////
// Individual item panel, displaying stats for one achievement
class CAchievementsPageItemPanel : public vgui::EditablePanel
{
DECLARE_CLASS_SIMPLE( CAchievementsPageItemPanel, vgui::EditablePanel );
public:
CAchievementsPageItemPanel( vgui::PanelListPanel *parent, const char* name);
~CAchievementsPageItemPanel();
void SetAchievementInfo ( CCSBaseAchievement* pAchievement );
CCSBaseAchievement* GetAchievementInfo( void ) { return m_pSourceAchievement; }
void UpdateAchievementInfo( vgui::IScheme *pScheme );
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
void ToggleShowOnHUDButton();
MESSAGE_FUNC_PTR( OnCheckButtonChecked, "CheckButtonChecked", panel );
private:
static void PreloadResourceFile();
CCSBaseAchievement* m_pSourceAchievement;
int m_iSourceAchievementIndex;
vgui::PanelListPanel *m_pParent;
vgui::Label *m_pAchievementNameLabel;
vgui::Label *m_pAchievementDescLabel;
vgui::Label *m_pPercentageText;
vgui::Label *m_pAwardDate;
vgui::ImagePanel *m_pLockedIcon;
vgui::ImagePanel *m_pAchievementIcon;
vgui::ImagePanel *m_pPercentageBarBackground;
vgui::ImagePanel *m_pPercentageBar;
vgui::CheckButton *m_pShowOnHUDButton;
vgui::IScheme *m_pSchemeSettings;
CHiddenHUDToggleButton *m_pHiddenHUDToggleButton;
CPanelAnimationVar( Color, m_clrProgressBar, "ProgressBarColor", "140 140 140 255" );
};
class CGroupButton : public vgui::Button
{
DECLARE_CLASS_SIMPLE( CGroupButton, vgui::Button );
public:
CGroupButton( vgui::Panel *pParent, const char *pName, const char *pText );
virtual void DoClick( void );
};
//////////////////////////////////////////////////////////////////////////
// Individual achievement group panel, displaying info for one achievement group
class CAchievementsPageGroupPanel : public vgui::EditablePanel
{
DECLARE_CLASS_SIMPLE( CAchievementsPageGroupPanel, vgui::EditablePanel );
public:
CAchievementsPageGroupPanel( vgui::PanelListPanel *parent, CAchievementsPage *owner, const char* name, int iListItemID );
~CAchievementsPageGroupPanel();
void SetGroupInfo ( const wchar_t* name, int firstAchievementID, int lastAchievementID );
void UpdateAchievementInfo( vgui::IScheme *pScheme );
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
int GetFirstAchievementID() { return m_iFirstAchievementID; }
int GetLastAchievementID() { return m_iLastAchievementID; }
vgui::PanelListPanel* GetParent() { return m_pParent; }
CAchievementsPage* GetOwner() { return m_pOwner; }
void SetGroupActive(bool active) { m_bActiveButton = active; }
bool IsGroupActive() { return m_bActiveButton; }
private:
void PreloadResourceFile( void );
vgui::PanelListPanel *m_pParent;
CAchievementsPage *m_pOwner;
vgui::Label *m_pAchievementGroupLabel;
vgui::Label *m_pPercentageText;
CGroupButton *m_pGroupButton;
vgui::ImagePanel *m_pGroupIcon;
vgui::ImagePanel *m_pPercentageBarBackground;
vgui::ImagePanel *m_pPercentageBar;
vgui::IScheme *m_pSchemeSettings;
bool m_bActiveButton;
CPanelAnimationVar( Color, m_clrProgressBar, "ProgressBarColor", "140 140 140 255" );
int m_iFirstAchievementID;
int m_iLastAchievementID;
wchar_t *m_pGroupName;
};
#endif // CSACHIEVEMENTSPAGE_H
@@ -1,676 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "backgroundpanel.h"
#include <vgui/IVGui.h>
#include <vgui/IScheme.h>
#include <vgui/ISurface.h>
#include <vgui_controls/Label.h>
#include <vgui/ILocalize.h>
#include "vgui_controls/BuildGroup.h"
#include "vgui_controls/BitmapImagePanel.h"
using namespace vgui;
#define DEBUG_WINDOW_RESIZING 0
#define DEBUG_WINDOW_REPOSITIONING 0
//-----------------------------------------------------------------------------
const int NumSegments = 7;
static int coord[NumSegments+1] = {
0,
1,
2,
3,
4,
6,
9,
10
};
//-----------------------------------------------------------------------------
void DrawRoundedBackground( Color bgColor, int wide, int tall )
{
int x1, x2, y1, y2;
surface()->DrawSetColor(bgColor);
surface()->DrawSetTextColor(bgColor);
int i;
// top-left corner --------------------------------------------------------
int xDir = 1;
int yDir = -1;
int xIndex = 0;
int yIndex = NumSegments - 1;
int xMult = 1;
int yMult = 1;
int x = 0;
int y = 0;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = y + coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// top-right corner -------------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = wide;
y = 0;
xMult = -1;
yMult = 1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = y + coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// bottom-right corner ----------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = wide;
y = tall;
xMult = -1;
yMult = -1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = y - coord[NumSegments];
y2 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// bottom-left corner -----------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = 0;
y = tall;
xMult = 1;
yMult = -1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = y - coord[NumSegments];
y2 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// paint between top left and bottom left ---------------------------------
x1 = 0;
x2 = coord[NumSegments];
y1 = coord[NumSegments];
y2 = tall - coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
// paint between left and right -------------------------------------------
x1 = coord[NumSegments];
x2 = wide - coord[NumSegments];
y1 = 0;
y2 = tall;
surface()->DrawFilledRect( x1, y1, x2, y2 );
// paint between top right and bottom right -------------------------------
x1 = wide - coord[NumSegments];
x2 = wide;
y1 = coord[NumSegments];
y2 = tall - coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
}
//-----------------------------------------------------------------------------
void DrawRoundedBorder( Color borderColor, int wide, int tall )
{
int x1, x2, y1, y2;
surface()->DrawSetColor(borderColor);
surface()->DrawSetTextColor(borderColor);
int i;
// top-left corner --------------------------------------------------------
int xDir = 1;
int yDir = -1;
int xIndex = 0;
int yIndex = NumSegments - 1;
int xMult = 1;
int yMult = 1;
int x = 0;
int y = 0;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// top-right corner -------------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = wide;
y = 0;
xMult = -1;
yMult = 1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// bottom-right corner ----------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = wide;
y = tall;
xMult = -1;
yMult = -1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// bottom-left corner -----------------------------------------------------
xDir = 1;
yDir = -1;
xIndex = 0;
yIndex = NumSegments - 1;
x = 0;
y = tall;
xMult = 1;
yMult = -1;
for ( i=0; i<NumSegments; ++i )
{
x1 = MIN( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
x2 = MAX( x + coord[xIndex]*xMult, x + coord[xIndex+1]*xMult );
y1 = MIN( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
y2 = MAX( y + coord[yIndex]*yMult, y + coord[yIndex+1]*yMult );
surface()->DrawFilledRect( x1, y1, x2, y2 );
xIndex += xDir;
yIndex += yDir;
}
// top --------------------------------------------------------------------
x1 = coord[NumSegments];
x2 = wide - coord[NumSegments];
y1 = 0;
y2 = 1;
surface()->DrawFilledRect( x1, y1, x2, y2 );
// bottom -----------------------------------------------------------------
x1 = coord[NumSegments];
x2 = wide - coord[NumSegments];
y1 = tall - 1;
y2 = tall;
surface()->DrawFilledRect( x1, y1, x2, y2 );
// left -------------------------------------------------------------------
x1 = 0;
x2 = 1;
y1 = coord[NumSegments];
y2 = tall - coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
// right ------------------------------------------------------------------
x1 = wide - 1;
x2 = wide;
y1 = coord[NumSegments];
y2 = tall - coord[NumSegments];
surface()->DrawFilledRect( x1, y1, x2, y2 );
}
//-----------------------------------------------------------------------------
class CaptionLabel : public Label
{
public:
CaptionLabel(Panel *parent, const char *panelName, const char *text) : Label(parent, panelName, text)
{
}
virtual void ApplySchemeSettings( vgui::IScheme *pScheme )
{
Label::ApplySchemeSettings( pScheme );
SetFont( pScheme->GetFont( "MenuTitle", IsProportional() ) );
}
};
//-----------------------------------------------------------------------------
// Purpose: transform a normalized value into one that is scaled based the minimum
// of the horizontal and vertical ratios
//-----------------------------------------------------------------------------
static int GetAlternateProportionalValueFromNormal(int normalizedValue)
{
int wide, tall;
GetHudSize( wide, tall );
int proH, proW;
surface()->GetProportionalBase( proW, proH );
double scaleH = (double)tall / (double)proH;
double scaleW = (double)wide / (double)proW;
double scale = (scaleW < scaleH) ? scaleW : scaleH;
return (int)( normalizedValue * scale );
}
//-----------------------------------------------------------------------------
// Purpose: transform a standard scaled value into one that is scaled based the minimum
// of the horizontal and vertical ratios
//-----------------------------------------------------------------------------
int GetAlternateProportionalValueFromScaled( HScheme hScheme, int scaledValue)
{
return GetAlternateProportionalValueFromNormal( scheme()->GetProportionalNormalizedValueEx( hScheme, scaledValue ) );
}
//-----------------------------------------------------------------------------
// Purpose: moves and resizes a single control
//-----------------------------------------------------------------------------
static void RepositionControl( Panel *pPanel )
{
int x, y, w, h;
pPanel->GetBounds(x, y, w, h);
#if DEBUG_WINDOW_RESIZING
int x1, y1, w1, h1;
pPanel->GetBounds(x1, y1, w1, h1);
int x2, y2, w2, h2;
x2 = scheme()->GetProportionalNormalizedValueEx( pPanel->GetScheme(), x1 );
y2 = scheme()->GetProportionalNormalizedValueEx( pPanel->GetScheme(), y1 );
w2 = scheme()->GetProportionalNormalizedValueEx( pPanel->GetScheme(), w1 );
h2 = scheme()->GetProportionalNormalizedValueEx( pPanel->GetScheme(), h1 );
#endif
x = GetAlternateProportionalValueFromScaled( pPanel->GetScheme(), x );
y = GetAlternateProportionalValueFromScaled( pPanel->GetScheme(), y );
w = GetAlternateProportionalValueFromScaled( pPanel->GetScheme(), w );
h = GetAlternateProportionalValueFromScaled( pPanel->GetScheme(), h );
pPanel->SetBounds(x, y, w, h);
#if DEBUG_WINDOW_RESIZING
DevMsg( "Resizing '%s' from (%d,%d) %dx%d to (%d,%d) %dx%d -- initially was (%d,%d) %dx%d\n",
pPanel->GetName(), x1, y1, w1, h1, x, y, w, h, x2, y2, w2, h2 );
#endif
}
//-----------------------------------------------------------------------------
// Purpose: Sets colors etc for background image panels
//-----------------------------------------------------------------------------
void ApplyBackgroundSchemeSettings( EditablePanel *pWindow, vgui::IScheme *pScheme )
{
Color bgColor = Color( 255, 255, 255, pScheme->GetColor( "BgColor", Color( 0, 0, 0, 0 ) )[3] );
Color fgColor = pScheme->GetColor( "FgColor", Color( 0, 0, 0, 0 ) );
if ( !pWindow )
return;
CBitmapImagePanel *pBitmapPanel;
// corners --------------------------------------------
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "TopLeftPanel" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "TopRightPanel" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "BottomLeftPanel" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "BottomRightPanel" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
// background -----------------------------------------
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "TopSolid" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "UpperMiddleSolid" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "LowerMiddleSolid" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "BottomSolid" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( bgColor );
}
// Logo -----------------------------------------------
pBitmapPanel = dynamic_cast< CBitmapImagePanel * >(pWindow->FindChildByName( "ExclamationPanel" ));
if ( pBitmapPanel )
{
pBitmapPanel->setImageColor( fgColor );
}
}
//-----------------------------------------------------------------------------
// Purpose: Re-aligns background image panels so they are touching.
//-----------------------------------------------------------------------------
static void FixupBackgroundPanels( EditablePanel *pWindow, int offsetX, int offsetY )
{
if ( !pWindow )
return;
int screenWide, screenTall;
pWindow->GetSize( screenWide, screenTall );
int inset = GetAlternateProportionalValueFromNormal( 20 );
int cornerSize = GetAlternateProportionalValueFromNormal( 10 );
int titleHeight = GetAlternateProportionalValueFromNormal( 42 );
int mainHeight = GetAlternateProportionalValueFromNormal( 376 );
int logoSize = titleHeight;
int captionInset = GetAlternateProportionalValueFromNormal( 76 );
Panel *pPanel;
// corners --------------------------------------------
pPanel = pWindow->FindChildByName( "TopLeftPanel" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset, offsetY + inset, cornerSize, cornerSize );
}
pPanel = pWindow->FindChildByName( "TopRightPanel" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( screenWide - offsetX - inset - cornerSize, offsetY + inset, cornerSize, cornerSize );
}
pPanel = pWindow->FindChildByName( "BottomLeftPanel" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset, screenTall - offsetY - inset - cornerSize, cornerSize, cornerSize );
}
pPanel = pWindow->FindChildByName( "BottomRightPanel" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( screenWide - offsetX - inset - cornerSize, screenTall - offsetY - inset - cornerSize, cornerSize, cornerSize );
}
// background -----------------------------------------
pPanel = pWindow->FindChildByName( "TopSolid" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset + cornerSize, offsetY + inset, screenWide - 2*offsetX - 2*inset - 2*cornerSize, cornerSize );
}
pPanel = pWindow->FindChildByName( "UpperMiddleSolid" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset, offsetY + inset + cornerSize, screenWide - 2*offsetX - 2*inset, titleHeight );
}
pPanel = pWindow->FindChildByName( "LowerMiddleSolid" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset + cornerSize, screenTall - offsetY - inset - cornerSize, screenWide - 2*offsetX - 2*inset - 2*cornerSize, cornerSize );
}
pPanel = pWindow->FindChildByName( "BottomSolid" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( offsetX + inset, screenTall - offsetY - inset - cornerSize - mainHeight, screenWide - 2*offsetX - 2*inset, mainHeight );
}
// transparent border ---------------------------------
pPanel = pWindow->FindChildByName( "TopClear" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( 0, 0, screenWide, offsetY + inset );
}
pPanel = pWindow->FindChildByName( "BottomClear" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( 0, screenTall - offsetY - inset, screenWide, offsetY + inset );
}
pPanel = pWindow->FindChildByName( "LeftClear" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( 0, offsetY + inset, offsetX + inset, screenTall - 2*offsetY - 2*inset );
}
pPanel = pWindow->FindChildByName( "RightClear" );
if ( pPanel )
{
pPanel->SetZPos( -20 );
pPanel->SetBounds( screenWide - offsetX - inset, offsetY + inset, offsetX + inset, screenTall - 2*offsetY - 2*inset );
}
// Logo -----------------------------------------------
int logoInset = (cornerSize + titleHeight - logoSize)/2;
pPanel = pWindow->FindChildByName( "ExclamationPanel" );
if ( pPanel )
{
pPanel->SetZPos( -19 ); // higher than the background
pPanel->SetBounds( offsetX + inset + logoInset, offsetY + inset + logoInset, logoSize, logoSize );
}
// Title caption --------------------------------------
pPanel = dynamic_cast< Label * >(pWindow->FindChildByName( "CaptionLabel" ));
if ( pPanel )
{
pPanel->SetZPos( -19 ); // higher than the background
pPanel->SetBounds( offsetX + captionInset/*inset + 2*logoInset + logoSize*/, offsetY + inset + logoInset, screenWide, logoSize );
}
}
//-----------------------------------------------------------------------------
// Purpose: Creates background image panels
//-----------------------------------------------------------------------------
void CreateBackground( EditablePanel *pWindow )
{
// corners --------------------------------------------
new CBitmapImagePanel( pWindow, "TopLeftPanel", "gfx/vgui/round_corner_nw" );
new CBitmapImagePanel( pWindow, "TopRightPanel", "gfx/vgui/round_corner_ne" );
new CBitmapImagePanel( pWindow, "BottomLeftPanel", "gfx/vgui/round_corner_sw" );
new CBitmapImagePanel( pWindow, "BottomRightPanel", "gfx/vgui/round_corner_se" );
// background -----------------------------------------
new CBitmapImagePanel( pWindow, "TopSolid", "gfx/vgui/solid_background" );
new CBitmapImagePanel( pWindow, "UpperMiddleSolid", "gfx/vgui/solid_background" );
new CBitmapImagePanel( pWindow, "LowerMiddleSolid", "gfx/vgui/solid_background" );
new CBitmapImagePanel( pWindow, "BottomSolid", "gfx/vgui/solid_background" );
// transparent border ---------------------------------
new CBitmapImagePanel( pWindow, "TopClear", "gfx/vgui/trans_background" );
new CBitmapImagePanel( pWindow, "BottomClear", "gfx/vgui/trans_background" );
new CBitmapImagePanel( pWindow, "LeftClear", "gfx/vgui/trans_background" );
new CBitmapImagePanel( pWindow, "RightClear", "gfx/vgui/trans_background" );
// Logo -----------------------------------------------
new CBitmapImagePanel( pWindow, "ExclamationPanel", "gfx/vgui/CS_logo" );
// Title caption --------------------------------------
Panel *pPanel = dynamic_cast< Label * >(pWindow->FindChildByName( "CaptionLabel" ));
if ( !pPanel )
new CaptionLabel( pWindow, "CaptionLabel", "" );
}
void ResizeWindowControls( EditablePanel *pWindow, int tall, int wide, int offsetX, int offsetY )
{
if (!pWindow || !pWindow->GetBuildGroup() || !pWindow->GetBuildGroup()->GetPanelList())
return;
CUtlVector<PHandle> *panelList = pWindow->GetBuildGroup()->GetPanelList();
CUtlVector<Panel *> resizedPanels;
CUtlVector<Panel *> movedPanels;
// Resize to account for 1.25 aspect ratio (1280x1024) screens
{
for ( int i = 0; i < panelList->Size(); ++i )
{
PHandle handle = (*panelList)[i];
Panel *panel = handle.Get();
bool found = false;
for ( int j = 0; j < resizedPanels.Size(); ++j )
{
if (panel == resizedPanels[j])
found = true;
}
if (!panel || found)
{
continue;
}
resizedPanels.AddToTail( panel ); // don't move a panel more than once
if ( panel != pWindow )
{
RepositionControl( panel );
}
}
}
// and now re-center them. Woohoo!
for ( int i = 0; i < panelList->Size(); ++i )
{
PHandle handle = (*panelList)[i];
Panel *panel = handle.Get();
bool found = false;
for ( int j = 0; j < movedPanels.Size(); ++j )
{
if (panel == movedPanels[j])
found = true;
}
if (!panel || found)
{
continue;
}
movedPanels.AddToTail( panel ); // don't move a panel more than once
if ( panel != pWindow )
{
int x, y;
panel->GetPos( x, y );
panel->SetPos( x + offsetX, y + offsetY );
#if DEBUG_WINDOW_REPOSITIONING
DevMsg( "Repositioning '%s' from (%d,%d) to (%d,%d) -- a distance of (%d,%d)\n",
panel->GetName(), x, y, x + offsetX, y + offsetY, offsetX, offsetY );
#endif
}
}
}
//-----------------------------------------------------------------------------
// Purpose: Resizes windows to fit completely on-screen (for 1280x1024), and
// centers them on the screen. Sub-controls are also resized and moved.
//-----------------------------------------------------------------------------
void LayoutBackgroundPanel( EditablePanel *pWindow )
{
if ( !pWindow )
return;
int screenW, screenH;
GetHudSize( screenW, screenH );
int wide, tall;
pWindow->GetSize( wide, tall );
int offsetX = 0;
int offsetY = 0;
// Slide everything over to the center
pWindow->SetBounds( 0, 0, screenW, screenH );
if ( wide != screenW || tall != screenH )
{
wide = GetAlternateProportionalValueFromScaled( pWindow->GetScheme(), wide);
tall = GetAlternateProportionalValueFromScaled( pWindow->GetScheme(), tall);
offsetX = (screenW - wide)/2;
offsetY = (screenH - tall)/2;
ResizeWindowControls( pWindow, tall, wide, offsetX, offsetY );
}
// now that the panels are moved/resized, look for some bg panels, and re-align them
FixupBackgroundPanels( pWindow, offsetX, offsetY );
}
//-----------------------------------------------------------------------------
@@ -1,53 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef CSBACKGROUND_H
#define CSBACKGROUND_H
#include <vgui_controls/Frame.h>
#include <vgui_controls/EditablePanel.h>
//-----------------------------------------------------------------------------
// Purpose: Creates background image panels
//-----------------------------------------------------------------------------
void CreateBackground( vgui::EditablePanel *pWindow );
//-----------------------------------------------------------------------------
// Purpose: Resizes windows to fit completely on-screen (for 1280x1024), and
// centers them on the screen. Sub-controls are also resized and moved.
//-----------------------------------------------------------------------------
void LayoutBackgroundPanel( vgui::EditablePanel *pWindow );
//-----------------------------------------------------------------------------
// Purpose: Sets colors etc for background image panels
//-----------------------------------------------------------------------------
void ApplyBackgroundSchemeSettings( vgui::EditablePanel *pWindow, vgui::IScheme *pScheme );
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void ResizeWindowControls( vgui::EditablePanel *pWindow, int tall, int wide, int offsetX, int offsetY );
//-----------------------------------------------------------------------------
// Purpose: transform a standard scaled value into one that is scaled based the minimum
// of the horizontal and vertical ratios
//-----------------------------------------------------------------------------
int GetAlternateProportionalValueFromScaled( vgui::HScheme scheme, int scaledValue );
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void DrawRoundedBackground( Color bgColor, int wide, int tall );
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void DrawRoundedBorder( Color borderColor, int wide, int tall );
//-----------------------------------------------------------------------------
#endif // CSBACKGROUND_H
@@ -1,359 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
//
//=============================================================================//
#include "cbase.h"
#include "tier3/tier3.h"
#include "vgui/ILocalize.h"
#include "lifetime_stats_page.h"
#include <vgui_controls/SectionedListPanel.h>
#include "cs_client_gamestats.h"
#include "filesystem.h"
#include "cs_weapon_parse.h"
#include "buy_presets/buy_presets.h"
#include "../vgui_controls/ScrollBar.h"
#include "stat_card.h"
using namespace vgui;
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
KeyValues *g_pPreloadedCSBaseStatGroupLayout = NULL;
//-----------------------------------------------------------------------------
// Purpose: creates child panels, passes down name to pick up any settings from res files.
//-----------------------------------------------------------------------------
CBaseStatsPage::CBaseStatsPage(vgui::Panel *parent, const char *name) : BaseClass(parent, "CSBaseStatsDialog")
{
vgui::IScheme *pScheme = scheme()->GetIScheme( GetScheme() );
m_listItemFont = pScheme->GetFont( "StatsPageText", IsProportional() );
m_statsList = new SectionedListPanel( this, "StatsList" );
m_statsList->SetClickable(false);
m_statsList->SetDrawHeaders(false);
m_bottomBar = new ImagePanel(this, "BottomBar");
m_pGroupsList = new vgui::PanelListPanel( this, "listpanel_groups" );
m_pGroupsList->SetFirstColumnWidth( 0 );
SetBounds(0, 0, 900, 780);
SetMinimumSize( 256, 780 );
SetBgColor(GetSchemeColor("ListPanel.BgColor", GetBgColor(), pScheme));
m_pStatCard = new StatCard(this, "ignored");
ListenForGameEvent( "player_stats_updated" );
m_bStatsDirty = true;
}
CBaseStatsPage::~CBaseStatsPage()
{
delete m_statsList;
}
void CBaseStatsPage::MoveToFront()
{
UpdateStatsData();
m_pStatCard->UpdateInfo();
}
void CBaseStatsPage::UpdateStatsData()
{
// Hide the group list scrollbar
if (m_pGroupsList->GetScrollbar())
{
m_pGroupsList->GetScrollbar()->SetWide(0);
}
UpdateGroupPanels();
RepopulateStats();
m_bStatsDirty = false;
}
//-----------------------------------------------------------------------------
// Purpose: Loads settings from statsdialog.res in hl2/resource/ui/
//-----------------------------------------------------------------------------
void CBaseStatsPage::ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
LoadControlSettings("resource/ui/CSBaseStatsDialog.res");
m_statsList->SetClickable(false);
m_statsList->SetDrawHeaders(false);
m_statsList->SetVerticalScrollbar(true);
SetBgColor(Color(86,86,86,255));
//Remove any pre-existing sections and add then fresh (this can happen on a resolution change)
m_statsList->RemoveAllSections();
m_statsList->AddSection( 0, "Players");
m_statsList->SetFontSection(0, m_listItemFont);
m_pGroupsList->SetBgColor(Color(86,86,86,255));
m_statsList->SetBgColor(Color(52,52,52,255));
}
void CBaseStatsPage::SetActiveStatGroup (CBaseStatGroupPanel* groupPanel)
{
for (int i = 0; i < m_pGroupsList->GetItemCount(); i++)
{
CBaseStatGroupPanel *pPanel = (CBaseStatGroupPanel*)m_pGroupsList->GetItemPanel(i);
if ( pPanel )
{
if ( pPanel != groupPanel )
{
pPanel->SetGroupActive( false );
}
else
{
pPanel->SetGroupActive( true );
}
}
}
}
void CBaseStatsPage::UpdateGroupPanels()
{
int iGroupCount = m_pGroupsList->GetItemCount();
vgui::IScheme *pGroupScheme = scheme()->GetIScheme( GetScheme() );
for ( int i = 0; i < iGroupCount; i++ )
{
CBaseStatGroupPanel *pPanel = (CBaseStatGroupPanel*)m_pGroupsList->GetItemPanel(i);
if ( pPanel )
{
pPanel->Update( pGroupScheme );
}
}
}
void CBaseStatsPage::OnSizeChanged(int newWide, int newTall)
{
BaseClass::OnSizeChanged(newWide, newTall);
if (m_statsList)
{
int labelX, labelY, listX, listY, listWide, listTall;
m_statsList->GetBounds(listX, listY, listWide, listTall);
if (m_bottomBar)
{
m_bottomBar->GetPos(labelX, labelY);
m_bottomBar->SetPos(labelX, listY + listTall);
}
}
}
const wchar_t* CBaseStatsPage::TranslateWeaponKillIDToAlias( int statKillID )
{
CSWeaponID weaponIDIndex = WEAPON_MAX;
for ( int i = 0; WeaponName_StatId_Table[i].killStatId != CSSTAT_UNDEFINED; ++i )
{
if( WeaponName_StatId_Table[i].killStatId == statKillID )
{
weaponIDIndex = WeaponName_StatId_Table[i].weaponId;
break;
}
}
if (weaponIDIndex == WEAPON_MAX)
{
return NULL;
}
else
{
return WeaponIDToDisplayName(weaponIDIndex);
}
}
const wchar_t* CBaseStatsPage::LocalizeTagOrUseDefault( const char* tag, const wchar_t* def )
{
const wchar_t* result = g_pVGuiLocalize->Find( tag );
if ( !result )
result = def ? def : L"\0";
return result;
}
CBaseStatGroupPanel* CBaseStatsPage::AddGroup( const wchar_t* name, const char* title_tag, const wchar_t* def )
{
CBaseStatGroupPanel* newGroup = new CBaseStatGroupPanel( m_pGroupsList, this, "StatGroupPanel", 0 );
newGroup->SetGroupInfo( name, LocalizeTagOrUseDefault( title_tag, def ) );
newGroup->SetGroupActive( false );
m_pGroupsList->AddItem( NULL, newGroup );
return newGroup;
}
void CBaseStatsPage::FireGameEvent( IGameEvent * event )
{
const char *type = event->GetName();
if ( 0 == Q_strcmp( type, "player_stats_updated" ) )
m_bStatsDirty = true;
}
void CBaseStatsPage::OnThink()
{
if ( m_bStatsDirty )
UpdateStatsData();
}
CBaseStatGroupPanel::CBaseStatGroupPanel( vgui::PanelListPanel *parent, CBaseStatsPage *owner, const char* name, int iListItemID ) : BaseClass( parent, name )
{
m_pParent = parent;
m_pOwner = owner;
m_pSchemeSettings = NULL;
m_pGroupIcon = SETUP_PANEL(new vgui::ImagePanel( this, "GroupIcon" ));
m_pBaseStatGroupLabel = new vgui::Label( this, "GroupName", "name" );
m_pGroupButton = new CBaseStatGroupButton(this, "GroupButton", "" );
m_pGroupButton->SetPos( 0, 0 );
m_pGroupButton->SetZPos( 20 );
m_pGroupButton->SetWide( 256 );
m_pGroupButton->SetTall( 64 );
SetMouseInputEnabled( true );
parent->SetMouseInputEnabled( true );
m_bActiveButton = false;
}
CBaseStatGroupPanel::~CBaseStatGroupPanel()
{
delete m_pBaseStatGroupLabel;
delete m_pGroupIcon;
}
//-----------------------------------------------------------------------------
// Purpose: Sets the parameter pIconPanel to display the specified achievement's icon file.
//-----------------------------------------------------------------------------
bool CBaseStatGroupPanel::LoadIcon( const char* pFilename)
{
char imagePath[_MAX_PATH];
Q_strncpy( imagePath, "achievements\\", sizeof(imagePath) );
Q_strncat( imagePath, pFilename, sizeof(imagePath), COPY_ALL_CHARACTERS );
Q_strncat( imagePath, ".vtf", sizeof(imagePath), COPY_ALL_CHARACTERS );
char checkFile[_MAX_PATH];
Q_snprintf( checkFile, sizeof(checkFile), "materials\\vgui\\%s", imagePath );
if ( !g_pFullFileSystem->FileExists( checkFile ) )
{
Q_snprintf( imagePath, sizeof(imagePath), "hud\\icon_locked.vtf" );
}
m_pGroupIcon->SetShouldScaleImage( true );
m_pGroupIcon->SetImage( imagePath );
m_pGroupIcon->SetVisible( true );
return m_pGroupIcon->IsVisible();
}
//-----------------------------------------------------------------------------
// Purpose: Loads settings from hl2/resource/ui/achievementitem.res
// Sets display info for this achievement item.
//-----------------------------------------------------------------------------
void CBaseStatGroupPanel::ApplySchemeSettings( vgui::IScheme* pScheme )
{
if ( !g_pPreloadedCSBaseStatGroupLayout )
{
PreloadResourceFile();
}
LoadControlSettings( "", NULL, g_pPreloadedCSBaseStatGroupLayout );
m_pSchemeSettings = pScheme;
BaseClass::ApplySchemeSettings( pScheme );
}
void CBaseStatGroupPanel::Update( vgui::IScheme* pScheme )
{
if ( m_pSchemeSettings )
{
// Set group name text
m_pBaseStatGroupLabel->SetText( m_pGroupTitle );
m_pBaseStatGroupLabel->SetFgColor(Color(157, 194, 80, 255));
if ( !m_bActiveButton )
{
LoadIcon( "achievement-btn-up" );
}
else
{
LoadIcon( "achievement-btn-select" );
}
}
}
//-----------------------------------------------------------------------------
// Purpose:
//-----------------------------------------------------------------------------
void CBaseStatGroupPanel::PreloadResourceFile( void )
{
const char *controlResourceName = "resource/ui/StatGroup.res";
g_pPreloadedCSBaseStatGroupLayout = new KeyValues(controlResourceName);
g_pPreloadedCSBaseStatGroupLayout->LoadFromFile(g_pFullFileSystem, controlResourceName);
}
//-----------------------------------------------------------------------------
// Purpose: Assigns a name and achievement id bounds for an achievement group.
//-----------------------------------------------------------------------------
void CBaseStatGroupPanel::SetGroupInfo ( const wchar_t* name, const wchar_t* title)
{
// Store away the group name
short _textLen = (short)wcslen(name) + 1;
m_pGroupName = new wchar_t[_textLen];
Q_memcpy( m_pGroupName, name, _textLen * sizeof(wchar_t) );
_textLen = (short)wcslen(title) + 1;
m_pGroupTitle = new wchar_t[_textLen];
Q_memcpy( m_pGroupTitle, title, _textLen * sizeof(wchar_t) );
}
CBaseStatGroupButton::CBaseStatGroupButton( vgui::Panel *pParent, const char *pName, const char *pText ) :
BaseClass( pParent, pName, pText )
{
}
//-----------------------------------------------------------------------------
// Purpose: Handle the case where the user presses an achievement group button.
//-----------------------------------------------------------------------------
void CBaseStatGroupButton::DoClick( void )
{
// Process when a group button is hit
CBaseStatGroupPanel* pParent = static_cast<CBaseStatGroupPanel*>(GetParent());
if (pParent)
{
CBaseStatsPage* pBaseStatsPage = static_cast<CBaseStatsPage*>(pParent->GetOwner());
if (pBaseStatsPage)
{
pBaseStatsPage->SetActiveStatGroup( pParent );
pBaseStatsPage->UpdateStatsData();
}
}
}
-135
View File
@@ -1,135 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef CSBASESTATSPAGE_H
#define CSBASESTATSPAGE_H
#ifdef _WIN32
#pragma once
#endif
#include "vgui_controls/PanelListPanel.h"
#include "vgui_controls/Label.h"
#include "tier1/KeyValues.h"
#include "vgui_controls/PropertyPage.h"
#include "vgui_controls/Button.h"
#include "vgui_controls/ImagePanel.h"
#include "GameEventListener.h"
struct PlayerStatData_t;
class IScheme;
class CBaseStatGroupPanel;
class StatCard;
struct StatsCollection_t;
struct RoundStatsDirectAverage_t;
class CBaseStatsPage : public vgui::PropertyPage, public CGameEventListener
{
DECLARE_CLASS_SIMPLE ( CBaseStatsPage, vgui::PropertyPage );
public:
CBaseStatsPage( vgui::Panel *parent, const char *name );
~CBaseStatsPage();
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
virtual void MoveToFront();
virtual void OnSizeChanged(int wide, int tall);
virtual void OnThink();
void UpdateStatsData();
void SetActiveStatGroup (CBaseStatGroupPanel* groupPanel);
virtual void FireGameEvent( IGameEvent * event );
protected:
void UpdateGroupPanels();
CBaseStatGroupPanel* AddGroup( const wchar_t* name, const char* title_tag, const wchar_t* def = NULL );
const wchar_t* TranslateWeaponKillIDToAlias( int statKillID );
const wchar_t* LocalizeTagOrUseDefault( const char* tag, const wchar_t* def = NULL );
virtual void RepopulateStats() = 0;
vgui::SectionedListPanel *m_statsList;
vgui::HFont m_listItemFont;
private:
vgui::PanelListPanel *m_pGroupsList;
vgui::ImagePanel* m_bottomBar;
StatCard* m_pStatCard;
bool m_bStatsDirty;
};
class CBaseStatGroupButton : public vgui::Button
{
DECLARE_CLASS_SIMPLE( CBaseStatGroupButton, vgui::Button );
public:
CBaseStatGroupButton( vgui::Panel *pParent, const char *pName, const char *pText );
virtual void DoClick( void );
};
class CBaseStatGroupPanel : public vgui::EditablePanel
{
DECLARE_CLASS_SIMPLE( CBaseStatGroupPanel, vgui::EditablePanel );
public:
CBaseStatGroupPanel( vgui::PanelListPanel *parent, CBaseStatsPage *owner, const char* name, int iListItemID );
~CBaseStatGroupPanel();
void SetGroupInfo ( const wchar_t* name, const wchar_t* title);
virtual void ApplySchemeSettings( vgui::IScheme *pScheme );
void Update( vgui::IScheme* pScheme );
vgui::PanelListPanel* GetParent() { return m_pParent; }
CBaseStatsPage* GetOwner() { return m_pOwner; }
void SetGroupActive(bool active) { m_bActiveButton = active; }
bool IsGroupActive() { return m_bActiveButton; }
protected:
// Loads an icon into a specified image panel, or turns the panel off if no icon was found.
bool LoadIcon( const char* pFilename);
private:
void PreloadResourceFile( void );
vgui::PanelListPanel *m_pParent;
CBaseStatsPage *m_pOwner;
vgui::Label *m_pBaseStatGroupLabel;
CBaseStatGroupButton *m_pGroupButton;
vgui::ImagePanel *m_pGroupIcon;
vgui::IScheme *m_pSchemeSettings;
bool m_bActiveButton;
wchar_t *m_pGroupName;
wchar_t *m_pGroupTitle;
};
#endif // CSBASESTATSPAGE_H
@@ -1,27 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//-------------------------------------------------------------
// File: BorderedPanel.cpp
// Desc:
// Author: Peter Freese <peter@hiddenpath.com>
// Date: 2009/05/20
// Copyright: © 2009 Hidden Path Entertainment
//-------------------------------------------------------------
#include "cbase.h"
#include "bordered_panel.h"
#include "backgroundpanel.h" // rounded border support
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
void BorderedPanel::PaintBackground()
{
int wide, tall;
GetSize( wide, tall );
DrawRoundedBackground( GetBgColor(), wide, tall );
DrawRoundedBorder( GetFgColor(), wide, tall );
}
DECLARE_BUILD_FACTORY( BorderedPanel );
-35
View File
@@ -1,35 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//-------------------------------------------------------------
// File: bordered_panel.h
// Desc:
// Author: Peter Freese <peter@hiddenpath.com>
// Date: 2009/05/20
// Copyright: © 2009 Hidden Path Entertainment
//-------------------------------------------------------------
#ifndef INCLUDED_BorderedPanel
#define INCLUDED_BorderedPanel
#pragma once
#include <vgui_controls/EditablePanel.h>
using namespace vgui;
//-----------------------------------------------------------------------------
// Purpose: Editable panel with a forced rounded/outlined border
//-----------------------------------------------------------------------------
class BorderedPanel : public EditablePanel
{
public:
DECLARE_CLASS_SIMPLE( BorderedPanel, EditablePanel );
BorderedPanel( Panel *parent, const char *name ) :
EditablePanel( parent, name )
{
}
void PaintBackground();
};
#endif // INCLUDED_BorderedPanel
@@ -1,397 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
// $NoKeywords: $
//=============================================================================//
#ifndef BUYMOUSEOVERPANELBUTTON_H
#define BUYMOUSEOVERPANELBUTTON_H
#ifdef _WIN32
#pragma once
#endif
#include <KeyValues.h>
#include <filesystem.h>
#include "mouseoverpanelbutton.h"
#include "hud.h"
#include "c_cs_player.h"
#include "cs_gamerules.h"
#include "cstrike/bot/shared_util.h"
#include <vgui/ISurface.h>
#include <vgui/ILocalize.h>
#include <vgui_controls/ImagePanel.h>
using namespace vgui;
//-----------------------------------------------------------------------------
// Purpose: Triggers a new panel when the mouse goes over the button
//-----------------------------------------------------------------------------
class BuyMouseOverPanelButton : public MouseOverPanelButton
{
private:
typedef MouseOverPanelButton BaseClass;
public:
BuyMouseOverPanelButton(vgui::Panel *parent, const char *panelName, vgui::EditablePanel *panel) :
MouseOverPanelButton( parent, panelName, panel)
{
m_iPrice = 0;
m_iPreviousPrice = 0;
m_iASRestrict = 0;
m_iDEUseOnly = 0;
m_command = NULL;
m_bIsBargain = false;
m_pBlackMarketPrice = NULL;//new EditablePanel( parent, "BlackMarket_Labels" );
if ( m_pBlackMarketPrice )
{
m_pBlackMarketPrice->LoadControlSettings( "Resource/UI/BlackMarket_Labels.res" );
int x,y,wide,tall;
GetClassPanel()->GetBounds( x, y, wide, tall );
m_pBlackMarketPrice->SetBounds( x, y, wide, tall );
int px, py;
GetClassPanel()->GetPinOffset( px, py );
int rx, ry;
GetClassPanel()->GetResizeOffset( rx, ry );
// Apply pin settings from template, too
m_pBlackMarketPrice->SetAutoResize( GetClassPanel()->GetPinCorner(), GetClassPanel()->GetAutoResize(), px, py, rx, ry );
}
}
virtual void ApplySettings( KeyValues *resourceData )
{
BaseClass::ApplySettings( resourceData );
KeyValues *kv = resourceData->FindKey( "cost", false );
if( kv ) // if this button has a cost defined for it
{
m_iPrice = kv->GetInt(); // save the price away
}
kv = resourceData->FindKey( "as_restrict", false );
if( kv ) // if this button has a map limitation for it
{
m_iASRestrict = kv->GetInt(); // save the as_restrict away
}
kv = resourceData->FindKey( "de_useonly", false );
if( kv ) // if this button has a map limitation for it
{
m_iDEUseOnly = kv->GetInt(); // save the de_useonly away
}
if ( m_command )
{
delete[] m_command;
m_command = NULL;
}
kv = resourceData->FindKey( "command", false );
if ( kv )
{
m_command = CloneString( kv->GetString() );
}
SetPriceState();
SetMapTypeState();
}
int GetASRestrict() { return m_iASRestrict; }
int GetDEUseOnly() { return m_iDEUseOnly; }
virtual void PerformLayout()
{
BaseClass::PerformLayout();
SetPriceState();
SetMapTypeState();
#ifndef CS_SHIELD_ENABLED
if ( !Q_stricmp( GetName(), "shield" ) )
{
SetVisible( false );
SetEnabled( false );
}
#endif
}
virtual void ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
m_avaliableColor = pScheme->GetColor( "Label.TextColor", Color( 0, 0, 0, 0 ) );
m_unavailableColor = pScheme->GetColor( "Label.DisabledFgColor2", Color( 0, 0, 0, 0 ) );
m_bargainColor = Color( 0, 255, 0, 192 );
SetPriceState();
SetMapTypeState();
}
void SetPriceState()
{
if ( CSGameRules() && CSGameRules()->IsBlackMarket() )
{
SetMarketState();
}
else
{
if ( GetParent() )
{
Panel *pPanel = dynamic_cast< Panel * >(GetParent()->FindChildByName( "MarketSticker" ) );
if ( pPanel )
{
pPanel->SetVisible( false );
}
}
m_bIsBargain = false;
}
C_CSPlayer *pPlayer = C_CSPlayer::GetLocalCSPlayer();
if ( m_iPrice && ( pPlayer && m_iPrice > pPlayer->GetAccount() ) )
{
SetFgColor( m_unavailableColor );
SetCommand( "buy_unavailable" );
}
else
{
if ( m_bIsBargain == false )
{
SetFgColor( m_avaliableColor );
}
else
{
SetFgColor( m_bargainColor );
}
SetCommand( m_command );
}
}
void SetMarketState( void )
{
Panel *pClassPanel = GetClassPanel();
if ( pClassPanel )
{
pClassPanel->SetVisible( false );
}
if ( m_pBlackMarketPrice )
{
Label *pLabel = dynamic_cast< Label * >(m_pBlackMarketPrice->FindChildByName( "pricelabel" ) );
if ( pLabel )
{
const int BufLen = 2048;
wchar_t wbuf[BufLen] = L"";
const wchar_t *formatStr = g_pVGuiLocalize->Find("#Cstrike_MarketPreviousPrice");
if ( !formatStr )
formatStr = L"%s1";
char strPrice[16];
wchar_t szPrice[64];
Q_snprintf( strPrice, sizeof( strPrice ), "%d", m_iPreviousPrice );
g_pVGuiLocalize->ConvertANSIToUnicode( strPrice, szPrice, sizeof(szPrice));
g_pVGuiLocalize->ConstructString( wbuf, sizeof(wbuf), formatStr, 1, szPrice );
pLabel->SetText( wbuf );
pLabel->SetVisible( true );
}
pLabel = dynamic_cast< Label * >(m_pBlackMarketPrice->FindChildByName( "price" ) );
if ( pLabel )
{
const int BufLen = 2048;
wchar_t wbuf[BufLen] = L"";
const wchar_t *formatStr = g_pVGuiLocalize->Find("#Cstrike_MarketCurrentPrice");
if ( !formatStr )
formatStr = L"%s1";
char strPrice[16];
wchar_t szPrice[64];
Q_snprintf( strPrice, sizeof( strPrice ), "%d", m_iPrice );
g_pVGuiLocalize->ConvertANSIToUnicode( strPrice, szPrice, sizeof(szPrice));
g_pVGuiLocalize->ConstructString( wbuf, sizeof(wbuf), formatStr, 1, szPrice );
pLabel->SetText( wbuf );
pLabel->SetVisible( true );
}
pLabel = dynamic_cast< Label * >(m_pBlackMarketPrice->FindChildByName( "difference" ) );
if ( pLabel )
{
const int BufLen = 2048;
wchar_t wbuf[BufLen] = L"";
const wchar_t *formatStr = g_pVGuiLocalize->Find("#Cstrike_MarketDeltaPrice");
if ( !formatStr )
formatStr = L"%s1";
char strPrice[16];
wchar_t szPrice[64];
int iDifference = m_iPreviousPrice - m_iPrice;
if ( iDifference >= 0 )
{
pLabel->SetFgColor( m_bargainColor );
}
else
{
pLabel->SetFgColor( Color( 192, 28, 0, 255 ) );
}
Q_snprintf( strPrice, sizeof( strPrice ), "%d", abs( iDifference ) );
g_pVGuiLocalize->ConvertANSIToUnicode( strPrice, szPrice, sizeof(szPrice));
g_pVGuiLocalize->ConstructString( wbuf, sizeof(wbuf), formatStr, 1, szPrice );
pLabel->SetText( wbuf );
pLabel->SetVisible( true );
}
ImagePanel *pImage = dynamic_cast< ImagePanel * >(m_pBlackMarketPrice->FindChildByName( "classimage" ) );
if ( pImage )
{
ImagePanel *pClassImage = dynamic_cast< ImagePanel * >(GetClassPanel()->FindChildByName( "classimage" ) );
if ( pClassImage )
{
pImage->SetSize( pClassImage->GetWide(), pClassImage->GetTall() );
pImage->SetImage( pClassImage->GetImage() );
}
}
if ( GetParent() )
{
Panel *pPanel = dynamic_cast< Panel * >(GetParent()->FindChildByName( "MarketSticker" ) );
if ( pPanel )
{
if ( m_bIsBargain )
{
pPanel->SetVisible( true );
}
else
{
pPanel->SetVisible( false );
}
}
}
}
}
void SetMapTypeState()
{
CCSGameRules *pRules = CSGameRules();
if ( pRules )
{
if( pRules->IsVIPMap() )
{
if ( m_iASRestrict )
{
SetFgColor( m_unavailableColor );
SetCommand( "buy_unavailable" );
}
}
if ( !pRules->IsBombDefuseMap() )
{
if ( m_iDEUseOnly )
{
SetFgColor( m_unavailableColor );
SetCommand( "buy_unavailable" );
}
}
}
}
void SetBargainButton( bool state )
{
m_bIsBargain = state;
}
void SetCurrentPrice( int iPrice )
{
m_iPrice = iPrice;
}
void SetPreviousPrice( int iPrice )
{
m_iPreviousPrice = iPrice;
}
const char *GetBuyCommand( void )
{
return m_command;
}
virtual void ShowPage()
{
if ( g_lastPanel )
{
for( int i = 0; i< g_lastPanel->GetParent()->GetChildCount(); i++ )
{
MouseOverPanelButton *buyButton = dynamic_cast<MouseOverPanelButton *>(g_lastPanel->GetParent()->GetChild(i));
if ( buyButton )
{
buyButton->HidePage();
}
}
}
BaseClass::ShowPage();
if ( !Q_stricmp( m_command, "vguicancel" ) )
return;
if ( CSGameRules() && CSGameRules()->IsBlackMarket() )
{
if ( m_pBlackMarketPrice && !m_pBlackMarketPrice->IsVisible() )
{
m_pBlackMarketPrice->SetVisible( true );
}
}
}
virtual void HidePage()
{
BaseClass::HidePage();
if ( m_pBlackMarketPrice && m_pBlackMarketPrice->IsVisible() )
{
m_pBlackMarketPrice->SetVisible( false );
}
}
private:
int m_iPrice;
int m_iPreviousPrice;
int m_iASRestrict;
int m_iDEUseOnly;
bool m_bIsBargain;
Color m_avaliableColor;
Color m_unavailableColor;
Color m_bargainColor;
char *m_command;
public:
vgui::EditablePanel *m_pBlackMarketPrice;
};
#endif // BUYMOUSEOVERPANELBUTTON_H
@@ -1,577 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================
#include "cbase.h"
#include "weapon_csbase.h"
#include "cs_ammodef.h"
#include <vgui/IVGui.h>
#include <vgui/IScheme.h>
#include <vgui/ISurface.h>
#include <vgui_controls/Label.h>
#include <vgui/ILocalize.h>
#include "vgui_controls/BuildGroup.h"
#include "vgui_controls/BitmapImagePanel.h"
#include "vgui_controls/TextEntry.h"
#include "vgui_controls/TextImage.h"
#include "vgui_controls/RichText.h"
#include "vgui_controls/QueryBox.h"
#include "career_box.h"
#include "buypreset_listbox.h"
#include "buypreset_weaponsetlabel.h"
#include "cstrike/bot/shared_util.h"
// memdbgon must be the last include file in a .cpp file!!!
#include "tier0/memdbgon.h"
using namespace vgui;
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
WeaponImageInfo::WeaponImageInfo()
{
m_needLayout = m_isCentered = false;
m_left = m_top = m_wide = m_tall = 0;
m_isPrimary = false;
memset( &m_weapon, 0, sizeof(ImageInfo) );
memset( &m_ammo, 0, sizeof(ImageInfo) );
m_weaponScale = m_ammoScale = 0;
m_pAmmoText = new TextImage( "" );
}
//--------------------------------------------------------------------------------------------------------------
WeaponImageInfo::~WeaponImageInfo()
{
delete m_pAmmoText;
}
//--------------------------------------------------------------------------------------------------------------
void WeaponImageInfo::ApplyTextSettings( vgui::IScheme *pScheme, bool isProportional )
{
Color color = pScheme->GetColor( "FgColor", Color( 0, 0, 0, 0 ) );
m_pAmmoText->SetColor( color );
m_pAmmoText->SetFont( pScheme->GetFont( "Default", isProportional ) );
m_pAmmoText->SetWrap( false );
}
//--------------------------------------------------------------------------------------------------------------
void WeaponImageInfo::SetBounds( int left, int top, int wide, int tall )
{
m_left = left;
m_top = top;
m_wide = wide;
m_tall = tall;
m_needLayout = true;
}
//--------------------------------------------------------------------------------------------------------------
void WeaponImageInfo::SetCentered( bool isCentered )
{
m_isCentered = isCentered;
m_needLayout = true;
}
//--------------------------------------------------------------------------------------------------------------
void WeaponImageInfo::SetScaleAt1024( int weaponScale, int ammoScale )
{
m_weaponScale = weaponScale;
m_ammoScale = ammoScale;
m_needLayout = true;
}
//--------------------------------------------------------------------------------------------------------------
void WeaponImageInfo::SetWeapon( const BuyPresetWeapon *pWeapon, bool isPrimary, bool useCurrentAmmoType )
{
m_pAmmoText->SetText( L"" );
m_weapon.image = NULL;
m_ammo.image = NULL;
m_isPrimary = isPrimary;
if ( !pWeapon )
return;
wchar_t *multiplierString = g_pVGuiLocalize->Find("#Cstrike_BuyMenuPresetMultiplier");
if ( !multiplierString )
multiplierString = L"";
const int BufLen = 32;
wchar_t buf[BufLen];
if ( pWeapon->GetAmmoType() == AMMO_CLIPS )
{
CSWeaponID weaponID = pWeapon->GetWeaponID();
const CCSWeaponInfo *info = GetWeaponInfo( weaponID );
int numClips = pWeapon->GetAmmoAmount();
if ( info )
{
int maxRounds = GetCSAmmoDef()->MaxCarry( info->iAmmoType );
int buyClipSize = GetCSAmmoDef()->GetBuySize( info->iAmmoType );
int maxClips = (buyClipSize > 0) ? ceil(maxRounds/(float)buyClipSize) : 0;
numClips = MIN( numClips, maxClips );
m_weapon.image = scheme()->GetImage( ImageFnameFromWeaponID( weaponID, m_isPrimary ), true );
if ( numClips == 0 )
{
m_ammo.image = NULL;
}
else if ( info->m_WeaponType == WEAPONTYPE_SHOTGUN )
{
m_ammo.image = scheme()->GetImage( "gfx/vgui/shell", true );
}
else if ( isPrimary )
{
m_ammo.image = scheme()->GetImage( "gfx/vgui/bullet", true );
}
else
{
m_ammo.image = scheme()->GetImage( "gfx/vgui/cartridge", true );
}
if ( numClips > 1 )
{
g_pVGuiLocalize->ConstructString( buf, sizeof(buf), multiplierString, 1, NumAsWString( numClips ) );
m_pAmmoText->SetText( buf );
}
else
{
m_pAmmoText->SetText( L"" );
}
}
else if ( numClips > 0 || !useCurrentAmmoType )
{
if ( useCurrentAmmoType )
{
CSWeaponID currentID = GetClientWeaponID( isPrimary );
m_weapon.image = scheme()->GetImage( ImageFnameFromWeaponID( currentID, m_isPrimary ), true );
info = GetWeaponInfo( currentID );
if ( !info )
{
m_weapon.image = NULL;
numClips = 0;
}
else if ( info->m_WeaponType == WEAPONTYPE_SHOTGUN )
{
m_ammo.image = scheme()->GetImage( "gfx/vgui/shell", true );
}
else if ( isPrimary )
{
m_ammo.image = scheme()->GetImage( "gfx/vgui/bullet", true );
}
else
{
m_ammo.image = scheme()->GetImage( "gfx/vgui/cartridge", true );
}
}
else
{
m_weapon.image = scheme()->GetImage( ImageFnameFromWeaponID( weaponID, m_isPrimary ), true );
if ( numClips == 0 )
{
m_ammo.image = NULL;
}
else if ( isPrimary )
{
m_ammo.image = scheme()->GetImage( "gfx/vgui/bullet", true );
}
else
{
m_ammo.image = scheme()->GetImage( "gfx/vgui/cartridge", true );
}
}
if ( numClips > 1 )
{
g_pVGuiLocalize->ConstructString( buf, sizeof(buf), multiplierString, 1, NumAsWString( numClips ) );
m_pAmmoText->SetText( buf );
}
else
{
m_pAmmoText->SetText( L"" );
}
}
}
m_needLayout = true;
}
//--------------------------------------------------------------------------------------------------------------
void WeaponImageInfo::Paint()
{
if ( m_needLayout )
PerformLayout();
m_weapon.Paint();
m_ammo.Paint();
}
//--------------------------------------------------------------------------------------------------------------
void WeaponImageInfo::PaintText()
{
if ( m_needLayout )
PerformLayout();
m_pAmmoText->Paint();
}
//--------------------------------------------------------------------------------------------------------------
void WeaponImageInfo::PerformLayout()
{
m_needLayout = false;
m_weapon.FitInBounds( m_left, m_top, m_wide*0.8, m_tall, m_isCentered, m_weaponScale );
int ammoX = MIN( m_wide*5/6, m_weapon.w );
int ammoSize = m_tall * 9 / 16;
if ( !m_isPrimary )
{
ammoSize = ammoSize * 25 / 40;
ammoX = MIN( m_wide*5/6, m_weapon.w*3/4 );
}
if ( ammoX + ammoSize > m_wide )
{
ammoX = m_wide - ammoSize;
}
m_ammo.FitInBounds( m_left + ammoX, m_top + m_tall - ammoSize, ammoSize, ammoSize, false, m_ammoScale );
int w, h;
m_pAmmoText->ResizeImageToContent();
m_pAmmoText->GetSize( w, h );
if ( m_isPrimary )
{
if ( m_ammoScale < 75 )
{
m_pAmmoText->SetPos( m_left + ammoX + ammoSize*1.25f - w, m_top + m_tall - h );
}
else
{
m_pAmmoText->SetPos( m_left + ammoX + ammoSize - w, m_top + m_tall - h );
}
}
else
{
m_pAmmoText->SetPos( m_left + ammoX + ammoSize, m_top + m_tall - h );
}
}
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
WeaponLabel::WeaponLabel(Panel *parent, const char *panelName) : BaseClass( parent, panelName )
{
SetSize( 10, 10 );
SetMouseInputEnabled( false );
}
//--------------------------------------------------------------------------------------------------------------
WeaponLabel::~WeaponLabel()
{
}
//--------------------------------------------------------------------------------------------------------------
void WeaponLabel::SetWeapon( const BuyPresetWeapon *pWeapon, bool isPrimary, bool showAmmo )
{
BuyPresetWeapon weapon(WEAPON_NONE);
if ( pWeapon )
weapon = *pWeapon;
if ( !showAmmo )
weapon.SetAmmoAmount( 0 );
m_weapon.SetWeapon( &weapon, isPrimary, false );
}
//--------------------------------------------------------------------------------------------------------------
void WeaponLabel::ApplySchemeSettings(IScheme *pScheme)
{
BaseClass::ApplySchemeSettings( pScheme );
m_weapon.ApplyTextSettings( pScheme, IsProportional() );
}
//--------------------------------------------------------------------------------------------------------------
void WeaponLabel::PerformLayout()
{
BaseClass::PerformLayout();
int wide, tall;
GetSize( wide, tall );
m_weapon.SetBounds( 0, 0, wide, tall );
}
//--------------------------------------------------------------------------------------------------------------
void WeaponLabel::Paint()
{
BaseClass::Paint();
m_weapon.Paint();
m_weapon.PaintText();
}
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
ItemImageInfo::ItemImageInfo()
{
m_needLayout = false;
m_left = m_top = m_wide = m_tall = 0;
m_count = 0;
memset( &m_image, 0, sizeof(ImageInfo) );
m_pText = new TextImage( "" );
SetBounds( 0, 0, 100, 100 );
}
//--------------------------------------------------------------------------------------------------------------
ItemImageInfo::~ItemImageInfo()
{
delete m_pText;
}
//--------------------------------------------------------------------------------------------------------------
void ItemImageInfo::ApplyTextSettings( vgui::IScheme *pScheme, bool isProportional )
{
Color color = pScheme->GetColor( "Label.TextColor", Color( 0, 0, 0, 0 ) );
m_pText->SetColor( color );
m_pText->SetFont( pScheme->GetFont( "Default", isProportional ) );
m_pText->SetWrap( false );
}
//--------------------------------------------------------------------------------------------------------------
void ItemImageInfo::SetBounds( int left, int top, int wide, int tall )
{
m_left = left;
m_top = top;
m_wide = wide;
m_tall = tall;
m_needLayout = true;
}
//--------------------------------------------------------------------------------------------------------------
void ItemImageInfo::SetItem( const char *imageFname, int count )
{
m_pText->SetText( L"" );
m_count = count;
if ( imageFname )
m_image.image = scheme()->GetImage( imageFname, true );
else
m_image.image = NULL;
if ( count > 1 )
{
wchar_t *multiplierString = g_pVGuiLocalize->Find("#Cstrike_BuyMenuPresetMultiplier");
if ( !multiplierString )
multiplierString = L"";
const int BufLen = 32;
wchar_t buf[BufLen];
g_pVGuiLocalize->ConstructString( buf, sizeof(buf), multiplierString, 1, NumAsWString( count ) );
m_pText->SetText( buf );
}
m_needLayout = true;
}
//--------------------------------------------------------------------------------------------------------------
void ItemImageInfo::Paint()
{
if ( m_needLayout )
PerformLayout();
if ( m_count )
m_image.Paint();
}
//--------------------------------------------------------------------------------------------------------------
void ItemImageInfo::PaintText()
{
if ( m_needLayout )
PerformLayout();
m_pText->Paint();
}
//--------------------------------------------------------------------------------------------------------------
void ItemImageInfo::PerformLayout()
{
m_needLayout = false;
m_image.FitInBounds( m_left, m_top, m_wide, m_tall, false, 0 );
int w, h;
m_pText->ResizeImageToContent();
m_pText->GetSize( w, h );
m_pText->SetPos( m_left + m_image.w - w, m_top + m_tall - h );
}
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
EquipmentLabel::EquipmentLabel(Panel *parent, const char *panelName, const char *imageFname) : BaseClass( parent, panelName )
{
SetSize( 10, 10 );
m_item.SetItem( imageFname, 0 );
SetMouseInputEnabled( false );
}
//--------------------------------------------------------------------------------------------------------------
EquipmentLabel::~EquipmentLabel()
{
}
//--------------------------------------------------------------------------------------------------------------
void EquipmentLabel::SetItem( const char *imageFname, int count )
{
m_item.SetItem( imageFname, count );
}
//--------------------------------------------------------------------------------------------------------------
void EquipmentLabel::ApplySchemeSettings(IScheme *pScheme)
{
BaseClass::ApplySchemeSettings( pScheme );
m_item.ApplyTextSettings( pScheme, IsProportional() );
}
//--------------------------------------------------------------------------------------------------------------
void EquipmentLabel::PerformLayout()
{
BaseClass::PerformLayout();
int wide, tall;
GetSize( wide, tall );
m_item.SetBounds( 0, 0, wide, tall );
}
//--------------------------------------------------------------------------------------------------------------
void EquipmentLabel::Paint()
{
BaseClass::Paint();
m_item.Paint();
m_item.PaintText();
}
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
/// Helper function: draws a simple dashed line
void DrawDashedLine(int x0, int y0, int x1, int y1, int dashLen, int gapLen)
{
// work out which way the line goes
if ((x1 - x0) > (y1 - y0))
{
// x direction line
while (1)
{
if (x0 + dashLen > x1)
{
// draw partial
surface()->DrawFilledRect(x0, y0, x1, y1+1);
}
else
{
surface()->DrawFilledRect(x0, y0, x0 + dashLen, y1+1);
}
x0 += dashLen;
if (x0 + gapLen > x1)
break;
x0 += gapLen;
}
}
else
{
// y direction
while (1)
{
if (y0 + dashLen > y1)
{
// draw partial
surface()->DrawFilledRect(x0, y0, x1+1, y1);
}
else
{
surface()->DrawFilledRect(x0, y0, x1+1, y0 + dashLen);
}
y0 += dashLen;
if (y0 + gapLen > y1)
break;
y0 += gapLen;
}
}
}
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
void ImageInfo::Paint()
{
if ( !image )
return;
image->SetSize( w, h );
image->SetPos( x, y );
image->Paint();
image->SetSize( 0, 0 ); // restore image size to content size to not mess up other places that use the same image
}
//--------------------------------------------------------------------------------------------------------------
void ImageInfo::FitInBounds( int baseX, int baseY, int width, int height, bool center, int scaleAt1024, bool halfHeight )
{
if ( !image )
{
x = y = w = h = 0;
return;
}
image->GetContentSize(fullW, fullH);
if ( scaleAt1024 )
{
int screenW, screenH;
GetHudSize( screenW, screenH );
w = fullW * screenW / 1024 * scaleAt1024 / 100;
h = fullH * screenW / 1024 * scaleAt1024 / 100;
if ( fullH > 64 && scaleAt1024 == 100 )
{
w = w * 64 / fullH;
h = h * 64 / fullH;
}
if ( h > height * 1.2 )
scaleAt1024 = 0;
}
if ( !scaleAt1024 )
{
w = fullW;
h = fullH;
if ( h != height )
{
w = (int) w * 1.0f * height / h;
h = height;
}
if ( w > width )
{
h = (int) h * 1.0f * width / w;
w = width;
}
}
if ( center )
{
x = baseX + (width - w)/2;
}
else
{
x = baseX;
}
y = baseY + (height - h)/2;
}
//--------------------------------------------------------------------------------------------------------------
@@ -1,406 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================
#include "cbase.h"
#include <KeyValues.h>
#include <vgui/MouseCode.h>
#include <vgui/IInput.h>
#include <vgui/IScheme.h>
#include <vgui/ISurface.h>
#include <vgui_controls/EditablePanel.h>
#include <vgui_controls/ScrollBar.h>
#include <vgui_controls/Label.h>
#include <vgui_controls/Button.h>
#include <vgui_controls/Controls.h>
#include "buypreset_listbox.h"
// memdbgon must be the last include file in a .cpp file!!!
#include <tier0/memdbgon.h>
using namespace vgui;
#ifndef max
#define max(a,b) (((a) > (b)) ? (a) : (b))
#endif
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
BuyPresetListBox::BuyPresetListBox( vgui::Panel *parent, char const *panelName ) : Panel( parent, panelName )
{
m_visibleIndex = 0;
m_lastSize = 0;
SetBounds( 0, 0, 100, 100 );
m_vbar = new ScrollBar(this, "PanelListPanelVScroll", true);
m_vbar->SetBounds( 0, 0, 20, 20 );
m_vbar->SetVisible(true);
m_vbar->AddActionSignalTarget( this );
m_pPanelEmbedded = new EditablePanel(this, "PanelListEmbedded");
m_pPanelEmbedded->SetBounds(0, 0, 20, 20);
m_pPanelEmbedded->SetPaintBackgroundEnabled( false );
m_pPanelEmbedded->SetPaintBorderEnabled(false);
if( IsProportional() )
{
int width, height;
int sw,sh;
surface()->GetProportionalBase( width, height );
GetHudSize(sw, sh);
// resize scrollbar, etc
m_iScrollbarSize = static_cast<int>( static_cast<float>( SCROLLBAR_SIZE )*( static_cast<float>( sw )/ static_cast<float>( width )));
m_iDefaultHeight = static_cast<int>( static_cast<float>( DEFAULT_HEIGHT )*( static_cast<float>( sw )/ static_cast<float>( width )));
m_iPanelBuffer = static_cast<int>( static_cast<float>( PANELBUFFER )*( static_cast<float>( sw )/ static_cast<float>( width )));
}
else
{
m_iScrollbarSize = SCROLLBAR_SIZE;
m_iDefaultHeight = DEFAULT_HEIGHT;
m_iPanelBuffer = PANELBUFFER;
}
}
//--------------------------------------------------------------------------------------------------------------
BuyPresetListBox::~BuyPresetListBox()
{
// free data from table
DeleteAllItems();
}
//--------------------------------------------------------------------------------------------------------------
/**
* Passes commands up to the parent
*/
void BuyPresetListBox::OnCommand( const char *command )
{
GetParent()->OnCommand( command );
}
//--------------------------------------------------------------------------------------------------------------
/**
* Scrolls the list according to the mouse wheel movement
*/
void BuyPresetListBox::OnMouseWheeled(int delta)
{
int scale = 3;
if ( m_items.Count() )
{
Panel *panel = m_items[0].panel;
if ( panel )
{
scale = panel->GetTall() + m_iPanelBuffer;
}
}
int val = m_vbar->GetValue();
val -= (delta * scale);
m_vbar->SetValue(val);
}
//--------------------------------------------------------------------------------------------------------------
/**
* Computes vertical pixels needed by listbox contents
*/
int BuyPresetListBox::computeVPixelsNeeded( void )
{
int pixels = 0;
int i;
for ( i = 0; i < m_items.Count(); i++ )
{
Panel *panel = m_items[i].panel;
if ( !panel )
continue;
int w, h;
panel->GetSize( w, h );
pixels += m_iPanelBuffer; // add in buffer. between items.
pixels += h;
}
pixels += m_iPanelBuffer; // add in buffer below last item
return pixels;
}
//--------------------------------------------------------------------------------------------------------------
/**
* Adds an item to the end of the listbox. UserData is assumed to be a pointer that can be freed by the listbox if non-NULL.
*/
int BuyPresetListBox::AddItem( vgui::Panel *panel, void * userData )
{
assert(panel);
DataItem item = { panel, userData };
panel->SetParent( m_pPanelEmbedded );
m_items.AddToTail( item );
InvalidateLayout();
return m_items.Count();
}
//--------------------------------------------------------------------------------------------------------------
/**
* Exchanges two items in the listbox
*/
void BuyPresetListBox::SwapItems( int index1, int index2 )
{
if ( index1 < 0 || index2 < 0 || index1 >= m_items.Count() || index2 >= m_items.Count() )
{
return;
}
DataItem temp = m_items[index1];
m_items[index1] = m_items[index2];
m_items[index2] = temp;
InvalidateLayout();
}
//--------------------------------------------------------------------------------------------------------------
/**
* Returns the number of items in the listbox
*/
int BuyPresetListBox::GetItemCount( void ) const
{
return m_items.Count();
}
//--------------------------------------------------------------------------------------------------------------
/**
* Returns the panel in the given index, or NULL
*/
Panel * BuyPresetListBox::GetItemPanel(int index) const
{
if ( index < 0 || index >= m_items.Count() )
return NULL;
return m_items[index].panel;
}
//--------------------------------------------------------------------------------------------------------------
/**
* Returns the userData in the given index, or NULL
*/
void * BuyPresetListBox::GetItemUserData(int index)
{
if ( index < 0 || index >= m_items.Count() )
{
return NULL;
}
return m_items[index].userData;
}
//--------------------------------------------------------------------------------------------------------------
/**
* Sets the userData in the given index
*/
void BuyPresetListBox::SetItemUserData( int index, void * userData )
{
if ( index < 0 || index >= m_items.Count() )
return;
m_items[index].userData = userData;
}
//--------------------------------------------------------------------------------------------------------------
/**
* Removes an item from the table (changing the indices of all following items), deleting the panel and userData
*/
void BuyPresetListBox::RemoveItem(int index)
{
if ( index < 0 || index >= m_items.Count() )
return;
DataItem item = m_items[index];
if ( item.panel )
{
item.panel->MarkForDeletion();
}
if ( item.userData )
{
delete item.userData;
}
m_items.Remove( index );
InvalidateLayout();
}
//--------------------------------------------------------------------------------------------------------------
/**
* clears the listbox, deleting all panels and userData
*/
void BuyPresetListBox::DeleteAllItems()
{
while ( m_items.Count() )
{
RemoveItem( 0 );
}
// move the scrollbar to the top of the list
m_vbar->SetValue(0);
InvalidateLayout();
}
//--------------------------------------------------------------------------------------------------------------
/**
* Handles Count changes
*/
void BuyPresetListBox::OnSizeChanged(int wide, int tall)
{
BaseClass::OnSizeChanged(wide, tall);
InvalidateLayout();
}
//--------------------------------------------------------------------------------------------------------------
/**
* Positions listbox items, etc after internal changes
*/
void BuyPresetListBox::PerformLayout()
{
int wide, tall;
GetSize( wide, tall );
int vpixels = computeVPixelsNeeded();
int visibleIndex = m_visibleIndex;
//!! need to make it recalculate scroll positions
m_vbar->SetVisible(true);
m_vbar->SetEnabled(false);
m_vbar->SetRange( 0, (MAX( 0, vpixels - tall + m_iDefaultHeight )) );
m_vbar->SetRangeWindow( m_iDefaultHeight );
m_vbar->SetButtonPressedScrollValue( m_iDefaultHeight ); // standard height of labels/buttons etc.
m_vbar->SetPos(wide - m_iScrollbarSize, 1);
m_vbar->SetSize(m_iScrollbarSize, tall - 2);
m_visibleIndex = visibleIndex;
int top = MAX( 0, m_vbar->GetValue() );
m_pPanelEmbedded->SetPos( 1, -top );
m_pPanelEmbedded->SetSize( wide-m_iScrollbarSize -2, vpixels );
// Now lay out the controls on the embedded panel
int y = 0;
int h = 0;
int totalh = 0;
int i;
for ( i = 0; i < m_items.Count(); i++, y += h )
{
// add in a little buffer between panels
y += m_iPanelBuffer;
DataItem item = m_items[i];
h = item.panel->GetTall();
totalh += h;
item.panel->SetBounds( 8, y, wide - m_iScrollbarSize - 8 - 8, h );
item.panel->InvalidateLayout();
}
if ( m_visibleIndex >= 0 && m_visibleIndex < m_items.Count() )
{
int vpos = 0;
int tempWide, tempTall;
GetSize( tempWide, tempTall );
int vtop, vbottom;
m_vbar->GetRange( vtop, vbottom );
int tempTop = MAX( 0, m_vbar->GetValue() ); // top pixel in the embedded panel
int bottom = tempTop + tempTall - 2;
int itemTop, itemLeft, itemBottom, itemRight;
m_items[m_visibleIndex].panel->GetBounds( itemLeft, itemTop, itemRight, itemBottom );
itemBottom += itemTop;
itemRight += itemLeft;
if ( itemTop < tempTop )
{
// item's top is too high
vpos -= ( tempTop - itemTop );
m_vbar->SetValue(vpos);
OnSliderMoved(vpos);
}
else if ( itemBottom > bottom )
{
// item's bottom is too low
vpos += ( itemBottom - bottom );
m_vbar->SetValue(vpos);
OnSliderMoved(vpos);
}
}
if ( m_lastSize == vpixels )
{
m_visibleIndex = -1;
}
m_lastSize = vpixels;
}
//--------------------------------------------------------------------------------------------------------------
/**
* Try to ensure that the given index is visible
*/
void BuyPresetListBox::MakeItemVisible( int index )
{
m_visibleIndex = index;
m_lastSize = 0;
}
//--------------------------------------------------------------------------------------------------------------
/**
* Loads colors, fonts, etc
*/
void BuyPresetListBox::ApplySchemeSettings(IScheme *pScheme)
{
BaseClass::ApplySchemeSettings(pScheme);
SetBgColor(GetSchemeColor("BuyPresetListBox.BgColor", GetBgColor(), pScheme));
SetBorder(pScheme->GetBorder("BrowserBorder"));
m_vbar->SetBorder(pScheme->GetBorder("BrowserBorder"));
PerformLayout();
}
//--------------------------------------------------------------------------------------------------------------
/**
* Handles slider being dragged
*/
void BuyPresetListBox::OnSliderMoved( int position )
{
InvalidateLayout();
Repaint();
}
//--------------------------------------------------------------------------------------------------------------
/**
* Moves slider to the top
*/
void BuyPresetListBox::MoveScrollBarToTop()
{
m_vbar->SetValue(0);
OnSliderMoved(0);
}
@@ -1,78 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================
#ifndef BUYPRESET_LISTBOX_H
#define BUYPRESET_LISTBOX_H
#ifdef _WIN32
#pragma once
#endif
#include <vgui/VGUI.h>
#include <vgui_controls/Panel.h>
#include <utlvector.h>
//--------------------------------------------------------------------------------------------------------------
/**
* ListBox-style control with behavior needed by weapon lists for BuyPreset editing
*/
class BuyPresetListBox : public vgui::Panel
{
DECLARE_CLASS_SIMPLE( BuyPresetListBox, vgui::Panel );
public:
BuyPresetListBox( vgui::Panel *parent, char const *panelName );
~BuyPresetListBox();
virtual int AddItem( vgui::Panel *panel, void * userData ); ///< Adds an item to the end of the listbox. UserData is assumed to be a pointer that can be freed by the listbox if non-NULL.
virtual int GetItemCount( void ) const; ///< Returns the number of items in the listbox
void SwapItems( int index1, int index2 ); ///< Exchanges two items in the listbox
void MakeItemVisible( int index ); ///< Try to ensure that the given index is visible
vgui::Panel * GetItemPanel( int index ) const; ///< Returns the panel in the given index, or NULL
void * GetItemUserData( int index ); ///< Returns the userData in the given index, or NULL
void SetItemUserData( int index, void * userData ); ///< Sets the userData in the given index
virtual void RemoveItem( int index ); ///< Removes an item from the table (changing the indices of all following items), deleting the panel and userData
virtual void DeleteAllItems(); ///< clears the listbox, deleting all panels and userData
// overrides
virtual void OnSizeChanged(int wide, int tall); ////< Handles size changes
MESSAGE_FUNC_INT( OnSliderMoved, "ScrollBarSliderMoved", position ); ///< Handles slider being dragged
virtual void OnMouseWheeled(int delta); ///< Scrolls the list according to the mouse wheel movement
virtual void MoveScrollBarToTop(); ///< Moves slider to the top
protected:
virtual int computeVPixelsNeeded( void ); ///< Computes vertical pixels needed by listbox contents
virtual void PerformLayout(); ///< Positions listbox items, etc after internal changes
virtual void ApplySchemeSettings( vgui::IScheme *pScheme ); ///< Loads colors, fonts, etc
virtual void OnCommand( const char *command ); ///< Passes commands up to the parent
private:
enum { SCROLLBAR_SIZE = 18, DEFAULT_HEIGHT = 24, PANELBUFFER = 5 };
typedef struct dataitem_s
{
vgui::Panel *panel;
void * userData;
} DataItem;
CUtlVector< DataItem > m_items;
vgui::ScrollBar *m_vbar;
vgui::Panel *m_pPanelEmbedded;
int m_iScrollbarSize;
int m_iDefaultHeight;
int m_iPanelBuffer;
int m_visibleIndex;
int m_lastSize;
};
#endif // BUYPRESET_LISTBOX_H
@@ -1,447 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================
#include "cbase.h"
#include "weapon_csbase.h"
#include "cs_ammodef.h"
#include <vgui/IVGui.h>
#include <vgui/IScheme.h>
#include <vgui/ISurface.h>
#include <vgui_controls/Label.h>
#include <vgui/ILocalize.h>
#include "vgui_controls/BuildGroup.h"
#include "vgui_controls/BitmapImagePanel.h"
#include "vgui_controls/TextEntry.h"
#include "vgui_controls/TextImage.h"
#include "vgui_controls/RichText.h"
#include "vgui_controls/QueryBox.h"
#include "career_box.h"
#include "buypreset_listbox.h"
#include "buypreset_weaponsetlabel.h"
#include "backgroundpanel.h"
#include "cstrike/bot/shared_util.h"
using namespace vgui;
const float horizTitleRatio = 18.0f/68.0f;
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
/*
class PresetNameTextEntry : public TextEntry
{
public:
PresetNameTextEntry(Panel *parent, CBuyPresetEditMainMenu *menu, const char *name ) : TextEntry( parent, name )
{
m_pMenu = menu;
}
virtual void FireActionSignal()
{
TextEntry::FireActionSignal();
if ( m_pMenu )
{
m_pMenu->SetDirty();
}
}
private:
CBuyPresetEditMainMenu *m_pMenu;
};
*/
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
int GetScaledValue( HScheme hScheme, int unscaled )
{
int val = scheme()->GetProportionalScaledValueEx( hScheme, unscaled );
return GetAlternateProportionalValueFromScaled( hScheme, val );
}
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
class PresetBackgroundPanel : public vgui::Panel
{
typedef vgui::Panel BaseClass;
public:
PresetBackgroundPanel( vgui::Panel *parent, const char *panelName ) : BaseClass( parent, panelName )
{
};
virtual void ApplySchemeSettings( vgui::IScheme *pScheme )
{
BaseClass::ApplySchemeSettings( pScheme );
SetBorder( pScheme->GetBorder("ButtonBorder") );
m_lineColor = pScheme->GetColor( "Border.Bright", Color( 0, 0, 0, 0 ) );
}
virtual void ApplySettings( KeyValues *inResourceData )
{
BaseClass::ApplySettings( inResourceData );
m_lines.RemoveAll();
KeyValues *lines = inResourceData->FindKey( "lines", false );
if ( lines )
{
KeyValues *line = lines->GetFirstValue();
while ( line )
{
const char *str = line->GetString( NULL, "" );
Vector4D p;
int numPoints = sscanf( str, "%f %f %f %f", &p[0], &p[1], &p[2], &p[3] );
if ( numPoints == 4 )
{
m_lines.AddToTail( p );
}
line = line->GetNextValue();
}
}
}
virtual void PaintBackground( void )
{
BaseClass::PaintBackground();
vgui::surface()->DrawSetColor( m_lineColor );
vgui::surface()->DrawSetTextColor( m_lineColor );
for ( int i=0; i<m_scaledLines.Count(); ++i )
{
int x1, x2, y1, y2;
x1 = m_scaledLines[i][0];
y1 = m_scaledLines[i][1];
x2 = m_scaledLines[i][2];
y2 = m_scaledLines[i][3];
vgui::surface()->DrawFilledRect( x1, y1, x2, y2 );
}
}
virtual void PerformLayout( void )
{
m_scaledLines.RemoveAll();
for ( int i=0; i<m_lines.Count(); ++i )
{
int x1, x2, y1, y2;
x1 = GetScaledValue( GetScheme(), m_lines[i][0] );
y1 = GetScaledValue( GetScheme(), m_lines[i][1] );
x2 = GetScaledValue( GetScheme(), m_lines[i][2] );
y2 = GetScaledValue( GetScheme(), m_lines[i][3] );
if ( x1 == x2 )
{
++x2;
}
if ( y1 == y2 )
{
++y2;
}
m_scaledLines.AddToTail( Vector4D( x1, y1, x2, y2 ) );
}
}
private:
Color m_lineColor;
CUtlVector< Vector4D > m_lines;
CUtlVector< Vector4D > m_scaledLines;
};
//--------------------------------------------------------------------------------------------------------------
//--------------------------------------------------------------------------------------------------------------
BuyPresetEditPanel::BuyPresetEditPanel( Panel *parent, const char *panelName, const char *resourceFilename, int fallbackIndex, bool editableName ) : BaseClass( parent, panelName )
{
SetProportional( parent->IsProportional() );
if ( IsProportional() )
{
m_baseWide = m_baseTall = scheme()->GetProportionalScaledValueEx( GetScheme(), 100 );
}
else
{
m_baseWide = m_baseTall = 100;
}
SetSize( m_baseWide, m_baseTall );
m_fallbackIndex = fallbackIndex;
m_pBgPanel = new PresetBackgroundPanel( this, "mainBackground" );
m_pTitleEntry = NULL;
m_pTitleLabel = NULL;
m_pCostLabel = NULL;
/*
m_pTitleEntry = new PresetNameTextEntry( this, dynamic_cast<CBuyPresetEditMainMenu *>(parent), "titleEntry" );
m_pTitleLabel = new Label( this, "title", "" );
m_pCostLabel = new Label( this, "cost", "" );
*/
m_pPrimaryWeapon = new WeaponLabel( this, "primary" );
m_pSecondaryWeapon = new WeaponLabel( this, "secondary" );
m_pHEGrenade = new EquipmentLabel( this, "hegrenade" );
m_pSmokeGrenade = new EquipmentLabel( this, "smokegrenade" );
m_pFlashbangs = new EquipmentLabel( this, "flashbang" );
m_pDefuser = new EquipmentLabel( this, "defuser" );
m_pNightvision = new EquipmentLabel( this, "nightvision" );
m_pArmor = new EquipmentLabel( this, "armor" );
if ( resourceFilename )
{
LoadControlSettings( resourceFilename );
}
int x, y, w, h;
m_pBgPanel->GetBounds( x, y, w, h );
m_baseWide = x + w;
m_baseTall = y + h;
SetSize( m_baseWide, m_baseTall );
}
//--------------------------------------------------------------------------------------------------------------
BuyPresetEditPanel::~BuyPresetEditPanel()
{
}
//--------------------------------------------------------------------------------------------------------------
void BuyPresetEditPanel::SetWeaponSet( const WeaponSet *pWeaponSet, bool current )
{
// set to empty state
Reset();
// now fill in items
if ( pWeaponSet )
{
if ( m_pTitleLabel )
{
m_pTitleLabel->SetText( SharedVarArgs( "#Cstrike_BuyPresetChoice%d", m_fallbackIndex ) );
}
if ( m_pTitleEntry )
{
m_pTitleEntry->SetText( SharedVarArgs( "#Cstrike_BuyPresetChoice%d", m_fallbackIndex ) );
}
if ( m_pCostLabel )
{
const int BufLen = 256;
wchar_t wbuf[BufLen];
g_pVGuiLocalize->ConstructString( wbuf, sizeof( wbuf ),
g_pVGuiLocalize->Find( "#Cstrike_BuyPresetPlainCost" ),
1, NumAsWString( pWeaponSet->FullCost() ) );
m_pCostLabel->SetText( wbuf );
}
m_pPrimaryWeapon->SetWeapon( &pWeaponSet->m_primaryWeapon, true, true );
m_pSecondaryWeapon->SetWeapon( &pWeaponSet->m_secondaryWeapon, false, true );
if ( pWeaponSet->m_HEGrenade )
m_pHEGrenade->SetItem( "gfx/vgui/hegrenade_square", 1 );
if ( pWeaponSet->m_smokeGrenade )
m_pSmokeGrenade->SetItem( "gfx/vgui/smokegrenade_square", 1 );
if ( pWeaponSet->m_flashbangs )
m_pFlashbangs->SetItem( "gfx/vgui/flashbang_square", pWeaponSet->m_flashbangs );
if ( pWeaponSet->m_defuser )
m_pDefuser->SetItem( "gfx/vgui/defuser", 1 );
if ( pWeaponSet->m_nightvision )
m_pNightvision->SetItem( "gfx/vgui/nightvision", 1 );
if ( pWeaponSet->m_armor )
{
if ( pWeaponSet->m_helmet )
m_pArmor->SetItem( "gfx/vgui/kevlar_helmet", 1 );
else
m_pArmor->SetItem( "gfx/vgui/kevlar", 1 );
}
}
}
//--------------------------------------------------------------------------------------------------------------
void BuyPresetEditPanel::SetText( const wchar_t *text )
{
if ( !text )
text = L"";
if ( m_pTitleLabel )
{
m_pTitleLabel->SetText( text );
}
if ( m_pTitleEntry )
{
m_pTitleEntry->SetText( text );
}
InvalidateLayout();
}
//--------------------------------------------------------------------------------------------------------------
/**
* Handle command callbacks
*/
void BuyPresetEditPanel::OnCommand( const char *command )
{
if (stricmp(command, "close"))
{
PostActionSignal( new KeyValues("Command", "command", SharedVarArgs( "%s %d", command, m_fallbackIndex )) );
}
BaseClass::OnCommand(command);
}
//--------------------------------------------------------------------------------------------------------------
void BuyPresetEditPanel::ApplySchemeSettings(IScheme *pScheme)
{
BaseClass::ApplySchemeSettings(pScheme);
SetBgColor( Color( 0, 0, 0, 0 ) );
IBorder *pBorder = NULL;
int i;
for (i = 0; i < GetChildCount(); i++)
{
// perform auto-layout on the child panel
Panel *child = GetChild(i);
if (!child)
continue;
if ( !stricmp( "button", child->GetClassName() ) )
{
Button *pButton = dynamic_cast<Button *>(child);
if ( pButton )
{
pButton->SetDefaultBorder( pBorder );
pButton->SetDepressedBorder( pBorder );
pButton->SetKeyFocusBorder( pBorder );
}
}
}
pBorder = pScheme->GetBorder("BuyPresetButtonBorder");
const int NumButtons = 4;
const char * buttonNames[4] = { "editPrimary", "editSecondary", "editGrenades", "editEquipment" };
for ( i=0; i<NumButtons; ++i )
{
Panel *pPanel = FindChildByName( buttonNames[i] );
if ( pPanel )
{
pPanel->SetBorder( pBorder );
if ( !stricmp( "button", pPanel->GetClassName() ) )
{
Button *pButton = dynamic_cast<Button *>(pPanel);
if ( pButton )
{
pButton->SetDefaultBorder( pBorder );
pButton->SetDepressedBorder( pBorder );
pButton->SetKeyFocusBorder( pBorder );
Color fgColor, bgColor;
fgColor = GetSchemeColor("Label.TextDullColor", GetFgColor(), pScheme);
bgColor = Color( 0, 0, 0, 0 );
pButton->SetDefaultColor( fgColor, bgColor );
}
}
}
}
}
//--------------------------------------------------------------------------------------------------------------
/**
* Overrides EditablePanel's resizing of children to scale them proportionally to the main panel's change.
*/
void BuyPresetEditPanel::OnSizeChanged( int wide, int tall )
{
if ( !m_baseWide )
m_baseWide = 1;
if ( !m_baseTall )
m_baseTall = 1;
Panel::OnSizeChanged(wide, tall);
InvalidateLayout();
if ( wide == m_baseWide && tall == m_baseTall )
{
Repaint();
return;
}
float xScale = wide / (float) m_baseWide;
float yScale = tall / (float) m_baseTall;
for (int i = 0; i < GetChildCount(); i++)
{
// perform auto-layout on the child panel
Panel *child = GetChild(i);
if (!child)
continue;
int x, y, w, t;
child->GetBounds(x, y, w, t);
int newX = (int) x * xScale;
int newY = (int) y * yScale;
int newW = (int) (x+w) * xScale - newX;
int newT = (int) t * yScale;
// make sure the child isn't too big...
if(newX+newW>wide)
{
continue;
}
if(newY+newT>tall)
{
continue;
}
child->SetBounds(newX, newY, newW, newT);
child->InvalidateLayout();
}
Repaint();
// update the baselines
m_baseWide = wide;
m_baseTall = tall;
}
//--------------------------------------------------------------------------------------------------------------
void BuyPresetEditPanel::Reset()
{
if ( m_pTitleLabel )
{
m_pTitleLabel->SetText( "#Cstrike_BuyPresetNewChoice" );
}
if ( m_pTitleEntry )
{
m_pTitleEntry->SetText( "#Cstrike_BuyPresetNewChoice" );
}
if ( m_pCostLabel )
{
m_pCostLabel->SetText( "" );
}
BuyPresetWeapon weapon;
m_pPrimaryWeapon->SetWeapon( &weapon, true, false );
m_pSecondaryWeapon->SetWeapon( &weapon, false, false );
m_pHEGrenade->SetItem( NULL, 1 );
m_pSmokeGrenade->SetItem( NULL, 1 );
m_pFlashbangs->SetItem( NULL, 1 );
m_pDefuser->SetItem( NULL, 1 );
m_pNightvision->SetItem( NULL, 1 );
m_pArmor->SetItem( NULL, 1 );
}
//--------------------------------------------------------------------------------------------------------------
@@ -1,302 +0,0 @@
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================
#ifndef BUYPRESET_WEAPONSETLABEL_H
#define BUYPRESET_WEAPONSETLABEL_H
#ifdef _WIN32
#pragma once
#endif
#include <vgui/VGUI.h>
#include <vgui_controls/Panel.h>
#include <vgui/IImage.h>
namespace vgui
{
class TextImage;
class TextEntry;
};
//--------------------------------------------------------------------------------------------------------------
/// Helper function: draws a simple dashed line
void DrawDashedLine(int x0, int y0, int x1, int y1, int dashLen, int gapLen);
//--------------------------------------------------------------------------------------------------------------
// Purpose: Wraps an IImage to perform resizes properly
class BuyPresetImage : public vgui::IImage
{
public:
BuyPresetImage( vgui::IImage *realImage )
{
m_image = realImage;
if ( m_image )
{
m_image->GetSize( m_wide, m_tall );
}
else
{
m_wide = m_tall = 0;
}
}
// Call to Paint the image
// Image will draw within the current panel context at the specified position
virtual void Paint()
{
if ( !m_image )
return;
m_image->Paint();
}
// Set the position of the image
virtual void SetPos(int x, int y)
{
if ( !m_image )
return;
m_image->SetPos( x, y );
}
// Gets the size of the content
virtual void GetContentSize(int &wide, int &tall)
{
if ( !m_image )
return;
m_image->GetSize( wide, tall );
}
// Get the size the image will actually draw in (usually defaults to the content size)
virtual void GetSize(int &wide, int &tall)
{
if ( !m_image )
{
wide = tall = 0;
return;
}
wide = m_wide;
tall = m_tall;
}
// Sets the size of the image
virtual void SetSize(int wide, int tall)
{
m_wide = wide;
m_tall = tall;
if ( !m_image )
return;
m_image->SetSize( wide, tall );
}
// Set the draw color
virtual void SetColor(Color col)
{
if ( !m_image )
return;
m_image->SetColor( col );
}
virtual bool Evict()
{
return false;
}
virtual int GetNumFrames()
{
return 0;
}
virtual void SetFrame( int nFrame )
{
}
virtual vgui::HTexture GetID()
{
return 0;
}
virtual void SetRotation( int iRotation )
{
return;
}
private:
vgui::IImage *m_image;
int m_wide, m_tall;
};
//--------------------------------------------------------------------------------------------------------------
struct ImageInfo {
vgui::IImage *image;
int w;
int h;
int x;
int y;
int fullW;
int fullH;
void FitInBounds( int baseX, int baseY, int width, int height, bool center, int scaleAt1024, bool halfHeight = false );
void Paint();
};
//--------------------------------------------------------------------------------------------------------------
class WeaponImageInfo
{
public:
WeaponImageInfo();
~WeaponImageInfo();
void SetBounds( int left, int top, int wide, int tall );
void SetCentered( bool isCentered );
void SetScaleAt1024( int weaponScale, int ammoScale );
void SetWeapon( const BuyPresetWeapon *pWeapon, bool isPrimary, bool useCurrentAmmoType );
void ApplyTextSettings( vgui::IScheme *pScheme, bool isProportional );
void Paint();
void PaintText();
private:
void PerformLayout();
int m_left;
int m_top;
int m_wide;
int m_tall;
bool m_isPrimary;
int m_weaponScale;
int m_ammoScale;
bool m_needLayout;
bool m_isCentered;
ImageInfo m_weapon;
ImageInfo m_ammo;
vgui::TextImage *m_pAmmoText;
};
//--------------------------------------------------------------------------------------------------------------
class ItemImageInfo
{
public:
ItemImageInfo();
~ItemImageInfo();
void SetBounds( int left, int top, int wide, int tall );
void SetItem( const char *imageFname, int count );
void ApplyTextSettings( vgui::IScheme *pScheme, bool isProportional );
void Paint();
void PaintText();
private:
void PerformLayout();
int m_left;
int m_top;
int m_wide;
int m_tall;
int m_count;
bool m_needLayout;
ImageInfo m_image;
vgui::TextImage *m_pText;
};
//--------------------------------------------------------------------------------------------------------------
class WeaponLabel : public vgui::Panel
{
typedef vgui::Panel BaseClass;
public:
WeaponLabel(vgui::Panel *parent, const char *panelName);
~WeaponLabel();
void SetWeapon( const BuyPresetWeapon *pWeapon, bool isPrimary, bool showAmmo = false );
virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
virtual void PerformLayout();
virtual void Paint();
protected:
WeaponImageInfo m_weapon;
};
//--------------------------------------------------------------------------------------------------------------
class EquipmentLabel : public vgui::Panel
{
typedef vgui::Panel BaseClass;
public:
EquipmentLabel(vgui::Panel *parent, const char *panelName, const char *imageFname = NULL);
~EquipmentLabel();
void SetItem( const char *imageFname, int count );
virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
virtual void PerformLayout();
virtual void Paint();
protected:
ItemImageInfo m_item;
};
//--------------------------------------------------------------------------------------------------------------
/**
* BuyPresetEditPanel is a panel displaying a graphical representation of a buy preset.
*/
class BuyPresetEditPanel : public vgui::EditablePanel
{
typedef vgui::EditablePanel BaseClass;
public:
BuyPresetEditPanel( vgui::Panel *parent, const char *panelName, const char *resourceFilename, int fallbackIndex, bool editableName );
virtual ~BuyPresetEditPanel();
void SetWeaponSet( const WeaponSet *pWeaponSet, bool current );
virtual void SetText( const wchar_t *text );
virtual void ApplySchemeSettings(vgui::IScheme *pScheme);
void OnCommand( const char *command); ///< Handle command callbacks
virtual void OnSizeChanged( int wide, int tall );
void SetPanelBgColor( Color color ) { if (m_pBgPanel) m_pBgPanel->SetBgColor( color ); }
protected:
void Reset();
vgui::Panel *m_pBgPanel;
vgui::TextEntry *m_pTitleEntry;
vgui::Label *m_pTitleLabel;
vgui::Label *m_pCostLabel;
WeaponLabel *m_pPrimaryWeapon;
WeaponLabel *m_pSecondaryWeapon;
EquipmentLabel *m_pHEGrenade;
EquipmentLabel *m_pSmokeGrenade;
EquipmentLabel *m_pFlashbangs;
EquipmentLabel *m_pDefuser;
EquipmentLabel *m_pNightvision;
EquipmentLabel *m_pArmor;
int m_baseWide;
int m_baseTall;
int m_fallbackIndex;
};
#endif // BUYPRESET_WEAPONSETLABEL_H
File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More