2022-05-23 18:41:30 +00:00
|
|
|
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
|
|
|
|
#include "LyraInputConfig.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
|
|
|
|
#include "Containers/UnrealString.h"
|
|
|
|
#include "HAL/Platform.h"
|
|
|
|
#include "Logging/LogCategory.h"
|
|
|
|
#include "Logging/LogMacros.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
#include "LyraLogChannels.h"
|
2022-09-13 07:18:28 +00:00
|
|
|
#include "Trace/Detail/Channel.h"
|
|
|
|
#include "UObject/UObjectBaseUtility.h"
|
2022-05-23 18:41:30 +00:00
|
|
|
|
|
|
|
|
|
|
|
ULyraInputConfig::ULyraInputConfig(const FObjectInitializer& ObjectInitializer)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
const UInputAction* ULyraInputConfig::FindNativeInputActionForTag(const FGameplayTag& InputTag, bool bLogNotFound) const
|
|
|
|
{
|
|
|
|
for (const FLyraInputAction& Action : NativeInputActions)
|
|
|
|
{
|
|
|
|
if (Action.InputAction && (Action.InputTag == InputTag))
|
|
|
|
{
|
|
|
|
return Action.InputAction;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bLogNotFound)
|
|
|
|
{
|
|
|
|
UE_LOG(LogLyra, Error, TEXT("Can't find NativeInputAction for InputTag [%s] on InputConfig [%s]."), *InputTag.ToString(), *GetNameSafe(this));
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|
|
|
|
|
|
|
|
const UInputAction* ULyraInputConfig::FindAbilityInputActionForTag(const FGameplayTag& InputTag, bool bLogNotFound) const
|
|
|
|
{
|
|
|
|
for (const FLyraInputAction& Action : AbilityInputActions)
|
|
|
|
{
|
|
|
|
if (Action.InputAction && (Action.InputTag == InputTag))
|
|
|
|
{
|
|
|
|
return Action.InputAction;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (bLogNotFound)
|
|
|
|
{
|
|
|
|
UE_LOG(LogLyra, Error, TEXT("Can't find AbilityInputAction for InputTag [%s] on InputConfig [%s]."), *InputTag.ToString(), *GetNameSafe(this));
|
|
|
|
}
|
|
|
|
|
|
|
|
return nullptr;
|
|
|
|
}
|