//
// Tools_PFX_Overlay.h
//
// Created by KOR - 21 February 2008
//
// Copyright (C) 2008 Rebellion, All Rights Reserved.
//

#ifdef ASURA_USE_PRAGMA_ONCE
#pragma once
#endif

#ifndef __TOOLS_PFX_OVERLAY_H__
#define __TOOLS_PFX_OVERLAY_H__

#include "Interface/Asura_Dialog.h"
#include "Misc/Tools_Modal_Overlay.h"
#include "Interface/Asura_Tree_Dialog.h"

// Tools_PFXSelect_Overlay
//
// A modal overlay which gives the user a choice of all PFX effect templates.
//
class Tools_PFXSelect_Overlay : public Tools_Modal_Overlay
{
public:
	enum Mode {
		MODE_EFFECTS=0,
		MODE_SOURCES=1,
		MODE_PARTICLES=2,
	};
	Tools_PFXSelect_Overlay (const char* pszTitleString, Mode eMode, const Asura_String &xFilter = "");
	virtual ~Tools_PFXSelect_Overlay ();

	bool DoModal();


	// Helpers to make it more obvious how to use this class.
	const char* GetTemplateName() {return m_xTemplateName.GetString();}
	Asura_Hash_ID GetTemplateHash() { return m_uHash;}

	void SetSelected(const char* pName);
	void SetSelected(Asura_Hash_ID uHash);
private:
	void	AddToTree(const Asura_String& xName, const Asura_String& xFilter);

	static void TreeDoubleClicked(int iUserData);
	static void OkaySelected( int iUserData );
	static void CancelSelected( int iUserData );

	virtual void InitialiseOverlay(class Asura_Overlay* Overlay);

	Asura_TreeDialog_Tree	m_xTree;
	bool					m_bReturnValue;
	Asura_Hash_ID			m_uHash;
	Asura_String			m_xTemplateName;
	Asura_String			m_xFilter;
	Mode					m_eMode;

	

	typedef Tools_Modal_Overlay PARENT;
};



#endif//__TOOLS_PFX_OVERLAY_H__