You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
105 lines
3.9 KiB
105 lines
3.9 KiB
//====== Copyright © 1996-2005, Valve Corporation, All rights reserved. =======//
|
|
//
|
|
// Purpose:
|
|
//
|
|
// $NoKeywords: $
|
|
//
|
|
//=============================================================================//
|
|
|
|
#ifndef ATTRIBUTEASSETPICKERPANEL_H
|
|
#define ATTRIBUTEASSETPICKERPANEL_H
|
|
|
|
#ifdef _WIN32
|
|
#pragma once
|
|
#endif
|
|
|
|
#include "dme_controls/AttributeBasePickerPanel.h"
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Forward declarations
|
|
//-----------------------------------------------------------------------------
|
|
class CBaseAssetPickerFrame;
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// CAttributeAssetPickerPanel
|
|
//-----------------------------------------------------------------------------
|
|
class CAttributeAssetPickerPanel : public CAttributeBasePickerPanel
|
|
{
|
|
DECLARE_CLASS_SIMPLE( CAttributeAssetPickerPanel, CAttributeBasePickerPanel );
|
|
|
|
public:
|
|
CAttributeAssetPickerPanel( vgui::Panel *parent, const AttributeWidgetInfo_t &info );
|
|
~CAttributeAssetPickerPanel();
|
|
|
|
protected:
|
|
virtual CBaseAssetPickerFrame *CreateAssetPickerFrame() = 0;
|
|
MESSAGE_FUNC_PARAMS( OnAssetSelected, "AssetSelected", kv );
|
|
virtual void ShowPickerDialog();
|
|
};
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Macro to quickly make new attribute types
|
|
//-----------------------------------------------------------------------------
|
|
#define DECLARE_ATTRIBUTE_ASSET_PICKER( _className ) \
|
|
class _className : public CAttributeAssetPickerPanel \
|
|
{ \
|
|
DECLARE_CLASS_SIMPLE( _className, CAttributeAssetPickerPanel ); \
|
|
public: \
|
|
_className( vgui::Panel *parent, const AttributeWidgetInfo_t &info ) : \
|
|
BaseClass( parent, info ) {} \
|
|
private: \
|
|
virtual CBaseAssetPickerFrame *CreateAssetPickerFrame(); \
|
|
}
|
|
|
|
#define IMPLEMENT_ATTRIBUTE_ASSET_PICKER( _className, _popupTitle, _assetType, _assetExt, _assetSubDir, _assetTextType ) \
|
|
CBaseAssetPickerFrame *_className::CreateAssetPickerFrame() \
|
|
{ \
|
|
return new CAssetPickerFrame( this, _popupTitle, _assetType, _assetExt, _assetSubDir, _assetTextType ); \
|
|
}
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Macro to quickly make new attribute types
|
|
//-----------------------------------------------------------------------------
|
|
#define DECLARE_ATTRIBUTE_ASSET_PREVIEW_PICKER( _className ) \
|
|
class _className : public CAttributeAssetPickerPanel \
|
|
{ \
|
|
DECLARE_CLASS_SIMPLE( _className, CAttributeAssetPickerPanel ); \
|
|
public: \
|
|
_className( vgui::Panel *parent, const AttributeWidgetInfo_t &info ) : \
|
|
BaseClass( parent, info ) {} \
|
|
private: \
|
|
virtual CBaseAssetPickerFrame *CreateAssetPickerFrame(); \
|
|
}
|
|
|
|
#define IMPLEMENT_ATTRIBUTE_ASSET_PREVIEW_PICKER( _className, _pickerClassName, _popupTitle ) \
|
|
CBaseAssetPickerFrame *_className::CreateAssetPickerFrame() \
|
|
{ \
|
|
return new _pickerClassName( this, _popupTitle ); \
|
|
}
|
|
|
|
|
|
//-----------------------------------------------------------------------------
|
|
// Assets
|
|
//-----------------------------------------------------------------------------
|
|
DECLARE_ATTRIBUTE_ASSET_PICKER( CAttributeBspPickerPanel );
|
|
DECLARE_ATTRIBUTE_ASSET_PREVIEW_PICKER( CAttributeVtfPickerPanel );
|
|
DECLARE_ATTRIBUTE_ASSET_PREVIEW_PICKER( CAttributeTgaPickerPanel );
|
|
|
|
|
|
class CAttributeVmtPickerPanel : public CAttributeAssetPickerPanel
|
|
{
|
|
DECLARE_CLASS_SIMPLE( CAttributeVmtPickerPanel, CAttributeAssetPickerPanel );
|
|
public:
|
|
CAttributeVmtPickerPanel( vgui::Panel *parent, const AttributeWidgetInfo_t &info ) :
|
|
BaseClass( parent, info ) {}
|
|
private:
|
|
virtual CBaseAssetPickerFrame *CreateAssetPickerFrame();
|
|
|
|
MESSAGE_FUNC_PARAMS( OnAssetSelected, "AssetSelected", kv );
|
|
};
|
|
|
|
#endif // ATTRIBUTEASSETPICKERPANEL_H
|