#ifndef HUD_RTS_UNITPANEL_H
#define HUD_RTS_UNITPANEL_H

#include <vgui_controls/Panel.h>
// for buttons
#include "hl2wars/vgui_bitmapbuttonrts.h"
#include "VGui_BitmapImage.h"
#include "hl2wars/rts_shareddefs.h"
#include "vgui/mousecode.h"

#define MAX_BUTTONS 80
enum scalelevels
{
	SCALE_18 = 0,
	SCALE_32,
	SCALE_72,
};

class CHudRTSUnitPanel : public vgui::Panel
{
	DECLARE_CLASS_SIMPLE( CHudRTSUnitPanel, vgui::Panel);

public:
	CHudRTSUnitPanel( );
	~CHudRTSUnitPanel();
	virtual void Init( void );
	virtual void LevelShutdown( void );
	virtual void OnThink();
	virtual void Update();
	virtual bool NeedsUpdate( void );
	void		 CreateButtonUnits( CBitmapButtonRTS *pSlot, const char *command, const char *command2);
	BitmapImage *GetImage( const char *unit_type );
	void		 DrawImage( BitmapImage *image, int i, int highlight, color32 color);
	char		*GetUnitType( int i ); 
	int			 GetUnitIndex( int i );
	void         UpdateLastHighLighted( int i );
	float		 GetHealthWeight( int selected );

	void		 CalculateSizePos( void );

	virtual void OnMousePressed( vgui::MouseCode code);
	virtual void OnMouseReleased( vgui::MouseCode code);

protected:
	virtual void OnCommand( const char *command);

private:
	CBitmapButtonRTS *m_pSlot[MAXUNITSLOTS];	// 8 buttons for the unit slots

	CUtlMap < int, BitmapImage *> m_pImageUnits;

	int m_iLastUnitTypes[MAXUNITSLOTS];
	int m_iLastHighLighted[MAXUNITSLOTS];

	int m_iScaleLevel;
};

#endif  // HUD_RTS_UNITPANEL_H