Files
UnrealEngine/Engine/Plugins/MetaHuman/MetaHumanCharacter/Source/MetaHumanCharacterPalette/Private/MetaHumanPinnedSlotSelection.cpp
2025-05-18 13:04:45 +08:00

25 lines
905 B
C++

// Copyright Epic Games, Inc. All Rights Reserved.
#include "MetaHumanPinnedSlotSelection.h"
bool FMetaHumanPinnedSlotSelection::IsItemPinned(TConstArrayView<FMetaHumanPinnedSlotSelection> SortedSelections, const FMetaHumanPaletteItemPath& ItemPath)
{
return SortedSelections.ContainsByPredicate([&ItemPath](const FMetaHumanPinnedSlotSelection& SortedSelection)
{
return SortedSelection.Selection.GetSelectedItemPath() == ItemPath;
});
}
bool FMetaHumanPinnedSlotSelection::TryGetPinnedItem(
TConstArrayView<FMetaHumanPinnedSlotSelection> SortedSelections,
const FMetaHumanPaletteItemPath& ItemPath,
const FMetaHumanPinnedSlotSelection*& OutPinnedItem)
{
OutPinnedItem = SortedSelections.FindByPredicate([&ItemPath](const FMetaHumanPinnedSlotSelection& SortedSelection)
{
return SortedSelection.Selection.GetSelectedItemPath() == ItemPath;
});
return OutPinnedItem != nullptr;
}