///////////////////////////////////////////////////////////////////////////////
//
// File   : Tools_Modal_Overlay_SelectOverriddenItem.h
// Author : Andy Southgate
// Date   : 18-Dec-2008
//
// Copyright (C) 2008 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif   // ifdef ASURA_USE_PRAGMA_ONCE

#ifndef __TOOLS_MODAL_OVERLAY_SELECTOVERRIDDENITEM_H__
#define __TOOLS_MODAL_OVERLAY_SELECTOVERRIDDENITEM_H__

#include "Interface/Asura_Overlay.h"
#include "Misc/Tools_Modal_Overlay.h"

class Tools_UI_Overrides;
class Tools_UI_Overrides_FilterSet;
class Asura_DropDown_List_Dialog;


class Tools_Modal_Overlay_SelectOverriddenItem : public Tools_Modal_Overlay
{
public:
	// Public functions...
	Tools_Modal_Overlay_SelectOverriddenItem( Tools_UI_Overrides*	pxParent, const char* const szTitle, const int iItemIndex, const int iOverrideItemIndex, const Asura_String* pszItemNames, const int iNumItems, const int iOverrideMapIndex, const Asura_String* pszOverrideMapNames, const int iNumOverrideMaps);
	virtual ~Tools_Modal_Overlay_SelectOverriddenItem();

	// Function to handle modal overlay...
	bool DoModal	(void);

	// Accessor functions...
	int	GetSelectedIndex	(void) const;


protected:
	// Protected variables...

	// Protected functions...
	static void	AcceptItem	( int iUserData );
	static void	CancelItem	( int iUserData );
	static void	DisableItem	( int iUserData );

	// Overridden functions...
	virtual void	InitialiseOverlay	(Asura_Overlay* pxOverlay);
	//	virtual void	Update				(void);


private:
	// Private typedefs...
	typedef Tools_Modal_Overlay PARENT;

	Tools_UI_Overrides*	m_pxParent;

	// Private variables...
	bool										m_bAcceptItem;			// Flag to allow us to accept the item we've chosen.

	Tools_UI_Overrides_FilterSet* m_pxOverridesFilters;
	Asura_DropDown_List_Dialog*					m_pxItemNamesDropDown;
	const char **								m_pszFilteredItemNames;
	int											m_iNumFilteredItems;
	int											m_iFilteredItemIndex;
	int*										m_piFilteredItemIndicesLookup;

	int											m_iItemIndex;			// The index of the current material.
	const Asura_String*							m_pszItemNames;			// An array of pointers to the names of materials to use.
	int											m_iNumItems;			// The number of materials in the array.
	Asura_String								m_xItemString;			// The string used to display the material information.

	int											m_iOverrideIndex;			// The index of the current override.
	const Asura_String*							m_pszOverrideNames;			// An array of pointers to the names of overrides to use.
	int											m_iNumOverrides;			// The number of overrides in the array.
	Asura_String								m_xOverrideNameString;		// The string used to display the override name information.
	Asura_String								m_xOverrideItemString;	// The string used to display the override name information.

	// Private functions...
	Tools_Modal_Overlay_SelectOverriddenItem  (void);
	Tools_Modal_Overlay_SelectOverriddenItem  (const Tools_Modal_Overlay_SelectOverriddenItem& xOther);

	Tools_Modal_Overlay_SelectOverriddenItem&	operator=	(const Tools_Modal_Overlay_SelectOverriddenItem& xOther);

	static void FiltersChanged( void* const pxUserData );
	void ApplyFilters( void );

};   // End of class 'Tools_Modal_Overlay_SelectOverriddenItem'.

#endif //__TOOLS_MODAL_OVERLAY_SELECTOVERRIDDENITEM_H__
