Files
sourcearena/mp/src/public/matsys_controls/mdlpicker.h
T
Joe Ludwig beaae8ac45 Updated the SDK with the latest code from the TF and HL2 branches
* Adds support for Visual Studio 2012 and 2013
* VR Mode:
. Switches from headtrack.dll to sourcevr.dll
. Improved readability of the UI in VR
. Removed the IPD calibration tool. TF2 will now obey the Oculus
configuration file. Use the Oculus calibration tool in your SDK or
install and run "OpenVR" under Tools in Steam to calibrate your IPD.
. Added dropdown to enable VR mode in the Video options. Removed the -vr
command line option.
. Added the ability to switch in and out of VR mode without quitting the
game
. By default VR mode will run full screen. To switch back to a
borderless window set the vr_force_windowed convar.
. Added support for VR mode on Linux
* Many assorted bug fixes and other changes from Team Fortress in
various shared files
2013-12-03 08:54:16 -08:00

156 lines
4.2 KiB
C++

//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose:
//
//=============================================================================
#ifndef MDLPICKER_H
#define MDLPICKER_H
#ifdef _WIN32
#pragma once
#endif
#include "tier1/utlstring.h"
#include "vgui_controls/Frame.h"
#include "matsys_controls/baseassetpicker.h"
#include "datacache/imdlcache.h"
//-----------------------------------------------------------------------------
// Forward declarations
//-----------------------------------------------------------------------------
namespace vgui
{
class Splitter;
}
class CMDLPanel;
const int MAX_SELECTED_MODELS = 2;
//-----------------------------------------------------------------------------
// Purpose: Main app window
//-----------------------------------------------------------------------------
class CMDLPicker : public CBaseAssetPicker
{
DECLARE_CLASS_SIMPLE( CMDLPicker, CBaseAssetPicker );
public:
enum PageType_t
{
PAGE_NONE = 0,
PAGE_RENDER = 0x1,
PAGE_SEQUENCES = 0x2,
PAGE_ACTIVITIES = 0x4,
PAGE_SKINS = 0x8,
PAGE_INFO = 0x10,
PAGE_SCREEN_CAPS = 0x20,
PAGE_ALL = 0xFFFFFFFF,
};
CMDLPicker( vgui::Panel *pParent, int nFlags = PAGE_ALL );
~CMDLPicker();
// overridden frame functions
virtual void PerformLayout();
virtual void OnCommand( const char *pCommand );
// Get current model
void GetSelectedMDLName( char *pBuffer, int nMaxLen );
// get current selected options page
int GetSelectedPage();
// Allows external apps to select a MDL
void SelectMDL( const char *pRelativePath, bool bDoLookAt = true, int nSelectSecondary = 0 );
// Set/Get Sequence
void SelectSequence( const char *pSequenceName );
const char *GetSelectedSequenceName();
// Set/Get Activity
void SelectActivity( const char *pActivityName );
const char *GetSelectedActivityName();
void SelectSkin( int nSkin );
int GetSelectedSkin();
private:
MESSAGE_FUNC_PARAMS( OnAssetSelected, "AssetSelected", params );
virtual void OnSelectedAssetPicked( const char *pMDLName );
void RefreshActivitiesAndSequencesList();
void RefreshRenderSettings();
int UpdateSkinsList();
void UpdateInfoTab();
int UpdatePropDataList( const char* pszPropData, bool &bIsStatic );
// Plays the selected activity
void PlaySelectedActivity( );
// Plays the selected sequence
void PlaySelectedSequence( );
const char *CaptureModel( int nModIndex, const char *AssetName, const char *OutputPath, int Width, int Height, Color BackgroundColor, bool bSelectedOnly );
void CaptureScreenCaps( void );
void SaveCaps( const char *szFileName );
bool RestoreCaps( const char *szFileName );
void WriteBackbackVMTFiles( const char *assetName );
void GenerateBackpackIcons( void );
CUtlString GetOutputFileSuffix();
MESSAGE_FUNC_PARAMS( OnCheckButtonChecked, "CheckButtonChecked", kv );
MESSAGE_FUNC_PARAMS( OnItemSelected, "ItemSelected", kv );
MESSAGE_FUNC( OnPageChanged, "PageChanged" );
MESSAGE_FUNC_CHARPTR( OnDirectorySelected, "DirectorySelected", dir );
CMDLPanel *m_pMDLPreview;
vgui::Splitter* m_pFileBrowserSplitter;
vgui::Splitter* m_pPreviewSplitter;
vgui::PropertySheet *m_pViewsSheet;
vgui::PropertyPage *m_pRenderPage;
vgui::PropertyPage *m_pSequencesPage;
vgui::PropertyPage *m_pActivitiesPage;
vgui::PropertyPage *m_pSkinsPage;
vgui::PropertyPage *m_pInfoPage;
vgui::PropertyPage *m_pScreenCapsPage;
vgui::ListPanel *m_pSequencesList;
vgui::ListPanel *m_pActivitiesList;
vgui::ListPanel *m_pSkinsList;
vgui::ListPanel *m_pPropDataList;
MDLHandle_t m_hSelectedMDL[ MAX_SELECTED_MODELS ];
vgui::DHANDLE< vgui::DirectorySelectDialog > m_hDirectorySelectDialog;
int m_nFlags;
friend class CMDLPickerFrame;
};
//-----------------------------------------------------------------------------
// Purpose: Main app window
//-----------------------------------------------------------------------------
class CMDLPickerFrame : public CBaseAssetPickerFrame
{
DECLARE_CLASS_SIMPLE( CMDLPickerFrame, CBaseAssetPickerFrame );
public:
CMDLPickerFrame( vgui::Panel *pParent, const char *pTitle, int nFlags = CMDLPicker::PAGE_ALL );
virtual ~CMDLPickerFrame();
// Allows external apps to select a MDL
void SelectMDL( const char *pRelativePath );
};
#endif // MDLPICKER_H