RealtimeStyleTransferRuntime/Source/LyraGame/UI/LyraHUDLayout.cpp

34 lines
1.0 KiB
C++
Raw Permalink Normal View History

2022-05-23 18:41:30 +00:00
// Copyright Epic Games, Inc. All Rights Reserved.
#include "LyraHUDLayout.h"
2022-09-13 07:18:28 +00:00
2022-05-23 18:41:30 +00:00
#include "CommonUIExtensions.h"
2022-09-13 07:18:28 +00:00
#include "Delegates/Delegate.h"
2022-05-23 18:41:30 +00:00
#include "Input/CommonUIInputTypes.h"
2022-09-13 07:18:28 +00:00
#include "Misc/AssertionMacros.h"
#include "NativeGameplayTags.h"
#include "UITag.h"
#include "UObject/NameTypes.h"
2022-05-23 18:41:30 +00:00
UE_DEFINE_GAMEPLAY_TAG_STATIC(TAG_UI_LAYER_MENU, "UI.Layer.Menu");
UE_DEFINE_GAMEPLAY_TAG_STATIC(TAG_UI_ACTION_ESCAPE, "UI.Action.Escape");
ULyraHUDLayout::ULyraHUDLayout(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
}
void ULyraHUDLayout::NativeOnInitialized()
{
Super::NativeOnInitialized();
RegisterUIActionBinding(FBindUIActionArgs(FUIActionTag::ConvertChecked(TAG_UI_ACTION_ESCAPE), false, FSimpleDelegate::CreateUObject(this, &ThisClass::HandleEscapeAction)));
}
void ULyraHUDLayout::HandleEscapeAction()
{
if (ensure(!EscapeMenuClass.IsNull()))
{
UCommonUIExtensions::PushStreamedContentToLayer_ForPlayer(GetOwningLocalPlayer(), TAG_UI_LAYER_MENU, EscapeMenuClass);
}
}