You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
58 lines
1.5 KiB
C++
58 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"
|
|
#include "EditorSupportDelegates.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;
|
|
}
|
|
}
|
|
}
|
|
}
|