Files
UnrealEngineUWP/Engine/Source/Editor/LevelEditor/Private/LightingTools.cpp
2014-03-14 14:13:41 -04:00

57 lines
1.5 KiB
C++

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.
/*================================================================================
LightingTools.cpp: Lighting Tools helper
================================================================================*/
#include "LevelEditor.h"
#include "LightingTools.h"
/**
* LightingTools settings
*/
/** Static: Global lighting tools adjust settings */
FLightingToolsSettings FLightingToolsSettings::LightingToolsSettings;
void FLightingToolsSettings::Init()
{
FLightingToolsSettings& Settings = Get();
for (int32 ViewIndex = 0; ViewIndex < GEditor->AllViewportClients.Num(); ViewIndex++)
{
if (GEditor->AllViewportClients[ViewIndex]->IsPerspective())
{
Settings.bSavedShowSelection = GEditor->AllViewportClients[ViewIndex]->EngineShowFlags.Selection;
GEditor->AllViewportClients[ViewIndex]->EngineShowFlags.Selection = 0;
break;
}
}
ApplyToggle();
}
bool FLightingToolsSettings::ApplyToggle()
{
FLightingToolsSettings& Settings = Get();
FEditorSupportDelegates::RedrawAllViewports.Broadcast();
return true;
}
void FLightingToolsSettings::Reset()
{
FEditorSupportDelegates::RedrawAllViewports.Broadcast();
FLightingToolsSettings& Settings = Get();
if (Settings.bSavedShowSelection)
{
for (int32 ViewIndex = 0; ViewIndex < GEditor->AllViewportClients.Num(); ViewIndex++)
{
if (GEditor->AllViewportClients[ViewIndex]->IsPerspective())
{
GEditor->AllViewportClients[ViewIndex]->EngineShowFlags.Selection = 1;
break;
}
}
}
}