148 lines
5.5 KiB
C++
148 lines
5.5 KiB
C++
|
|
#include "stdafx.h"
|
|||
|
|
#include "SceneProperty.h"
|
|||
|
|
#include "CommandSet.h"
|
|||
|
|
#include "ToolData.h"
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
CSceneProperty::CSceneProperty( wxWindow* pParent, int id ) : IPropertyDelegate( pParent, id )
|
|||
|
|
{
|
|||
|
|
wxPGId CategoryID = m_pPropGrid->AppendCategory( wxT("Scene Property") );
|
|||
|
|
m_pPropGrid->SetPropertyHelpString( CategoryID, wxT("Set Scene Property") );
|
|||
|
|
|
|||
|
|
// <20><> <20><><EFBFBD><EFBFBD> <20>ÿ<EFBFBD> <20><><EFBFBD><EFBFBD> Ŭ<><C5AC><EFBFBD>̾<EFBFBD>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD> <20><><EFBFBD>̵<EFBFBD> <20>ƿ<EFBFBD><C6BF><EFBFBD> <20><> <20>ð<EFBFBD>
|
|||
|
|
m_aPGID[ SCENE_START_FADE_OUT_TIME ] = m_pPropGrid->Append( wxFloatProperty( wxT("Scene Start Fade Out Time"), wxPG_LABEL, 0.0f ) );
|
|||
|
|
m_aPGID[ SCENE_END_FADE_IN_TIME ] = m_pPropGrid->Append( wxFloatProperty( wxT("Scene End Fade In Time"), wxPG_LABEL, 0.0f ) );
|
|||
|
|
|
|||
|
|
m_aPGID[ USE_SCENE_END_CLIPPING ] = m_pPropGrid->Append( wxBoolProperty( wxT("Use Scene End Clipping"), wxPG_LABEL, false ) );
|
|||
|
|
m_aPGID[ SCENE_END_CLIP_TIME ] = m_pPropGrid->Append( wxFloatProperty( wxT("End Clipping Time (sec)"), wxPG_LABEL, 0.0f ) );
|
|||
|
|
m_aPGID[ USE_SIGNAL_SOUND ] = m_pPropGrid->Append( wxBoolProperty( wxT("Use Signal Sound"), wxPG_LABEL, false ) );
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD>Ͱ<EFBFBD> <20>߰<EFBFBD><DFB0>ǰų<C7B0> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>. <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʵ<EFBFBD> <20><><EFBFBD>ΰ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20>ʱ<EFBFBD>ȭ <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><>
|
|||
|
|
m_aPGID[ MAIN_CHARACTER ] = m_pPropGrid->Append( wxEnumProperty( wxT("Main Character"), wxPG_LABEL, wxArrayString() ) );
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> fog far <20><> <20>ִٸ<D6B4> <20>Է<EFBFBD> <20>´<DEB4>.
|
|||
|
|
m_aPGID[ FOGFAR_DELTA ] = m_pPropGrid->Append( wxFloatProperty( wxT("Fog Far Delta"), wxPG_LABEL, 0.0f ) );
|
|||
|
|
|
|||
|
|
// <20><> <20>ƽſ<C6BD><C5BF><EFBFBD><EFBFBD><EFBFBD> <20><>ī<EFBFBD><C4AB><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>.
|
|||
|
|
m_aPGID[ ACADEMIC_NOT_SUPPORTED ] = m_pPropGrid->Append( wxBoolProperty( wxT("Academic Not Support"), wxPG_LABEL, false ) );
|
|||
|
|
m_pPropGrid->SetPropertyAttribute( m_aPGID[ ACADEMIC_NOT_SUPPORTED ], wxPG_BOOL_USE_CHECKBOX, true );
|
|||
|
|
|
|||
|
|
m_pPropGrid->EnableProperty( m_aPGID[ SCENE_END_CLIP_TIME ], false );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
CSceneProperty::~CSceneProperty(void)
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CSceneProperty::Initialize( void )
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CSceneProperty::OnShow( void )
|
|||
|
|
{
|
|||
|
|
// <20><> <20>Ӽ<EFBFBD><D3BC><EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD>̰<EFBFBD> <20>Ǵ<EFBFBD> <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>.. <20>ٸ<EFBFBD> <20>Ӽ<EFBFBD><D3BC><EFBFBD><EFBFBD><EFBFBD> <20><> <20>ٸ<EFBFBD><D9B8><EFBFBD>.. <20><>Ʈ<EFBFBD><C6AE><EFBFBD><EFBFBD><EFBFBD><EFBFBD> ó<><C3B3><EFBFBD>ؾ<EFBFBD> <20>ϳ<EFBFBD>.
|
|||
|
|
_UpdateProp();
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CSceneProperty::_UpdateProp( void )
|
|||
|
|
{
|
|||
|
|
const SceneInfo* pSceneInfo = TOOL_DATA.GetSceneInfo();
|
|||
|
|
|
|||
|
|
m_pPropGrid->SetPropertyValueDouble( m_aPGID[ SCENE_START_FADE_OUT_TIME ], (float)pSceneInfo->fSceneStartFadeOutTime * 0.001f );
|
|||
|
|
m_pPropGrid->SetPropertyValueDouble( m_aPGID[ SCENE_END_FADE_IN_TIME ], (float)pSceneInfo->fSceneEndFadeInTime * 0.001f );
|
|||
|
|
|
|||
|
|
m_pPropGrid->SetPropertyValueBool( m_aPGID[ USE_SCENE_END_CLIPPING ], pSceneInfo->bUseSceneEndClippingTime );
|
|||
|
|
m_pPropGrid->EnableProperty( m_aPGID[ SCENE_END_CLIP_TIME ], pSceneInfo->bUseSceneEndClippingTime );
|
|||
|
|
m_pPropGrid->SetPropertyValueDouble( m_aPGID[ SCENE_END_CLIP_TIME ], (float)pSceneInfo->fSceneEndClipTime );
|
|||
|
|
m_pPropGrid->SetPropertyValueBool( m_aPGID[ USE_SIGNAL_SOUND ], pSceneInfo->bUseSignalSound );
|
|||
|
|
m_pPropGrid->SetPropertyValueDouble( m_aPGID[ FOGFAR_DELTA ], pSceneInfo->fFogFarDelta );
|
|||
|
|
m_pPropGrid->SetPropertyValueBool( m_aPGID[ ACADEMIC_NOT_SUPPORTED ], pSceneInfo->bAcademicNotSupported );
|
|||
|
|
|
|||
|
|
// <20><><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>Ʈ<EFBFBD><C6AE> <20>ֽ<EFBFBD><D6BD><EFBFBD><EFBFBD><EFBFBD> <20><><EFBFBD><EFBFBD>
|
|||
|
|
wxPGChoiceInfo ChoiceInfo;
|
|||
|
|
m_aPGID[ MAIN_CHARACTER ].GetProperty().GetChoiceInfo( &ChoiceInfo );
|
|||
|
|
while( ChoiceInfo.m_itemCount > 0 )
|
|||
|
|
{
|
|||
|
|
m_aPGID[ MAIN_CHARACTER ].GetProperty().DeleteChoice( 0 );
|
|||
|
|
m_aPGID[ MAIN_CHARACTER ].GetProperty().GetChoiceInfo( &ChoiceInfo );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
m_pPropGrid->AddPropertyChoice( m_aPGID[ MAIN_CHARACTER ], wxT("NONE") );
|
|||
|
|
wxString strActorName;
|
|||
|
|
int iNumActors = TOOL_DATA.GetNumActors();
|
|||
|
|
for( int iActor = 0; iActor < iNumActors; ++iActor )
|
|||
|
|
{
|
|||
|
|
TOOL_DATA.GetActorNameByIndex( iActor, strActorName );
|
|||
|
|
m_pPropGrid->AddPropertyChoice( m_aPGID[ MAIN_CHARACTER ], strActorName.c_str() );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
wxCSConv MBConv( wxFONTENCODING_CP949 );
|
|||
|
|
wxChar wcaBuf[ 256 ];
|
|||
|
|
ZeroMemory( wcaBuf, sizeof(wcaBuf) );
|
|||
|
|
MBConv.MB2WC( wcaBuf, pSceneInfo->strMainCharacterName.c_str(), 256 );
|
|||
|
|
m_pPropGrid->SetPropertyValue( m_aPGID[ MAIN_CHARACTER ], wcaBuf );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CSceneProperty::_GetPropertyValue( SceneInfo* pInfo )
|
|||
|
|
{
|
|||
|
|
pInfo->fSceneStartFadeOutTime = float(m_pPropGrid->GetPropertyValueAsDouble( m_aPGID[ SCENE_START_FADE_OUT_TIME ] ));
|
|||
|
|
pInfo->fSceneEndFadeInTime = float(m_pPropGrid->GetPropertyValueAsDouble( m_aPGID[ SCENE_END_FADE_IN_TIME ] ));
|
|||
|
|
pInfo->bUseSceneEndClippingTime = m_pPropGrid->GetPropertyValueAsBool( m_aPGID[ USE_SCENE_END_CLIPPING ] );
|
|||
|
|
m_pPropGrid->EnableProperty( m_aPGID[ SCENE_END_CLIP_TIME ], pInfo->bUseSceneEndClippingTime );
|
|||
|
|
pInfo->fSceneEndClipTime = float(m_pPropGrid->GetPropertyValueAsDouble( m_aPGID[ SCENE_END_CLIP_TIME ] ));
|
|||
|
|
pInfo->bUseSignalSound = m_pPropGrid->GetPropertyValueAsBool( m_aPGID[ USE_SIGNAL_SOUND ] );
|
|||
|
|
pInfo->fFogFarDelta = m_pPropGrid->GetPropertyValueAsDouble( m_aPGID[ FOGFAR_DELTA ] );
|
|||
|
|
pInfo->bAcademicNotSupported = m_pPropGrid->GetPropertyValueAsBool( m_aPGID[ ACADEMIC_NOT_SUPPORTED ] );
|
|||
|
|
|
|||
|
|
wxString strMainCharacterName = m_pPropGrid->GetPropertyValueAsString( m_aPGID[ MAIN_CHARACTER ] );
|
|||
|
|
wxCSConv MBConv( wxFONTENCODING_CP949 );
|
|||
|
|
char caBuf[ 256 ];
|
|||
|
|
ZeroMemory( caBuf, sizeof(caBuf) );
|
|||
|
|
MBConv.WC2MB( caBuf, strMainCharacterName.c_str(), 256 );
|
|||
|
|
pInfo->strMainCharacterName = caBuf;
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CSceneProperty::OnPropertyChanged( wxPropertyGridEvent& PGEvent )
|
|||
|
|
{
|
|||
|
|
SceneInfo Info;
|
|||
|
|
_GetPropertyValue( &Info );
|
|||
|
|
|
|||
|
|
CSceneInfoModify SceneInfoModify( &TOOL_DATA, &Info );
|
|||
|
|
TOOL_DATA.RunCommand( &SceneInfoModify );
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CSceneProperty::ClearTempData( void )
|
|||
|
|
{
|
|||
|
|
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
|
|||
|
|
|
|||
|
|
void CSceneProperty::CommandPerformed( ICommand* pCommand )
|
|||
|
|
{
|
|||
|
|
switch( pCommand->GetTypeID() )
|
|||
|
|
{
|
|||
|
|
case CMD_UPDATE_VIEW:
|
|||
|
|
_UpdateProp();
|
|||
|
|
break;
|
|||
|
|
|
|||
|
|
case CMD_MODIFY_SCENE_INFO:
|
|||
|
|
_UpdateProp();
|
|||
|
|
break;
|
|||
|
|
}
|
|||
|
|
}
|