@ -292,7 +292,7 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
assert ( ( uint ) this - > dtype < lengthof ( chat_captions ) ) ;
this - > dest_string = chat_captions [ this - > dtype ] ;
this - > InitNested ( desc );
this - > InitNested ( desc , type );
this - > SetFocusedWidget ( NWCW_TEXTBOX ) ;
InvalidateWindowData ( WC_NEWS_WINDOW , 0 , this - > height ) ;
@ -505,6 +505,11 @@ struct NetworkChatWindow : public QueryStringBaseWindow {
{
ShowOnScreenKeyboard ( this , wid , NWCW_CLOSE , NWCW_SENDBUTTON ) ;
}
virtual void OnInvalidateData ( int data )
{
if ( data = = this - > dest ) delete this ;
}
} ;
static const NWidgetPart _nested_chat_window_widgets [ ] = {
@ -530,7 +535,7 @@ static const WindowDesc _chat_window_desc(
void ShowNetworkChatQueryWindow ( DestType type , int dest )
{
DeleteWindowBy Id( WC_SEND_NETWORK_MSG , 0 ) ;
DeleteWindowBy Class( WC_SEND_NETWORK_MSG ) ;
new NetworkChatWindow ( & _chat_window_desc , type , dest ) ;
}