More work on blueprint MCP
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
#include "EdGraphSchema_K2.h"
|
||||
#include "Kismet2/BlueprintEditorUtils.h"
|
||||
|
||||
FBlueprintVar::FBlueprintVar(UBlueprint* BP, const FString& VarName)
|
||||
FWingBlueprintVar::FWingBlueprintVar(UBlueprint* BP, const FString& VarName)
|
||||
{
|
||||
FName VarFName(*VarName);
|
||||
int32 VarIndex = FBlueprintEditorUtils::FindNewVariableIndex(BP, VarFName);
|
||||
@@ -27,7 +27,7 @@ FBlueprintVar::FBlueprintVar(UBlueprint* BP, const FString& VarName)
|
||||
}
|
||||
}
|
||||
|
||||
void FBlueprintVar::Dump()
|
||||
void FWingBlueprintVar::Dump()
|
||||
{
|
||||
LoadFlags();
|
||||
LoadDefault();
|
||||
@@ -41,7 +41,7 @@ void FBlueprintVar::Dump()
|
||||
}
|
||||
}
|
||||
|
||||
bool FBlueprintVar::ApplyJson(const FJsonObject* Json)
|
||||
bool FWingBlueprintVar::ApplyJson(const FJsonObject* Json)
|
||||
{
|
||||
bool bHasDefault = Json->HasField(TEXT("DefaultValue"));
|
||||
bool bHasType = Json->HasField(TEXT("VarType"));
|
||||
@@ -66,7 +66,7 @@ bool FBlueprintVar::ApplyJson(const FJsonObject* Json)
|
||||
return true;
|
||||
}
|
||||
|
||||
void FBlueprintVar::LoadFlags()
|
||||
void FWingBlueprintVar::LoadFlags()
|
||||
{
|
||||
InstanceEditable = !(Desc->PropertyFlags & CPF_DisableEditOnInstance);
|
||||
BlueprintReadOnly = (Desc->PropertyFlags & CPF_BlueprintReadOnly) != 0;
|
||||
@@ -80,7 +80,7 @@ void FBlueprintVar::LoadFlags()
|
||||
Description.Empty();
|
||||
}
|
||||
|
||||
void FBlueprintVar::LoadDefault()
|
||||
void FWingBlueprintVar::LoadDefault()
|
||||
{
|
||||
if (DefaultValueProp)
|
||||
DefaultValue = DefaultValueProp.GetText();
|
||||
@@ -88,7 +88,7 @@ void FBlueprintVar::LoadDefault()
|
||||
DefaultValue.Empty();
|
||||
}
|
||||
|
||||
void FBlueprintVar::SaveFlags()
|
||||
void FWingBlueprintVar::SaveFlags()
|
||||
{
|
||||
// CPF flags
|
||||
if (InstanceEditable)
|
||||
@@ -124,14 +124,14 @@ void FBlueprintVar::SaveFlags()
|
||||
Desc->RemoveMetaData(TEXT("tooltip"));
|
||||
}
|
||||
|
||||
bool FBlueprintVar::SaveDefault()
|
||||
bool FWingBlueprintVar::SaveDefault()
|
||||
{
|
||||
if (DefaultValueProp)
|
||||
return DefaultValueProp.SetText(DefaultValue);
|
||||
return true;
|
||||
}
|
||||
|
||||
TArray<WingProperty> FBlueprintVar::MergedProperties()
|
||||
TArray<WingProperty> FWingBlueprintVar::MergedProperties()
|
||||
{
|
||||
TArray<WingProperty> Props = WingProperty::GetAll(
|
||||
FBPVariableDescription::StaticStruct(), Desc, CPF_Edit);
|
||||
@@ -143,7 +143,7 @@ TArray<WingProperty> FBlueprintVar::MergedProperties()
|
||||
WingProperty::Remove(Props, TEXT("DefaultValue"));
|
||||
|
||||
Props.Append(WingProperty::GetAll(
|
||||
FBlueprintVar::StaticStruct(), this, (EPropertyFlags)0));
|
||||
FWingBlueprintVar::StaticStruct(), this, (EPropertyFlags)0));
|
||||
|
||||
// Remove DefaultValue if we don't have a CDO property to back it.
|
||||
if (!DefaultValueProp)
|
||||
|
||||
@@ -313,7 +313,6 @@ TArray<UEdGraphNode*> WingUtils::AllNodes(UBlueprint* BP)
|
||||
bool WingUtils::SaveBlueprintPackage(UBlueprint* BP)
|
||||
{
|
||||
UPackage* Package = BP->GetPackage();
|
||||
UE_LOG(LogTemp, Display, TEXT("UEWingman: SaveBlueprintPackage — begin for '%s'"), *BP->GetName());
|
||||
|
||||
// 1. Build absolute package filename — use .umap for map packages, .uasset otherwise
|
||||
FString PackageExtension = Package->ContainsMap()
|
||||
@@ -688,8 +687,7 @@ FString WingUtils::GetHandlerName(UClass* HandlerClass)
|
||||
{
|
||||
FString Name = HandlerClass->GetName();
|
||||
// Strip "Wing_" prefix
|
||||
if (Name.StartsWith(TEXT("Wing_")))
|
||||
Name = Name.Mid(4);
|
||||
Name.RemoveFromStart(TEXT("Wing_"));
|
||||
return Name;
|
||||
}
|
||||
|
||||
@@ -701,8 +699,7 @@ FString WingUtils::GetHandlerGroup(UClass* HandlerClass)
|
||||
{
|
||||
FString Name = HandlerClass->GetName();
|
||||
// Strip "Wing_" prefix
|
||||
if (Name.StartsWith(TEXT("Wing_")))
|
||||
Name = Name.Mid(4);
|
||||
Name.RemoveFromStart(TEXT("Wing_"));
|
||||
// Everything before the underscore is the group
|
||||
int32 UnderscoreIdx;
|
||||
if (Name.FindChar(TEXT('_'), UnderscoreIdx))
|
||||
|
||||
Reference in New Issue
Block a user