OLS/Source/ols/Private/DataAssets/OLSInputConfigDataAsset.cpp

57 lines
1.5 KiB
C++
Raw Normal View History

2025-01-06 21:29:37 +00:00
// © 2024 Long Ly. All rights reserved. Any unauthorized use, reproduction, or distribution of this trademark is strictly prohibited and may result in legal action.
#include "DataAssets/OLSInputConfigDataAsset.h"
#include "OLSLog.h"
DEFINE_LOG_CATEGORY(LogOLSInputConfigDataAsset);
2025-01-06 21:29:37 +00:00
UOLSInputConfigDataAsset::UOLSInputConfigDataAsset(const FObjectInitializer& objectInitializer) : Super(objectInitializer)
{
}
const UInputAction* UOLSInputConfigDataAsset::FindNativeInputActionForTag(
const FGameplayTag& inputTag,
bool shouldLogNotFound) const
{
for (const FOLSInputAction& action : NativeInputActions)
{
if (action.InputAction && (action.InputTag == inputTag))
{
return action.InputAction;
}
}
if (shouldLogNotFound)
{
OLS_LOG(LogOLSInputConfigDataAsset, Error,
TEXT("Can't find NativeInputAction for InputTag [%s] on InputConfig [%s]."), GET_TAG_NAME(inputTag),
GET_UOBJECT_NAME(this));
2025-01-06 21:29:37 +00:00
}
return nullptr;
}
const UInputAction* UOLSInputConfigDataAsset::FindAbilityInputActionForTag(
const FGameplayTag& inputTag,
bool shouldLogNotFound) const
{
for (const FOLSInputAction& action : AbilityInputActions)
{
if (action.InputAction && (action.InputTag == inputTag))
{
return action.InputAction;
}
}
if (shouldLogNotFound)
{
OLS_LOG(LogOLSInputConfigDataAsset, Error,
TEXT("Can't find AbilityInputAction for InputTag [%s] on InputConfig [%s]."), GET_TAG_NAME(inputTag),
GET_UOBJECT_NAME(this));
}
return nullptr;
2025-01-06 21:29:37 +00:00
}