lyra_game_ue/Source/LyraGame/Input/LyraInputConfig.cpp
Goran Lazarevski 3bcab085f8 Initial commit
2025-03-20 11:06:26 +01:00

49 lines
1.2 KiB
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "LyraInputConfig.h"
#include "LyraLogChannels.h"
#include UE_INLINE_GENERATED_CPP_BY_NAME(LyraInputConfig)
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;
}