//////////////////////////////////////////////////////////////////////////////
//
// ToolsAVP_Level_Export.h
//
// Copyright (c) 2006 Rebellion. All rights reserved.
//
//////////////////////////////////////////////////////////////////////////////

// B E G I N   F I L E   W R A P P E R ///////////////////////////////////////

#ifdef ASURA_USE_PRAGMA_ONCE
    #pragma once
#endif

#ifndef TOOLSAVP_LEVEL_EXPORT_H___
#define TOOLSAVP_LEVEL_EXPORT_H___ 1

// I N C L U D E S ///////////////////////////////////////////////////////////

// Project...
#include "Core/AVP_Game_Core.h"
#include "Core/AVP_Settings.h"

// Tools.
#include "Load&Save/LevelExport/Tools_Level_Export.h"

// C L A S S E S /////////////////////////////////////////////////////////////

class ToolsAVP_Level_Export : public Tools_Level_Export
{

public:

    ToolsAVP_Level_Export( void );

	virtual void AddInGameFilesToList( List<Asura_String>* pxList, const Asura_String& xEnvFilename );
	virtual void AddFilesForCharacterExport(List<Asura_String>& xFileList,const char* szDirectory);
	virtual void GetExportedCharacterDir(Asura_String& outputDir, bool bCreate);
	
	virtual bool ShouldSoundsBeIncludedInCharacterExports(){ return(true); }

	virtual bool IsLanguageAllowed(int iLanguage) const;

	static void CreateExportWeaponOverlay();

protected:
	virtual void StartLevelExport();

	virtual void StartFileExport();
	virtual void EndFileExport();

	virtual void GenerateExportedLevelFilename(Asura_String xEnvironmentFilename, const char* szExtension, Asura_String& xOutputFilename);
	virtual void GetExportedLevelFilename(const Asura_String& xEnvironmentFilename, Asura_String& xOutputFilename);
#if defined(ASURA_USE_TEXTURE_STREAMING)
	virtual void GetExportedLevelTextureStreamingFilename(const Asura_String& xEnvironmentFilename, Asura_String& xOutputFilename);
#endif	//defined(ASURA_USE_TEXTURE_STREAMING)

	virtual bool IsPlatformAllowed( EXPORT_TYPE ePlatform ) const;
	virtual bool ShouldExportAnimationUncompressed(const Asura_Hierarchy_Anim& xAnimation) const;
	virtual bool ShouldExportAnimationWithoutRemovingKeyframes(const Asura_Hierarchy_Anim& xAnimation) const;
//	virtual bool ShouldExportStreamingTexturesFile() const { return s_eExportType != Export_PS3 && Tools_Level_Export::ShouldExportStreamingTexturesFile(); }
	virtual void AddCommonExportFilesToList(List<Asura_String>& xNameList);

	virtual void AddCharacterExportOverlayControls(Asura_Overlay* pxOverlay, Asura_Vector_2& xOffset);
	void AddWeaponExportOverlayControls(Asura_Overlay* pxOverlay, Asura_Vector_2& xOffset);

	virtual void ExportAllCharacterFiles(void);

	typedef Tools_Level_Export PARENT;

private:
	struct ExportData
	{
		const char*				m_szName;
		Asura_Hash_ID			m_uBlueprintHash;
		AVP_Settings::Species	m_eSpecies;
		bool					m_bExport;
		bool					m_bExportWeaponsOn;
	};

	static ExportData	s_axExportData[AVP_Game_Core::NUM_CHARACTERTYPES];

	// Variables to allow a list of material-response overrides to be specified for export...
	static u_int			s_uNumMaterialResponseOverridesForExport;
	static Asura_Hash_ID*	s_pxMaterialResponseOverridesForExport;

	static void ExportAVPCharacters();
	static void ExportAVPWeapons();
	void ExportCharacterFiles(const AVP_Game_Core::CharacterType eType);
	void ExportWeaponFiles(const u_int uWeaponIndex, const AVP_Game_Core::CharacterType eType);

	void AddSharedExportControls(Asura_Overlay* pxOverlay, Asura_Vector_2& xOffset, void (*pfAddSelectionControls)( Asura_Overlay* pxOverlay, Asura_Vector_2& xOffset ), void(*pfExportFunction)() );
	static void AddWeaponSelectionControls(Asura_Overlay* pxOverlay, Asura_Vector_2& xOffset);
	static void AddCharacterSelectionControls(Asura_Overlay* pxOverlay, Asura_Vector_2& xOffset);

	static void ToggleSPCharacters();
	static void ToggleMPCharacters();

	static void ToggleSPWeapons();
	static void ToggleMPWeapons();

	static void ToggleWeaponsForCharacter( int iChar );
	
	static void AddSurfaceEffectsToExportList(List<Asura_String>& xNameList);
	static void AddWeaponDataToExport(List<Asura_String>& xNameList);
};

// E N D   F I L E   W R A P P E R ///////////////////////////////////////////

#endif // #ifndef TOOLSAVP_LEVEL_EXPORT_H___
