Skip to content

Commit 39f6dde

Browse files
committed
Sync latest code from Team Fortress 2
- Latest code as of 2025/05/14 - Include matsys_controls code to avoid vgui_controls changes being ABI. Closes: #1249
1 parent ba5fe68 commit 39f6dde

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+11899
-38
lines changed

src/game/client/c_point_commentary_node.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -441,10 +441,10 @@ void CHudCommentary::Paint()
441441
// Draw the speaker names
442442
// Get our scheme and font information
443443
vgui::HScheme scheme = vgui::scheme()->GetScheme( "ClientScheme" );
444-
vgui::HFont hFont = vgui::scheme()->GetIScheme(scheme)->GetFont( "CommentaryDefault" );
444+
vgui::HFont hFont = vgui::scheme()->GetIScheme(scheme)->GetFont( "CommentaryDefault", true );
445445
if ( !hFont )
446446
{
447-
hFont = vgui::scheme()->GetIScheme(scheme)->GetFont( "Default" );
447+
hFont = vgui::scheme()->GetIScheme(scheme)->GetFont( "Default", true );
448448
}
449449
vgui::surface()->DrawSetTextFont( hFont );
450450
vgui::surface()->DrawSetTextColor( clr );

src/game/client/clientmode_shared.cpp

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -837,23 +837,26 @@ void ClientModeShared::StartMessageMode( int iMessageModeType )
837837
}
838838

839839
#if defined( TF_CLIENT_DLL )
840-
bool bSuspensionInMatch = GTFGCClientSystem() && GTFGCClientSystem()->BHaveChatSuspensionInCurrentMatch();
841-
if ( !cl_enable_text_chat.GetBool() || bSuspensionInMatch )
840+
if ( iMessageModeType == MM_SAY || iMessageModeType == MM_SAY_TEAM )
842841
{
843-
CBaseHudChat *pHUDChat = ( CBaseHudChat * ) GET_HUDELEMENT( CHudChat );
844-
if ( pHUDChat )
842+
bool bSuspensionInMatch = GTFGCClientSystem() && GTFGCClientSystem()->BHaveChatSuspensionInCurrentMatch();
843+
if ( !cl_enable_text_chat.GetBool() || bSuspensionInMatch )
845844
{
846-
const char *pszReason = "#TF_Chat_Disabled";
847-
if ( bSuspensionInMatch )
845+
CBaseHudChat *pHUDChat = ( CBaseHudChat * ) GET_HUDELEMENT( CHudChat );
846+
if ( pHUDChat )
848847
{
849-
pszReason = "#TF_Chat_Unavailable";
850-
}
848+
const char *pszReason = "#TF_Chat_Disabled";
849+
if ( bSuspensionInMatch )
850+
{
851+
pszReason = "#TF_Chat_Unavailable";
852+
}
851853

852-
char szLocalized[100];
853-
g_pVGuiLocalize->ConvertUnicodeToANSI( g_pVGuiLocalize->Find( pszReason ), szLocalized, sizeof( szLocalized ) );
854-
pHUDChat->ChatPrintf( 0, CHAT_FILTER_NONE, "%s ", szLocalized );
854+
char szLocalized[100];
855+
g_pVGuiLocalize->ConvertUnicodeToANSI( g_pVGuiLocalize->Find( pszReason ), szLocalized, sizeof( szLocalized ) );
856+
pHUDChat->ChatPrintf( 0, CHAT_FILTER_NONE, "%s ", szLocalized );
857+
}
858+
return;
855859
}
856-
return;
857860
}
858861
#endif // TF_CLIENT_DLL
859862

src/game/client/hud_closecaption.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1596,7 +1596,7 @@ void CHudCloseCaption::CreateFonts( void )
15961596
{
15971597
vgui::IScheme *pScheme = vgui::scheme()->GetIScheme( GetScheme() );
15981598

1599-
m_hFonts[CCFONT_NORMAL] = pScheme->GetFont( "CloseCaption_Normal", true );
1599+
m_hFonts[CCFONT_NORMAL] = pScheme->GetFont( "CloseCaption", true );
16001600

16011601
if ( IsPC() )
16021602
{

src/game/client/tf/tf_hud_mann_vs_machine_status.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -851,7 +851,14 @@ void CWaveStatusPanel::UpdateEnemyCounts( void )
851851

852852
if ( pPanel->m_pEnemyCountImageBG )
853853
{
854-
pPanel->m_pEnemyCountImageBG->SetBgColor( m_clrNormal );
854+
if ( support[i].iFlags & MVM_CLASS_FLAG_MINIBOSS )
855+
{
856+
pPanel->m_pEnemyCountImageBG->SetBgColor( m_clrMiniBoss );
857+
}
858+
else
859+
{
860+
pPanel->m_pEnemyCountImageBG->SetBgColor( m_clrNormal );
861+
}
855862
}
856863

857864
if ( pPanel->m_pEnemyCountCritBG )

src/game/client/tf/tf_hud_scope.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,4 +525,4 @@ void CHudScope::Paint( void )
525525
if( bDisableClipping )
526526
g_pMatSystemSurface->DisableClipping( false );
527527

528-
}
528+
}

