mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 12:06:07 +08:00
SDK sync.
This commit is contained in:
@ -181,6 +181,7 @@ FoundGameListItem::FoundGameListItem( vgui::Panel *parent, const char *panelName
|
||||
m_pLblPing = NULL;
|
||||
m_pLblPlayerGamerTag = NULL;
|
||||
m_pLblDifficulty = NULL;
|
||||
m_pLblSwarmState = NULL;
|
||||
m_pLblPlayers = NULL;
|
||||
m_pLblNotJoinable = NULL;
|
||||
|
||||
@ -325,6 +326,7 @@ void FoundGameListItem::SetGameIndex( const Info& fi )
|
||||
|
||||
SetGamePlayerCount( 0, 0 );
|
||||
SetGameDifficulty( "" );
|
||||
SetSwarmState( "" );
|
||||
}
|
||||
else if ( char const *szOtherTitle = fi.IsOtherTitle() )
|
||||
{
|
||||
@ -340,6 +342,7 @@ void FoundGameListItem::SetGameIndex( const Info& fi )
|
||||
|
||||
SetGamePlayerCount( 0, 0 );
|
||||
SetGameDifficulty( "" );
|
||||
SetSwarmState( "" );
|
||||
}
|
||||
else if ( fi.IsJoinable() || fi.IsDownloadable() )
|
||||
{
|
||||
@ -367,6 +370,18 @@ void FoundGameListItem::SetGameIndex( const Info& fi )
|
||||
Q_snprintf( chDiffBuffer, sizeof( chDiffBuffer ), "#L4D360UI_Difficulty_%s_%s", szDiff, szMode );
|
||||
SetGameDifficulty( chDiffBuffer );
|
||||
}
|
||||
|
||||
char const *szDiff = fi.mpGameDetails->GetString( "game/swarmstate", "ingame" );
|
||||
Msg( "Adding a server to the list:\n" );
|
||||
KeyValuesDumpAsDevMsg( fi.mpGameDetails );
|
||||
if ( !Q_stricmp( szDiff, "ingame" ) )
|
||||
{
|
||||
SetSwarmState( "#L4D360UI_ingame" );
|
||||
}
|
||||
else
|
||||
{
|
||||
SetSwarmState( "#L4D360UI_briefing" );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -438,6 +453,15 @@ void FoundGameListItem::SetGameDifficulty( const char *difficultyName )
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
void FoundGameListItem::SetSwarmState( const char *szSwarmStateText )
|
||||
{
|
||||
if( m_pLblSwarmState )
|
||||
{
|
||||
m_pLblSwarmState->SetText( szSwarmStateText ? szSwarmStateText : "" );
|
||||
}
|
||||
}
|
||||
|
||||
//=============================================================================
|
||||
void FoundGameListItem::SetGamePlayerCount( int current, int max )
|
||||
{
|
||||
@ -618,6 +642,7 @@ void FoundGameListItem::PaintBackground()
|
||||
{
|
||||
DrawListItemLabel( m_pLblDifficulty, true );
|
||||
DrawListItemLabel( m_pLblPlayers, true );
|
||||
DrawListItemLabel( m_pLblSwarmState, true );
|
||||
}
|
||||
else
|
||||
{
|
||||
@ -835,6 +860,11 @@ void FoundGameListItem::ApplySchemeSettings( IScheme *pScheme )
|
||||
{
|
||||
m_pLblDifficulty->SetVisible( false );
|
||||
}
|
||||
m_pLblSwarmState = dynamic_cast< vgui::Label * > ( FindChildByName( "LblSwarmState" ) );
|
||||
if ( m_pLblSwarmState )
|
||||
{
|
||||
m_pLblSwarmState->SetVisible( false );
|
||||
}
|
||||
m_pLblPlayers = dynamic_cast< vgui::Label * > ( FindChildByName( "LblNumPlayers" ) );
|
||||
if ( m_pLblPlayers )
|
||||
{
|
||||
@ -847,8 +877,8 @@ void FoundGameListItem::ApplySchemeSettings( IScheme *pScheme )
|
||||
m_pLblNotJoinable->SetVisible( false );
|
||||
}
|
||||
|
||||
m_hTextFont = pScheme->GetFont( "DefaultBold", true );
|
||||
m_hTextBlurFont = pScheme->GetFont( "DefaultBoldBlur", true );
|
||||
m_hTextFont = pScheme->GetFont( "Default", true );
|
||||
m_hTextBlurFont = pScheme->GetFont( "DefaultBlur", true );
|
||||
|
||||
m_hSmallTextFont = pScheme->GetFont( "DefaultMedium", true );
|
||||
m_hSmallTextBlurFont = pScheme->GetFont( "DefaultMediumBlur", true );
|
||||
|
@ -84,6 +84,7 @@ public:
|
||||
|
||||
void SetGamePing( Info::GAME_PING ping );
|
||||
void SetGameDifficulty( const char* difficultyName );
|
||||
void SetSwarmState( const char* szSwarmStateText );
|
||||
void SetGamePlayerCount( int current, int max );
|
||||
|
||||
void DrawListItemLabel( vgui::Label* label, bool bSmallFont, bool bEastAligned = false );
|
||||
@ -133,6 +134,7 @@ private:
|
||||
vgui::Label *m_pLblPing;
|
||||
vgui::Label *m_pLblPlayerGamerTag;
|
||||
vgui::Label *m_pLblDifficulty;
|
||||
vgui::Label *m_pLblSwarmState;
|
||||
vgui::Label *m_pLblPlayers;
|
||||
vgui::Label *m_pLblNotJoinable;
|
||||
|
||||
|
@ -364,6 +364,14 @@ static int __cdecl FoundPublicGamesSortFunc( vgui::Panel* const *a, vgui::Panel*
|
||||
return ( builtInA ? -1 : 1 );
|
||||
}
|
||||
|
||||
// now by swarm state
|
||||
const char *stateA = ia.mpGameDetails->GetString( "game/swarmstate", "" );
|
||||
const char *stateB = ib.mpGameDetails->GetString( "game/swarmstate", "" );
|
||||
if ( int iResult = Q_stricmp( stateA, stateB ) )
|
||||
{
|
||||
return iResult;
|
||||
}
|
||||
|
||||
// now by campaign
|
||||
const char *campaignNameA = ia.mpGameDetails->GetString( "game/missioninfo/displaytitle", "" );
|
||||
const char *campaignNameB = ib.mpGameDetails->GetString( "game/missioninfo/displaytitle", "" );
|
||||
|
@ -30,14 +30,14 @@ extern ISoundEmitterSystemBase *soundemitterbase;
|
||||
ConVar asw_debug_marine_chatter("asw_debug_marine_chatter", "0", 0, "Show debug info about when marine chatter is triggered");
|
||||
|
||||
#define ACTOR_SARGE (1 << 0)
|
||||
#define ACTOR_JAEGER (1 << 1)
|
||||
#define ACTOR_WILDCAT (1 << 2)
|
||||
#define ACTOR_WOLFE (1 << 3)
|
||||
#define ACTOR_FAITH (1 << 4)
|
||||
#define ACTOR_BASTILLE (1 << 5)
|
||||
#define ACTOR_CRASH (1 << 6)
|
||||
#define ACTOR_FLYNN (1 << 7)
|
||||
#define ACTOR_VEGAS (1 << 8)
|
||||
#define ACTOR_WILDCAT (1 << 1)
|
||||
#define ACTOR_FAITH (1 << 2)
|
||||
#define ACTOR_CRASH (1 << 3)
|
||||
#define ACTOR_JAEGER (1 << 4)
|
||||
#define ACTOR_WOLFE (1 << 5)
|
||||
#define ACTOR_BASTILLE (1 << 6)
|
||||
#define ACTOR_VEGAS (1 << 7)
|
||||
#define ACTOR_FLYNN (1 << 8)
|
||||
#define ACTOR_ALL (ACTOR_SARGE | ACTOR_JAEGER | ACTOR_WILDCAT | ACTOR_WOLFE | ACTOR_FAITH | ACTOR_BASTILLE | ACTOR_CRASH | ACTOR_FLYNN)
|
||||
|
||||
int CASW_MarineSpeech::s_CurrentConversation = CONV_NONE;
|
||||
|
@ -134,6 +134,7 @@ extern ConVar old_radius_damage;
|
||||
ConVar asw_adjust_difficulty_by_number_of_marines( "asw_adjust_difficulty_by_number_of_marines", "1", FCVAR_CHEAT, "If enabled, difficulty will be reduced when there are only 3 or 2 marines." );
|
||||
ConVar sv_vote_kick_ban_duration("sv_vote_kick_ban_duration", "5", 0, "How long should a kick vote ban someone from the server? (in minutes)");
|
||||
ConVar sv_timeout_when_fully_connected( "sv_timeout_when_fully_connected", "30", FCVAR_NONE, "Once fully connected, player will be kicked if he doesn't send a network message within this interval." );
|
||||
ConVar mm_swarm_state( "mm_swarm_state", "ingame", FCVAR_DEVELOPMENTONLY );
|
||||
#else
|
||||
extern ConVar asw_controls;
|
||||
#endif
|
||||
@ -327,6 +328,15 @@ LINK_ENTITY_TO_CLASS( asw_gamerules, CAlienSwarmProxy );
|
||||
IMPLEMENT_NETWORKCLASS_ALIASED( AlienSwarmProxy, DT_AlienSwarmProxy )
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
void CAlienSwarmProxy::OnDataChanged( DataUpdateType_t updateType )
|
||||
{
|
||||
BaseClass::OnDataChanged( updateType );
|
||||
if ( ASWGameRules() )
|
||||
{
|
||||
ASWGameRules()->OnDataChanged( updateType );
|
||||
}
|
||||
}
|
||||
|
||||
void RecvProxy_ASWGameRules( const RecvProp *pProp, void **pOut, void *pData, int objectID )
|
||||
{
|
||||
CAlienSwarm *pRules = ASWGameRules();
|
||||
@ -496,6 +506,7 @@ CAlienSwarm::CAlienSwarm()
|
||||
m_nMarineDeathCamStep = 0;
|
||||
m_hMarineDeathRagdoll = NULL;
|
||||
m_fDeathCamYawAngleOffset = 0.0f;
|
||||
m_iPreviousGameState = 200;
|
||||
|
||||
engine->SetPitchScale( 1.0f );
|
||||
|
||||
@ -576,6 +587,21 @@ float CAlienSwarm::GetMarineDeathCamInterp( void )
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
void CAlienSwarm::OnDataChanged( DataUpdateType_t updateType )
|
||||
{
|
||||
if ( m_iPreviousGameState != GetGameState() )
|
||||
{
|
||||
m_iPreviousGameState = GetGameState();
|
||||
|
||||
IGameEvent * event = gameeventmanager->CreateEvent( "swarm_state_changed" );
|
||||
if ( event )
|
||||
{
|
||||
event->SetInt( "state", m_iPreviousGameState );
|
||||
gameeventmanager->FireEventClientSide( event );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
extern ConVar asw_springcol;
|
||||
@ -935,6 +961,7 @@ void CAlienSwarm::AllowBriefing()
|
||||
{
|
||||
DevMsg( "Cheat allowing return to briefing\n" );
|
||||
SetGameState( ASW_GS_BRIEFING );
|
||||
mm_swarm_state.SetValue( "briefing" );
|
||||
}
|
||||
|
||||
|
||||
@ -1571,6 +1598,7 @@ void CAlienSwarm::StartMission()
|
||||
Msg("==STARTMISSION==\n");
|
||||
|
||||
SetGameState(ASW_GS_LAUNCHING);
|
||||
mm_swarm_state.SetValue( "ingame" );
|
||||
m_fNextLaunchingStep = gpGlobals->curtime + ASW_LAUNCHING_STEP;
|
||||
|
||||
// reset fail advice
|
||||
@ -1680,6 +1708,7 @@ void CAlienSwarm::UpdateLaunching()
|
||||
}
|
||||
|
||||
SetGameState(ASW_GS_INGAME);
|
||||
mm_swarm_state.SetValue( "ingame" );
|
||||
DevMsg( "Setting game state to ingame\n" );
|
||||
|
||||
// Alert gamestats of spawning
|
||||
@ -6508,6 +6537,7 @@ void CAlienSwarm::LevelInitPostEntity()
|
||||
}
|
||||
|
||||
SetGameState(ASW_GS_BRIEFING);
|
||||
mm_swarm_state.SetValue( "briefing" );
|
||||
SetMaxMarines();
|
||||
SetInitialGameMode();
|
||||
|
||||
|
@ -51,6 +51,10 @@ public:
|
||||
DECLARE_DATADESC();
|
||||
|
||||
int m_iSpeedrunTime;
|
||||
|
||||
#ifdef CLIENT_DLL
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
#endif
|
||||
};
|
||||
|
||||
class CASW_Player;
|
||||
@ -399,6 +403,11 @@ public:
|
||||
virtual int GetGameState() { return m_iGameState; }
|
||||
virtual void SetGameState(int iNewState) { m_iGameState = iNewState; }
|
||||
CNetworkVar(unsigned char, m_iGameState);
|
||||
#ifdef CLIENT_DLL
|
||||
|
||||
virtual void OnDataChanged( DataUpdateType_t updateType );
|
||||
unsigned char m_iPreviousGameState;
|
||||
#endif
|
||||
|
||||
// misc
|
||||
virtual void CreateStandardEntities( void );
|
||||
|
@ -195,8 +195,24 @@ void CASW_Weapon::ItemBusyFrame( void )
|
||||
}
|
||||
}
|
||||
#endif
|
||||
CSoundParameters params;
|
||||
if ( !GetParametersForSound( "FastReload.Success", params, NULL ) )
|
||||
return;
|
||||
|
||||
EmitSound( "FastReload.Success" );
|
||||
EmitSound_t playparams(params);
|
||||
playparams.m_nPitch = params.pitch;
|
||||
|
||||
CASW_Player *pPlayer = GetCommander();
|
||||
if ( pPlayer )
|
||||
{
|
||||
CSingleUserRecipientFilter filter( pMarine->GetCommander() );
|
||||
if ( IsPredicted() && CBaseEntity::GetPredictionPlayer() )
|
||||
{
|
||||
filter.UsePredictionRules();
|
||||
}
|
||||
EmitSound(filter, entindex(), playparams);
|
||||
}
|
||||
|
||||
//Msg("%f RELOAD SUCCESS! - bAttack1 = %d, bOldAttack1 = %d\n", gpGlobals->curtime, bAttack1, bOldAttack1 );
|
||||
//Msg( "S: %f - %f - %f RELOAD SUCCESS! -- Progress = %f\n", gpGlobals->curtime, fFastStart, fFastEnd, flProgress );
|
||||
#ifdef GAME_DLL
|
||||
@ -207,7 +223,23 @@ void CASW_Weapon::ItemBusyFrame( void )
|
||||
}
|
||||
else if (m_fFastReloadStart != 0)
|
||||
{
|
||||
EmitSound( "FastReload.Miss" );
|
||||
CSoundParameters params;
|
||||
if ( !GetParametersForSound( "FastReload.Miss", params, NULL ) )
|
||||
return;
|
||||
|
||||
EmitSound_t playparams(params);
|
||||
playparams.m_nPitch = params.pitch;
|
||||
|
||||
CASW_Player *pPlayer = GetCommander();
|
||||
if ( pPlayer )
|
||||
{
|
||||
CSingleUserRecipientFilter filter( pMarine->GetCommander() );
|
||||
if ( IsPredicted() && CBaseEntity::GetPredictionPlayer() )
|
||||
{
|
||||
filter.UsePredictionRules();
|
||||
}
|
||||
EmitSound(filter, entindex(), playparams);
|
||||
}
|
||||
//Msg("%f RELOAD MISSED! - bAttack1 = %d, bOldAttack1 = %d\n", gpGlobals->curtime, bAttack1, bOldAttack1 );
|
||||
//Msg( "S: %f - %f - %f RELOAD MISSED! -- Progress = %f\n", gpGlobals->curtime, fFastStart, fFastEnd, flProgress );
|
||||
m_fFastReloadEnd = 0;
|
||||
|
Binary file not shown.
@ -18,6 +18,7 @@
|
||||
#include "filesystem.h"
|
||||
#include "tier1/utlintrusivelist.h"
|
||||
#include "tier1/utlvector.h"
|
||||
#include "tier1/utlmap.h"
|
||||
|
||||
class CPackedStore;
|
||||
|
||||
@ -127,14 +128,14 @@ public:
|
||||
|
||||
// Get a list of all the files in the zip You are responsible for freeing the contents of
|
||||
// outFilenames (call outFilenames.PurgeAndDeleteElements).
|
||||
int GetFileList( CUtlStringList &outFilenames, bool bFormattedOutput = false );
|
||||
int GetFileList( CUtlStringList &outFilenames, bool bFormattedOutput, bool bSortedOutput );
|
||||
|
||||
// Get a list of all files that match the given wildcard string
|
||||
int GetFileList( const char *pWildCard, CUtlStringList &outFilenames, bool bFormattedOutput = false );
|
||||
int GetFileList( const char *pWildCard, CUtlStringList &outFilenames, bool bFormattedOutput, bool bSortedOutput );
|
||||
|
||||
// Get a list of all directories of the given wildcard
|
||||
int GetDirList( const char *pWildCard, CUtlStringList &outDirnames );
|
||||
int GetDirList( CUtlStringList &outDirnames );
|
||||
int GetFileAndDirLists( const char *pWildCard, CUtlStringList &outDirnames, CUtlStringList &outFilenames, bool bSortedOutput );
|
||||
int GetFileAndDirLists( CUtlStringList &outDirnames, CUtlStringList &outFilenames, bool bSortedOutput );
|
||||
|
||||
bool IsEmpty( void ) const;
|
||||
|
||||
@ -186,7 +187,10 @@ private:
|
||||
FileHandle_t GetWriteHandle( int nChunkIdx );
|
||||
void CloseWriteHandle( void );
|
||||
|
||||
|
||||
// For cache-ing directory and contents data
|
||||
CUtlStringList m_directoryList; // The index of this list of directories...
|
||||
CUtlMap<int, CUtlStringList*> m_dirContents; // ...is the key to this map of filenames
|
||||
void BuildFindFirstCache();
|
||||
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user