Skip to content

Commit 257f3fe

Browse files
committed
add tiebreaker label
1 parent b546b56 commit 257f3fe

1 file changed

Lines changed: 13 additions & 6 deletions

File tree

src/game/client/tf/vgui/tf_match_summary.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,18 +1046,22 @@ void CTFMatchSummary::UpdateMatchTimeRemaining()
10461046
m_pMatchTimeRemainingLabel->SetVisible( false );
10471047
return;
10481048
}
1049-
m_pMatchSeriesLabel->SetVisible( true );
1050-
m_pMatchNextSeriesLabel->SetVisible( true );
1051-
m_pMatchTimeRemainingTitleLabel->SetVisible( true );
1052-
m_pMatchTimeRemainingLabel->SetVisible( true );
10531049

10541050
wchar_t wzServerTimeHrsLeft[128];
10551051
wchar_t wzServerTimeMinLeft[128];
10561052
wchar_t wzServerTimeSecLeft[128];
1057-
wchar_t wzServerTimeLeft[128];
1053+
wchar_t wzServerTimeLeft[128] = L"";
10581054

10591055
int iTimeLeft = ( TFGameRules() && TFGameRules()->GetTimeLeft() > 0 ) ? TFGameRules()->GetTimeLeft() : 0;
10601056

1057+
const bool bTieBreaker = iTimeLeft == 0 && ( TFGameRules()->GetSeriesPoints( TFGameRules()->GetGCTeamForGameTeam( TF_TEAM_RED ) ) == TFGameRules()->GetSeriesPoints( TFGameRules()->GetGCTeamForGameTeam( TF_TEAM_BLU ) ) );
1058+
1059+
m_pMatchSeriesLabel->SetVisible( true );
1060+
m_pMatchNextSeriesLabel->SetVisible( true );
1061+
m_pMatchTimeRemainingTitleLabel->SetVisible( true );
1062+
m_pMatchTimeRemainingTitleLabel->SetText( bTieBreaker ? "#Scoreboard_TimeLeftLabel_TieBreaker" : "#Scoreboard_TimeLeftLabel_Series" );
1063+
m_pMatchTimeRemainingLabel->SetVisible( !bTieBreaker );
1064+
10611065
wchar_t wszSeriesNum[16];
10621066
swprintf( wszSeriesNum, ARRAYSIZE( wszSeriesNum ), L"%d", TFGameRules()->GetSeriesCount() );
10631067

@@ -1075,7 +1079,10 @@ void CTFMatchSummary::UpdateMatchTimeRemaining()
10751079

10761080
if ( iTimeLeft == 0 )
10771081
{
1078-
g_pVGuiLocalize->ConstructString_safe( wzServerTimeLeft, g_pVGuiLocalize->Find( "#TF_HUD_ServerChangeOnSeriesEnd" ), 0 );
1082+
if ( !bTieBreaker )
1083+
{
1084+
g_pVGuiLocalize->ConstructString_safe( wzServerTimeLeft, g_pVGuiLocalize->Find( "#TF_HUD_ServerChangeOnSeriesEnd" ), 0 );
1085+
}
10791086
m_pMainStatsContainer->SetDialogVariable( "servertimeleft", wzServerTimeLeft );
10801087
}
10811088
else

0 commit comments

Comments
 (0)