Skip to content

Commit 2b4e733

Browse files
committed
fix HTML motd overwriting the main menu
1 parent 26df336 commit 2b4e733

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

src/game/client/game_controls/vguitextwindow.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,8 @@ CTextWindow::CTextWindow(IViewPort *pViewPort) : Frame(NULL, PANEL_INFO )
102102
SetTitleBarVisible( false );
103103

104104
m_pTextMessage = new TextEntry( this, "TextMessage" );
105-
m_pHTMLMessage = new CMOTDHTML( this,"HTMLMessage" );
105+
//m_pHTMLMessage = new CMOTDHTML( this,"HTMLMessage" );
106+
m_pHTMLMessage = NULL;
106107
m_pTitleLabel = new Label( this, "MessageTitle", "Message Title" );
107108
m_pOK = new Button(this, "ok", "#PropertyDialog_OK");
108109

@@ -168,7 +169,7 @@ void CTextWindow::ShowURL( const char *URL, bool bAllowUserToDisable )
168169
#endif
169170

170171
ClientModeShared *mode = ( ClientModeShared * )GetClientModeNormal();
171-
if ( ( bAllowUserToDisable && cl_disablehtmlmotd.GetBool() ) || !mode->IsHTMLInfoPanelAllowed() )
172+
if ( ( bAllowUserToDisable && cl_disablehtmlmotd.GetBool() ) || !mode->IsHTMLInfoPanelAllowed() || !m_pHTMLMessage )
172173
{
173174
Warning( "Blocking HTML info panel '%s'; Using plaintext instead.\n", URL );
174175

@@ -182,7 +183,10 @@ void CTextWindow::ShowURL( const char *URL, bool bAllowUserToDisable )
182183
const char *data = (const char *)g_pStringTableInfoPanel->GetStringUserData( index, &length );
183184
if ( data && data[0] )
184185
{
185-
m_pHTMLMessage->SetVisible( false );
186+
if ( m_pHTMLMessage )
187+
{
188+
m_pHTMLMessage->SetVisible( false );
189+
}
186190
ShowText( data );
187191
}
188192
}

0 commit comments

Comments
 (0)