/** 
 * \file Menu.h
 * \brief Header file containing CMenu class and other main menu parameters.
 * 
 * \author Petar Bajic, MPE (C) All Rights Reserved, Homepage: www.mystic-peanut.com
 * \date January, 16 2007.
 */

#include "d3dx9.h"
#include "Button.h"
#include "ModelStatic.h"
#include "Turtle.h"
#include "Sheep.h"
#include "Media.h"

#define MENU_OPTION_RETURN_NEWGAME 1
#define MENU_OPTION_RETURN_OPTIONS 2
#define MENU_OPTION_RETURN_EXIT    3
#define MENU_OPTION_RETURN_DIFFICULTY_EASY 4
#define MENU_OPTION_RETURN_DIFFICULTY_HARD 5
#define MENU_OPTION_RETURN_DETAILS_ON 6
#define MENU_OPTION_RETURN_DETAILS_OFF 7

class CLanguage;

/**
 * \brief Menu class. This class draws Main Menu GUI and handles user input.
 *
 * Main Menu in this game uses two dimensional buttons (see C2DButton class).
 *
 * \author Petar Bajic \date January, 16 2007.
 */
class CMenu {

public:

	CMenu();
	~CMenu();

	bool Init(HWND hWnd, LPDIRECT3DDEVICE9 device, int screenWidth, int screenHeight, IDirectSound8* pDS, float dificulty, bool details, bool fullscreen, CTurtle* pTurtle, CLanguage* language);
	bool OnEvent(LPDIRECT3DDEVICE9 pd3dDevice, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam, int* code);
	void OnFrameMove(LPDIRECT3DDEVICE9 pd3dDevice, double fTime, float fElapsedTime);
	void OnRender(LPDIRECT3DDEVICE9 pd3dDevice);
	void OnResetDevice(int screenWidth, int screenHeight);
	void OnLostDevice();
	void Restart();

	C2DButton* m_startButton;
	C2DButton* m_optionsButton;
	C2DButton* m_creditsButton;
	C2DButton* m_exitButton;
	C2DButton* m_backButton;
	C2DButton* m_controlButton;
	C2DButton* m_difficultyButton;
	C2DButton* m_detailsButton;

	CModelStatic* m_ModelTerrain;
	CTurtle* m_pTurtle;

	LPDIRECT3DTEXTURE9 m_titleTexture;

	D3DXVECTOR2 m_titleTrans;	//Title position
	D3DXVECTOR2 m_footerTrans;	//Footer position

	LPDIRECT3DTEXTURE9 m_texMenu;
	LPD3DXSPRITE m_sprite;
	LPD3DXFONT m_pFont;
	LPD3DXFONT m_pFontBig;
	LPD3DXFONT m_pFontHuge;
	CLanguage* m_Language;

	int m_menuPosX;
	int m_menuPosY;
	float m_CreditsTimer; //for sliding credits text
	D3DXVECTOR2 m_buttonTrans; //animating buttons
	bool m_playCredits;
	bool m_InOptions;
	bool m_showControls;
	bool m_difficult;
	bool m_detailed;
	CMedia* m_menuTheme;
};