I was trying different things, I had something similar to what omega had but it wasn't working for some reason...
I actually had the code like the below, however I am not sure if it is possible to access the game rules info from within the panel class. Reason for this is because depending on the game mode a different panel would open. r00t 3:16 CQC Gaming www.cqc-gaming.com ----- Original Message ----- From: "Tony "omega" Sergi" <[EMAIL PROTECTED]> To: <hlcoders@list.valvesoftware.com> Sent: Sunday, May 22, 2005 9:24 AM Subject: RE: [hlcoders] catching the OK click on the MOTD? -- ignore previous post.
K so it was way easier than I thought it was. Disregard all the other code I had posted then just do this: Add virtual void OnCommand( const char *command); to CHL2MPTextWindow. then in the cpp void CHL2MPTextWindow::OnCommand( const char *command) { if (!Q_strcmp(command, "okay")) { if ( m_szExitCommand[0] ) { engine->ClientCmd( m_szExitCommand ); } //only change between the default one and this? Show the team menu when we close! :) m_pViewPort->ShowPanel( PANEL_TEAM, true ); m_pViewPort->ShowPanel( this, false ); } BaseClass::OnCommand(command); } -----Original Message----- From: Tony "omega" Sergi [mailto:[EMAIL PROTECTED] Sent: May 22, 2005 8:58 AM To: hlcoders@list.valvesoftware.com Subject: RE: [hlcoders] catching the OK click on the MOTD? I used what I call a "server side hack" to workaround the motd problem. I call it a hack because the more I've been playin with vgui2 now, I realize there's probably better ways to do it. Anyway, here's what I did: I added a bool to Cbaseplayer, " bMOTDActive" Then added a client command under gamerules called "motd_closed" Then in the message to show the motd, I set data->SetString( "msg", "motd" ); // use this stringtable entry data->SetString( "cmd", "motd_closed" );// exec this command when panel closed pPlayer->bMOTDActive = true; //TODO omega; need to check if motd.txt exists, if it doesn't, don't bother sending teh MOTD menu then in my playerspawn function: //omega; if the motd hasn't been shown, then we need to draw the team menu if (!pPlayer->bMOTDActive) pPlayer->ShowViewPortPanel("team", true); and the client command: if ( FStrEq( cmd, "motd_closed") ) { ShowViewPortPanel("team", true); return TRUE; //omega; added to show the team menu after the MOTD is closed } That's about it. Could probably do all that on the client (let the other menus open, just hide them when the motd is open instead) but when I did this, I wasn't sure (well to tell the truth, I'm still not sure how to do it properly ;)) -----Original Message----- From: r00t 3:16 [mailto:[EMAIL PROTECTED] Sent: May 22, 2005 12:25 AM To: hlcoders@list.valvesoftware.com Subject: [hlcoders] catching the OK click on the MOTD? Sorry if this was asked before... I am not quite sure how to catch this to see if the button is clicked so I can bring up the team menu. Would I do it in the ConCommand() where the okay is specified then use something like m_pViewPort->ShowPanel( ???, true ); Or should I add this in the ClientCommand of CHL2MP_Player ? I actually tried catching the okay in the ClientCommand of CHL2MP_Player::ClientCommand() but it did not work. r00t 3:16 CQC Gaming www.cqc-gaming.com _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.15 - Release Date: 22/05/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.15 - Release Date: 22/05/2005 _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders -- No virus found in this incoming message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.15 - Release Date: 22/05/2005 -- No virus found in this outgoing message. Checked by AVG Anti-Virus. Version: 7.0.308 / Virus Database: 266.11.15 - Release Date: 22/05/2005 _______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders
_______________________________________________ To unsubscribe, edit your list preferences, or view the list archives, please visit: http://list.valvesoftware.com/mailman/listinfo/hlcoders