Files
UnrealEngineUWP/Engine/Plugins/Experimental/CommonUI/Source/CommonInput/Private/CommonInputActionDomain.cpp
jc authier a0283ed2ff Common Input:
- Made action domain cache optional to denote if a widget tried to get an action domain but couldn't versus one that simply didn't try yet
- Evaluate the current widget when calculating the action domain as it might have a meta data
- Fixed crash when stopping in PIE without a full setup when action domain are enabled

[REVIEW] [at]prajwal.manjunath

#ROBOMERGE-AUTHOR: jc.authier
#ROBOMERGE-SOURCE: CL 19100743 via CL 19103235 via CL 19106069 via CL 19106115 via CL 19110127
#ROBOMERGE-BOT: UE5 (Release-Engine-Staging -> Main) (v921-19075845)

[CL 19148454 by jc authier in ue5-main branch]
2022-02-25 11:01:17 -05:00

66 lines
1.3 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "CommonInputActionDomain.h"
DEFINE_LOG_CATEGORY(LogUIActionDomain);
bool UCommonInputActionDomain::ShouldBreakInnerEventFlow(bool bInputEventHandled) const
{
switch (InnerBehavior)
{
case ECommonInputEventFlowBehavior::BlockIfActive:
{
return true;
}
case ECommonInputEventFlowBehavior::BlockIfHandled:
{
return bInputEventHandled;
}
case ECommonInputEventFlowBehavior::NeverBlock:
{
return false;
}
}
return false;
}
bool UCommonInputActionDomain::ShouldBreakEventFlow(bool bDomainHadActiveRoots, bool bInputEventHandledAtLeastOnce) const
{
switch (Behavior)
{
case ECommonInputEventFlowBehavior::BlockIfActive:
{
return bDomainHadActiveRoots;
}
case ECommonInputEventFlowBehavior::BlockIfHandled:
{
return bInputEventHandledAtLeastOnce;
}
case ECommonInputEventFlowBehavior::NeverBlock:
{
return false;
}
}
return false;
}
void UCommonInputActionDomainTable::PostLoad()
{
for (UCommonInputActionDomain* ActionDomain : ActionDomains)
{
if (ActionDomain && ActionDomain->bIsDefaultActionDomain)
{
DefaultActionDomainCache = ActionDomain;
break;
}
}
if (DefaultActionDomainCache.IsNull())
{
UE_LOG(LogUIActionDomain, Error, TEXT("No default action domain defined"));
}
Super::PostLoad();
}