You've already forked UnrealEngineUWP
mirror of
https://github.com/izzy2lost/UnrealEngineUWP.git
synced 2026-03-26 18:15:20 -07:00
#jira UE-164316 #preflight 63e3a287e042058d698ba8b4 [CL 24074931 by patrick boutot in ue5-main branch]
68 lines
1.9 KiB
C++
68 lines
1.9 KiB
C++
// Copyright Epic Games, Inc. All Rights Reserved.
|
|
|
|
#include "MVVMDeveloperProjectSettings.h"
|
|
#include "Engine/Blueprint.h"
|
|
|
|
#define LOCTEXT_NAMESPACE "MVVMDeveloperProjectSettings"
|
|
|
|
UMVVMDeveloperProjectSettings::UMVVMDeveloperProjectSettings()
|
|
{
|
|
AllowedExecutionMode.Add(EMVVMExecutionMode::Immediate);
|
|
AllowedExecutionMode.Add(EMVVMExecutionMode::Delayed);
|
|
AllowedExecutionMode.Add(EMVVMExecutionMode::Tick);
|
|
}
|
|
|
|
FName UMVVMDeveloperProjectSettings::GetCategoryName() const
|
|
{
|
|
return TEXT("Plugins");
|
|
}
|
|
|
|
FText UMVVMDeveloperProjectSettings::GetSectionText() const
|
|
{
|
|
return LOCTEXT("MVVMProjectSettings", "Model View Viewmodel");
|
|
}
|
|
|
|
bool UMVVMDeveloperProjectSettings::IsPropertyAllowed(const FProperty* Property) const
|
|
{
|
|
check(Property);
|
|
TStringBuilder<256> StringBuilder;
|
|
Property->GetOwnerClass()->GetPathName(nullptr, StringBuilder);
|
|
FSoftClassPath StructPath;
|
|
StructPath.SetPath(StringBuilder);
|
|
if (const FMVVMDeveloperProjectWidgetSettings* Settings = FieldSelectorPermissions.Find(StructPath))
|
|
{
|
|
return !Settings->DisallowedFieldNames.Find(Property->GetFName());
|
|
}
|
|
return true;
|
|
}
|
|
|
|
bool UMVVMDeveloperProjectSettings::IsFunctionAllowed(const UFunction* Function) const
|
|
{
|
|
check(Function);
|
|
TStringBuilder<256> StringBuilder;
|
|
Function->GetOwnerClass()->GetPathName(nullptr, StringBuilder);
|
|
FSoftClassPath StructPath;
|
|
StructPath.SetPath(StringBuilder);
|
|
if (const FMVVMDeveloperProjectWidgetSettings* Settings = FieldSelectorPermissions.Find(StructPath))
|
|
{
|
|
return !Settings->DisallowedFieldNames.Find(Function->GetFName());
|
|
}
|
|
return true;
|
|
}
|
|
|
|
TArray<const UClass*> UMVVMDeveloperProjectSettings::GetAllowedConversionFunctionClasses() const
|
|
{
|
|
TArray<const UClass*> Result;
|
|
for (const FSoftClassPath& SoftClass : AllowedClassForConversionFunctions)
|
|
{
|
|
if (UClass* Class = SoftClass.ResolveClass())
|
|
{
|
|
Result.Add(Class);
|
|
}
|
|
}
|
|
|
|
return Result;
|
|
}
|
|
|
|
#undef LOCTEXT_NAMESPACE
|