#ifndef HUD_RTS_INFOPANEL_H
#define HUD_RTS_INFOPANEL_H

#include "hudelement.h"
#include <vgui_controls/Panel.h>
#include "hl2wars/rts_shareddefs.h"
#include "hl2wars/vgui_bitmapbuttonrts.h"
#include "iclientmode.h"
#include <vgui_controls/TextEntry.h>

enum INFOTYPE 
{
	INFOTYPE_NONE = 0,
	INFOTYPE_BUILDING,
	INFOTYPE_ABILITY,
};

#define MAX_INFOSTRING 80

namespace vgui
{

class Description : public TextEntry
{
	DECLARE_CLASS_SIMPLE( Description, TextEntry );
public:
	Description(Panel *parent, const char *panelName);

	virtual void ApplySchemeSettings(IScheme *pScheme);
};

}

class CHudRTSInfoPanel : public CHudElement, public vgui::Panel
{
	DECLARE_CLASS_SIMPLE( CHudRTSInfoPanel, vgui::Panel);

	// description data
	typedef struct description_data {
		char m_sTitle[MAX_INFOSTRING];
		char m_sCost[MAX_INFOSTRING];
		char m_sTime[MAX_INFOSTRING];
		char m_sDescription[MAX_INFOSTRING];
	};

public:
	CHudRTSInfoPanel( const char *pElementName );
	~CHudRTSInfoPanel();
	virtual void Init( void );
	void			LevelInit( const char *newmap );
	void			LevelShutdown( void );

	virtual void PaintBackground();
	void Paint( void );	
	virtual void ApplySchemeSettings(vgui::IScheme *pScheme);

	//void OnThink(void);	
	virtual void	OnTick( void );

	//void LoadDescriptionData(void);
	//void SetHoverButton( CBitmapButtonRTS *pButton );
	void SetTimeOut( float time );
	void SetType( int unit_index );
	void SetInfoType( int info_type );

	description_data GetInfoBuilding( );
	description_data GetInfoAbility( );

private:
	float m_fTimeOut;
	int m_iWidth, m_iTall;
	Color					 m_bgColor;
	Color					 m_borderColor;
	// info type data
	int m_iType;
	int m_iInfoType;

	CUtlMap < int, description_data> m_utlDescriptionBuildings;
	CUtlMap < int, description_data> m_ddDescriptionAbilities;

	// labels, needed to show the info
	vgui::Label *m_pTitle;
	vgui::Label *m_pCost;
	vgui::Label *m_pTime;

	vgui::Label *m_pCostHeader;
	vgui::Label *m_pTimeHeader;

	// cost and time icons
	int m_iCostIcon;
	int m_iTimeIcon;

	// description
	vgui::Description *m_pDescription;
};


#endif  // HUD_RTS_INFOPANEL_H