//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Because declare_message and hook_message seem not to work in combination
//			with showing in the baseviewport, we will use this as receiver and pass
//			the message. This is for the gameroom window.
//			This should be possible to do different?
//
// $NoKeywords: $
//=============================================================================//
#include "cbase.h"
#include "hudelement.h"
#include <vgui_controls/Panel.h>
#include "hl2wars/mp/gameroom_window.h"
#include "hud_macros.h"
#include "hl2wars/mp/hud_chatreceiver.h"

class CHudChatReceiver : public CHudElement, public vgui::EditablePanel
{
	DECLARE_CLASS_SIMPLE( CHudChatReceiver, vgui::EditablePanel );

public:
	CHudChatReceiver( const char *pElementName );

	void			Init( void );

	//void			MsgFunc_SayGR( bf_read &msg );
	void			MsgFunc_GRMapList( bf_read &msg );
	void			MsgFunc_GRMapInfo( bf_read &msg );
};

DECLARE_HUDELEMENT( CHudChatReceiver );
//DECLARE_HUD_MESSAGE( CHudChatReceiver, SayGR );
DECLARE_HUD_MESSAGE( CHudChatReceiver, GRMapList );
DECLARE_HUD_MESSAGE( CHudChatReceiver, GRMapInfo );

CHudChatReceiver::CHudChatReceiver( const char *pElementName )
: CHudElement( pElementName ), BaseClass( NULL, "HudChatReceiver" )
{
}

void CHudChatReceiver::Init( void )
{
	//HOOK_HUD_MESSAGE( CHudChatReceiver, SayGR );
	HOOK_HUD_MESSAGE( CHudChatReceiver, GRMapList );
	HOOK_HUD_MESSAGE( CHudChatReceiver, GRMapInfo );
}

/*void CHudChatReceiver::MsgFunc_SayGR( bf_read &msg )
{
	if( g_RoomWindow )
		g_RoomWindow->SayGR( msg );
}*/

void CHudChatReceiver::MsgFunc_GRMapList( bf_read &msg )
{
	if( g_RoomWindow )
		g_RoomWindow->GRMapList( msg );
}

void CHudChatReceiver::MsgFunc_GRMapInfo( bf_read &msg )
{
	if( g_RoomWindow )
		g_RoomWindow->GRMapInfo( msg );
}