//========= Copyright © 1996-2005, Valve Corporation, All rights reserved. ============//
//
// Purpose: Mainly a holder for the background texture
//
// $NoKeywords: $
//=============================================================================//

#ifndef HUD_INTERFACE_H
#define HUD_INTERFACE_H

#include "hudelement.h"
#include <vgui_controls/Panel.h>

// for buttons
#include "vgui_bitmapbuttonrts.h"
#include "VGui_BitmapImage.h"
#include "hl2wars/rts_shareddefs.h"

#include "hl2wars/hud_rts_radar.h"
#include "hl2wars/hud_rts_unitpanel.h"
#include "hl2wars/hud_rts_abilitypanel.h"
#include "hl2wars/hud_rts_buildingpanel.h"
#include "hl2wars/rts_objectivedialog.h"

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

public:
	CHudInterface( const char *pElementName );
	~CHudInterface();
	virtual void Init( void );
	virtual void LevelShutdown( void );
	//void Paint( void );	
	virtual bool ShouldDraw();
	virtual void PaintBackground();
	void DrawHudPanel( void );

	void UpdateStats( void );
	void UpdateMiddlePanel( void );		// find out which panel we need to show in the middle
	void UpdateBehaviorButtons( void );

	virtual void OnThink();

	void CreateButtons( void );

	void RecalculateSizePos();

	//bool GetAlwaysRun( void ) { return m_bAlwaysRun; }
	bool GetAlwaysRun( void ) { return true; }

	void _cdecl UserCmd_ShowObjectives( void );
	void _cdecl UserCmd_KillSelected( void );
	void _cdecl UserCmd_OrderCancel( void );

	// ability update receiver
	void		MsgFunc_AbilityStateUpdate( bf_read &msg );

protected:
	virtual void	ApplySchemeSettings( vgui::IScheme *scheme );
	virtual void OnCommand( const char *command);

private:
	MESSAGE_FUNC_INT_INT( OnCursorMoved, "OnCursorMoved", x, y );
	virtual void OnCursorEntered();
	virtual void OnCursorExited();
	virtual void OnMousePressed(vgui::MouseCode code);
	virtual void OnMouseDoublePressed(vgui::MouseCode code);
	virtual void OnMouseReleased(vgui::MouseCode code);

	int m_iAspect;
	float m_fPosFix;

	int m_iScreenHeight;
	int m_iScreenWidth;

	int m_iPanelHeight;
	int m_iPanelWidth;

	//int m_iHudPanel;
	CHudTexture *m_pHudPanel;
	Color	m_clrHudPanel;

	// images for state and level up/down buttons
	BitmapImage	m_pImageStatesNormal[ 4 ];
	BitmapImage	m_pImageStatesAggressive[ 4 ];
	//BitmapImage	m_pImageStates[ 2 ];
	//BitmapImage	m_pImageStatesDown[ 3 ];
	//BitmapImage	m_pImageStatesOver[ 2 ];
	BitmapImage	m_pImageLevels[ 2 ];
	BitmapImage	m_pImageLevelsDown[ 2 ];
	BitmapImage	m_pImageLevelsOver[ 2 ];

	// buttons
	CBitmapButtonRTS *state_normal;
	CBitmapButtonRTS *state_defense;

	// level up, down buttons
	CBitmapButtonRTS *level_up;
	CBitmapButtonRTS *level_down;

	// always run? so we don't have to double click every time
	//CBitmapButtonRTS *always_run;
	//bool m_bAlwaysRun;

	CBitmapButtonRTS *main_menu;
	BitmapImage	m_pImageMenu[3];

	CBitmapButtonRTS *obj_button;
	BitmapImage	m_pImageobj[3];

	CBitmapButtonRTS *mp3_button;
	BitmapImage	m_pImagemp3[3];

	CHudMiniMap *m_pMiniMap;	// the minimap
	int m_iRadarX1;
	int m_iRadarY1;
	int m_iRadarX2;
	int m_iRadarY2;

	CHudRTSUnitPanel			*m_pUnitPanel;			// unit panel ( shows which units are selected)
	CHudRTSAbilityPanel			*m_pAbilityPanel;		// ability panel ( what things we can do with this unit of building? )
	CHudRTSBuildingPanel		*m_pBuildingPanel;		// shows info about the building and the unit queue
	CHudRTSConstructionPanel	*m_pConstructionPanel;	// show the progress of the building that is under construction

	vgui::Label *m_pAmountUnits;		// label for amount of units / max units
	vgui::Label *m_pAmountResources;	// label to show the amount of resources

	CRTSObjectiveDialog *m_pObjectivesFrame;
	
};
#endif  // HUD_INTERFACE_H