Files
UnrealEngineUWP/Engine/Source/Editor/UMGEditor/Private/Extensions/DesignerExtension.cpp
Ben Marsh 20bf0eb6a1 Updating copyright notices to 2017 (copying from //Tasks/UE4/Dev-Copyright-2017).
#rb none
#lockdown Nick.Penwarden

[CL 3226823 by Ben Marsh in Main branch]
2016-12-08 08:52:44 -05:00

54 lines
991 B
C++

// Copyright 1998-2017 Epic Games, Inc. All Rights Reserved.
#include "DesignerExtension.h"
#include "ScopedTransaction.h"
#define LOCTEXT_NAMESPACE "UMG"
// Designer Extension
FDesignerExtension::FDesignerExtension()
: ScopedTransaction(NULL)
{
}
void FDesignerExtension::Initialize(IUMGDesigner* InDesigner, UWidgetBlueprint* InBlueprint)
{
Designer = InDesigner;
Blueprint = InBlueprint;
}
FName FDesignerExtension::GetExtensionId() const
{
return ExtensionId;
}
void FDesignerExtension::BeginTransaction(const FText& SessionName)
{
if ( ScopedTransaction == NULL )
{
ScopedTransaction = new FScopedTransaction(SessionName);
}
for ( FWidgetReference& Selection : SelectionCache )
{
if ( Selection.IsValid() )
{
Selection.GetPreview()->Modify();
Selection.GetTemplate()->Modify();
}
}
}
void FDesignerExtension::EndTransaction()
{
if ( ScopedTransaction != NULL )
{
delete ScopedTransaction;
ScopedTransaction = NULL;
}
}
#undef LOCTEXT_NAMESPACE