
///////////////////////////////////////////////////////////////////////////////
//
// File   : Tools_ModalOverlay_FacialAnimation_FaceSelection.h
// Author : Andy Tate
// Date   : 4-Sep-2008
//
// Copyright (C) 2008 Rebellion, All Rights Reserved.
//
///////////////////////////////////////////////////////////////////////////////

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

#ifndef __TOOLS_MODALOVERLAY_FACIALANIMATION_FACESELECTION_H__
#define __TOOLS_MODALOVERLAY_FACIALANIMATION_FACESELECTION_H__

#if defined(ASURA_USE_FACIAL_ANIMATION_SYSTEM)

/* obsolete

////////////////////////////////////////////////////////////////////////////////
// Include files...
////////////////////////////////////////////////////////////////////////////////

#include "Interface/Asura_Tree_Dialog.h"

#include "Misc/Tools_Modal_Overlay.h"


////////////////////////////////////////////////////////////////////////////////
// Forward class declarations...
////////////////////////////////////////////////////////////////////////////////


////////////////////////////////////////////////////////////////////////////////
// Class declaration...
////////////////////////////////////////////////////////////////////////////////

////////////////////////////////////////////////////////////////////////////////
// Class        : Tools_ModalOverlay_FacialAnimation_FaceSelection
// Author       : Andy Tate
// Date         : 4-Sep-2008
//
// Description  : Class used to allow face-selection using a modal-overlay.
////////////////////////////////////////////////////////////////////////////////

class Tools_ModalOverlay_FacialAnimation_FaceSelection : public TreeSelect_Overlay
{
public:
	// Public functions...
	Tools_ModalOverlay_FacialAnimation_FaceSelection(const char* szMessage)
	: PARENT(szMessage, &m_xFaceTree)
	{
		const char*	szFaceDirectory		= Tools_FacialAnimation_System::GetFaceDirectoryName();
		const char*	szFaceFileExtension	= Tools_FacialAnimation_System::GetFaceFileExtension();

		// Ensure we've got all of the face-types in the tree...
		Tools_FacialAnimation_System::PopulateTree(szFaceDirectory, szFaceFileExtension, m_xFaceTree);

		// Allow selection of a single-face-type...
		SetOkayEnabledFunction(Tools_FacialAnimation_System::IsSelectedTreeItemAFile, reinterpret_cast<int>(&m_xFaceTree));
	}
	//virtual ~Tools_ModalOverlay_FacialAnimation_FaceSelection();

	// Accessor functions...
	Tools_FacialAnimation_Face* GetSelectedFace(Asura_Hash_ID* puHash = NULL, Asura_String* pxPath = NULL)
	{
		const Asura_TreeDialog_Item*	pxItem	= GetSelectionItem();

		if(pxItem == NULL)
		{
			return(NULL);
		}
		else
		{
			if(  Tools_FacialAnimation_System::IsTreeItemAUnset( *pxItem ) )
			{
				return(NULL);
			}
			else
			{
				Asura_String				xPath;

				Tools_FacialAnimation_Face*	pxFace	= Tools_FacialAnimation_System::FindOrLoadFaceFromTreeItem(*pxItem, xPath);

				if(pxFace == NULL)
				{
					return(NULL);
				}
				else
				{
					if(puHash != NULL)
					{
						*puHash	= pxItem->GetHash();
					}
					if(pxPath != NULL)
					{
						*pxPath	= xPath;
					}
					return(pxFace);
				}
			}
		}
	}


protected:
	// Protected variables...

	// Protected functions...


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

	// Private variables...
	Asura_TreeDialog_Tree	m_xFaceTree;	// The dialogue-tree used to select the face.

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

	Tools_ModalOverlay_FacialAnimation_FaceSelection&	operator=(const Tools_ModalOverlay_FacialAnimation_FaceSelection& xOther);

};   // End of class 'Tools_ModalOverlay_FacialAnimation_FaceSelection'.

*/

#endif	//defined(ASURA_USE_FACIAL_ANIMATION_SYSTEM)

#endif   // ifndef __TOOLS_MODALOVERLAY_FACIALANIMATION_FACESELECTION_H__


/// End of file. ///
