You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
Add folder and asset colors to TEDS Remove the ItemName_ExperimentalColumn and replace with FNameColumn Add extension utils to the CB to get/set folder colors Add a new FFolder tag used by path rows Remove test asset data and repurpose AssetProcessors.cpp to sync asset/folder data to and from TEDS Modify the AssetDataLabel widget to show folder/asset colors TEDS UI: Add a new FSlateColor column and create a widget to view/edit it #jira UE-221631 #rb Julien.StJean [CL 36039406 by aditya ravichandran in ue5-main branch]
39 lines
1.2 KiB
C++
39 lines
1.2 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "Experimental/ContentBrowserExtensionUtils.h"
|
|
#include "ContentBrowserDataSubsystem.h"
|
|
#include "ContentBrowserUtils.h"
|
|
#include "CollectionViewUtils.h"
|
|
#include "ContentBrowserItemPath.h"
|
|
#include "IContentBrowserDataModule.h"
|
|
|
|
namespace UE::Editor::ContentBrowser::ExtensionUtils
|
|
{
|
|
TOptional<FLinearColor> GetFolderColor(const FName& FolderPath)
|
|
{
|
|
const FName VirtualPath = IContentBrowserDataModule::Get().GetSubsystem()->ConvertInternalPathToVirtual(FolderPath);
|
|
|
|
FName CollectionName;
|
|
ECollectionShareType::Type CollectionFolderShareType = ECollectionShareType::CST_All;
|
|
|
|
if(ContentBrowserUtils::IsCollectionPath(VirtualPath.ToString(), &CollectionName, &CollectionFolderShareType))
|
|
{
|
|
if(TOptional<FLinearColor> Color = CollectionViewUtils::GetCustomColor(CollectionName, CollectionFolderShareType))
|
|
{
|
|
return Color;
|
|
}
|
|
}
|
|
if (TOptional<FLinearColor> Color = ContentBrowserUtils::GetPathColor(FolderPath.ToString()))
|
|
{
|
|
return Color.GetValue();
|
|
}
|
|
|
|
return TOptional<FLinearColor>();
|
|
}
|
|
|
|
void SetFolderColor(const FName& FolderPath, const FLinearColor& FolderColor)
|
|
{
|
|
ContentBrowserUtils::SetPathColor(FolderPath.ToString(), FolderColor);
|
|
}
|
|
}
|