本文整理汇总了C++中TObjectIterator::GetLevel方法的典型用法代码示例。如果您正苦于以下问题:C++ TObjectIterator::GetLevel方法的具体用法?C++ TObjectIterator::GetLevel怎么用?C++ TObjectIterator::GetLevel使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TObjectIterator
的用法示例。
在下文中一共展示了TObjectIterator::GetLevel方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Exec
UBOOL FExecHook::Exec( const TCHAR* Cmd, FOutputDevice& Ar )
{
if( ParseCommand(&Cmd,TEXT("ShowLog")) )
{
if( GLogWindow )
{
GLogWindow->Show(1);
SetFocus( *GLogWindow );
GLogWindow->Display.ScrollCaret();
}
return TRUE;
}
else if( ParseCommand(&Cmd,TEXT("TakeFocus")) )
{
TObjectIterator<UEngine> EngineIt;
if( EngineIt && EngineIt->Client && EngineIt->Client->Viewports.Num() )
{
SetForegroundWindow( (HWND)EngineIt->Client->Viewports(0)->GetWindow() );
}
return TRUE;
}
else if( ParseCommand(&Cmd,TEXT("EditActor")) )
{
UClass* Class;
TObjectIterator<UEngine> EngineIt;
if( EngineIt && ParseObject<UClass>( Cmd, TEXT("Class="), Class, ANY_PACKAGE ) )
{
const AActor* Player = EngineIt->Client ? EngineIt->Client->Viewports(0)->Actor : NULL;
const AActor* Found = NULL;
FLOAT MinDist = 999999.0f;
for( TObjectIterator<AActor> It; It; ++It )
{
FLOAT Dist = Player ? FDist(It->Location,Player->Location) : 0.0f;
if( (!Player || It->GetLevel()==Player->GetLevel()) && (!It->bDeleteMe) && (It->IsA( Class) ) && (Dist<MinDist) )
{
MinDist = Dist;
Found = *It;
}
}
if( Found )
{
WObjectProperties* P = new WObjectProperties( TEXT("EditActor"), 0, TEXT(""), NULL, 1 );
P->OpenWindow( (HWND)EngineIt->Client->Viewports(0)->GetWindow() );
P->Root.SetObjects( (UObject**)&Found, 1 );
P->Show(1);
}
else Ar.Logf( TEXT("Actor not found") );
}
else Ar.Logf( TEXT("Missing class") );
return TRUE;
}
else if( ParseCommand(&Cmd,TEXT("HideLog")) )
{
if( GLogWindow )
{
GLogWindow->Show(0);
}
return TRUE;
}
else if( ParseCommand(&Cmd,TEXT("Preferences")) && !GIsClient )
{
if( !m_pPreferences )
{
m_pPreferences = new WConfigProperties( TEXT("Preferences"), LocalizeGeneral("AdvancedOptionsTitle",TEXT("Window")) );
m_pPreferences->SetNotifyHook( this );
m_pPreferences->OpenWindow( GLogWindow ? GLogWindow->hWnd : NULL );
m_pPreferences->ForceRefresh();
}
assert(m_pPreferences);
m_pPreferences->Show(TRUE);
SetFocus( *m_pPreferences );
return TRUE;
}
return FALSE;
}