src/game/client/voice_menu.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@
1717

1818
static int g_ActiveVoiceMenu = 0;
1919

20+
#if defined( TF_CLIENT_DLL )
21+
extern ConVar tf_voice_command_suspension_mode;
22+
#endif
23+
2024
void OpenVoiceMenu( int index )
2125
{
2226
// do not show the menu if the player is dead or is an observer
@@ -28,7 +32,7 @@ void OpenVoiceMenu( int index )
2832
return;
2933

3034
#if defined ( TF_CLIENT_DLL )
31-
if ( GTFGCClientSystem() && GTFGCClientSystem()->BHaveChatSuspensionInCurrentMatch() )
35+
if ( GTFGCClientSystem() && GTFGCClientSystem()->BHaveChatSuspensionInCurrentMatch() && tf_voice_command_suspension_mode.GetInt() == 1 )
3236
{
3337
CBaseHudChat *pHUDChat = ( CBaseHudChat * ) GET_HUDELEMENT( CHudChat );
3438
if ( pHUDChat )

src/game/server/tf/bot/tf_bot.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -704,9 +704,9 @@ DEFINE_SCRIPTFUNC( IsOnAnyMission, "Return true if this bot has a current missio
704704
DEFINE_SCRIPTFUNC_WRAPPED( SetMissionTarget, "Set this bot's mission target to the given entity" )
705705
DEFINE_SCRIPTFUNC_WRAPPED( GetMissionTarget, "Get this bot's current mission target" )
706706

707-
DEFINE_SCRIPTFUNC( SetBehaviorFlag, "Set the given behavior flag(s) for this bot" )
708-
DEFINE_SCRIPTFUNC( ClearBehaviorFlag, "Clear the given behavior flag(s) for this bot" )
709-
DEFINE_SCRIPTFUNC( IsBehaviorFlagSet, "Return true if the given behavior flag(s) are set for this bot" )
707+
DEFINE_SCRIPTFUNC_WRAPPED( SetBehaviorFlag, "Set the given behavior flag(s) for this bot" )
708+
DEFINE_SCRIPTFUNC_WRAPPED( ClearBehaviorFlag, "Clear the given behavior flag(s) for this bot" )
709+
DEFINE_SCRIPTFUNC_WRAPPED( IsBehaviorFlagSet, "Return true if the given behavior flag(s) are set for this bot" )
710710

711711
DEFINE_SCRIPTFUNC_WRAPPED( SetActionPoint, "Set the given action point for this bot" )
712712
DEFINE_SCRIPTFUNC_WRAPPED( GetActionPoint, "Get the given action point for this bot" )

src/game/server/tf/bot/tf_bot.h

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,9 @@ class CTFBot: public NextBotPlayer< CTFPlayer >, public CGameEventListener
331331
void SetBehaviorFlag( unsigned int flags );
332332
void ClearBehaviorFlag( unsigned int flags );
333333
bool IsBehaviorFlagSet( unsigned int flags ) const;
334+
void ScriptSetBehaviorFlag( int flags ) { this->SetBehaviorFlag( (unsigned int)flags ); }
335+
void ScriptClearBehaviorFlag( int flags ) { this->ClearBehaviorFlag( (unsigned int)flags ); }
336+
bool ScriptIsBehaviorFlagSet( int flags ) const { return this->IsBehaviorFlagSet( (unsigned int)flags ); }
334337

335338
bool FindSplashTarget( CBaseEntity *target, float maxSplashRadius, Vector *splashTarget ) const;
336339

@@ -358,11 +361,11 @@ class CTFBot: public NextBotPlayer< CTFPlayer >, public CGameEventListener
358361
CBaseEntity *GetMissionTarget( void ) const;
359362
void SetMissionString( CUtlString string );
360363
CUtlString *GetMissionString( void );
361-
void ScriptSetMission( unsigned int mission, bool resetBehaviorSystem = true ) { this->SetMission( (MissionType)mission, resetBehaviorSystem ); }
362-
void ScriptSetPrevMission( unsigned int mission ) { this->SetPrevMission( (MissionType)mission ); }
363-
unsigned int ScriptGetMission( void ) const { return (unsigned int)this->GetMission(); }
364-
unsigned int ScriptGetPrevMission( void ) const { return (unsigned int)this->GetPrevMission(); }
365-
bool ScriptHasMission( unsigned int mission ) const { return this->HasMission( (MissionType)mission ); }
364+
void ScriptSetMission( int mission, bool resetBehaviorSystem = true ) { this->SetMission( (MissionType)mission, resetBehaviorSystem ); }
365+
void ScriptSetPrevMission( int mission ) { this->SetPrevMission( (MissionType)mission ); }
366+
int ScriptGetMission( void ) const { return (int)this->GetMission(); }
367+
int ScriptGetPrevMission( void ) const { return (int)this->GetPrevMission(); }
368+
bool ScriptHasMission( int mission ) const { return this->HasMission( (MissionType)mission ); }
366369
void ScriptSetMissionTarget( HSCRIPT hTarget ) { this->SetMissionTarget( ToEnt( hTarget ) ); }
367370
HSCRIPT ScriptGetMissionTarget( void ) const { return ToHScript( this->GetMissionTarget() ); }
368371

src/game/server/tf/entity_currencypack.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,15 +210,17 @@ void CCurrencyPack::ComeToRest( void )
210210
}
211211
}
212212
}
213+
213214
// Or a func_respawnroom (robots can drop money in their own spawn)
214215
for ( int i = 0; i < IFuncRespawnRoomAutoList::AutoList().Count(); i++ )
215216
{
216-
CFuncRespawnRoom *pRespawnRoom = static_cast<CFuncRespawnRoom*>( IFuncRespawnRoomAutoList::AutoList()[i] );
217+
CFuncRespawnRoom *pRespawnRoom = static_cast<CFuncRespawnRoom *>( IFuncRespawnRoomAutoList::AutoList()[ i ] );
217218
Vector vecMins, vecMaxs;
218219
pRespawnRoom->GetCollideable()->WorldSpaceSurroundingBounds( &vecMins, &vecMaxs );
219220
if ( IsPointInBox( GetCollideable()->GetCollisionOrigin(), vecMins, vecMaxs ) )
220221
{
221222
TFGameRules()->DistributeCurrencyAmount( m_nAmount );
223+
222224
m_bTouched = true;
223225
UTIL_Remove( this );
224226
}

src/game/server/tf/tf_player.cpp

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,7 @@ extern ConVar sv_vote_allow_spectators;
277277
ConVar sv_vote_late_join_time( "sv_vote_late_join_time", "90", FCVAR_NONE, "Grace period after the match starts before players who join the match receive a vote-creation cooldown" );
278278
ConVar sv_vote_late_join_cooldown( "sv_vote_late_join_cooldown", "300", FCVAR_NONE, "Length of the vote-creation cooldown when joining the server after the grace period has expired" );
279279

280+
extern ConVar tf_voice_command_suspension_mode;
280281
extern ConVar tf_feign_death_duration;
281282
extern ConVar spec_freeze_time;
282283
extern ConVar spec_freeze_traveltime;
@@ -19993,7 +19994,20 @@ bool CTFPlayer::ShouldShowVoiceSubtitleToEnemy( void )
1999319994
//-----------------------------------------------------------------------------
1999419995
bool CTFPlayer::CanSpeakVoiceCommand( void )
1999519996
{
19996-
return ( gpGlobals->curtime > m_flNextVoiceCommandTime );
19997+
if ( tf_voice_command_suspension_mode.GetInt() == 1 )
19998+
return false;
19999+
20000+
if ( gpGlobals->curtime <= m_flNextVoiceCommandTime )
20001+
return false;
20002+
20003+
// misyl: New F2P voice command rate-limiting path.
20004+
if ( BHaveChatSuspensionInCurrentMatch() && tf_voice_command_suspension_mode.GetInt() == 2 )
20005+
{
20006+
if ( !m_RateLimitedVoiceCommandTokenBucket.BTakeToken( gpGlobals->curtime ) )
20007+
return false;
20008+
}
20009+
20010+
return true;
1999720011
}
1999820012

1999920013
//-----------------------------------------------------------------------------

0 commit comments

Comments
 (0)