Skip to content

Commit 0f7c17b

Browse files
committed
fix: tips being changed multiple times during map load
when stats are loaded, tips get updated, cycling to another tip this causes an unwanted tip cycle where the first tip could be shown for a very short time while the player is reading it and moving to a new random one seemingly arbitrarily this keeps the same tip on the loading screen, as intended
1 parent 614ba04 commit 0f7c17b

File tree

2 files changed

+8
-5
lines changed

2 files changed

+8
-5
lines changed

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

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -483,7 +483,7 @@ void CTFStatsSummaryPanel::SetStats( CUtlVector<ClassStats_t> &vecClassStats )
483483
m_aClassStats = vecClassStats;
484484
if ( m_bControlsLoaded )
485485
{
486-
UpdateDialog();
486+
UpdateDialog(false);
487487
}
488488
}
489489

@@ -846,7 +846,7 @@ void CTFStatsSummaryPanel::UpdateLeaderboard()
846846
//-----------------------------------------------------------------------------
847847
// Purpose: Updates the dialog
848848
//-----------------------------------------------------------------------------
849-
void CTFStatsSummaryPanel::UpdateDialog()
849+
void CTFStatsSummaryPanel::UpdateDialog(bool bUpdateTip)
850850
{
851851
UpdateMainBackground();
852852

@@ -921,8 +921,11 @@ void CTFStatsSummaryPanel::UpdateDialog()
921921
UpdateBarCharts();
922922
// fill out class details
923923
UpdateClassDetails();
924-
// update the tip
925-
UpdateTip();
924+
if (bUpdateTip)
925+
{
926+
// update the tip
927+
UpdateTip();
928+
}
926929
// show or hide controls depending on if we're interactive or not
927930
UpdateControls();
928931
}

src/game/client/tf/vgui/tf_statsummary.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ class CTFStatsSummaryPanel : public vgui::EditablePanel, public CGameEventListen
6464

6565
void Reset();
6666
void SetDefaultSelections();
67-
void UpdateDialog();
67+
void UpdateDialog(bool bUpdateTip = true);
6868
void UpdateBarCharts();
6969
void UpdateClassDetails( bool bIsMVM = false );
7070
void UpdateTip();

0 commit comments

Comments
 (0)